Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

support ability to use aws_iam_policy_document instead of directly having a policy doc in the resource #508

Open
fawaf opened this issue Dec 2, 2020 · 0 comments

Comments

@fawaf
Copy link

fawaf commented Dec 2, 2020

e.g.

data "aws_iam_policy_document" "foo" {
  statement {
      effect = "Allow"
      principals {
        type = "AWS"
        identifiers = [
          "arn:aws:iam::blah"
        ]
      }
      actions = "sts:AssumeRole"
  }
}

resource "aws_iam_role" "backups" {
    name               = "backups"
    path               = "/"
    assume_role_policy = data.aws_iam_policy_document.foo.json
}

vs

resource "aws_iam_role" "foo" {
    name               = "backups"
    path               = "/"
    assume_role_policy = <<POLICY
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "AWS": [
          "arn:aws:iam::blah"
        ]
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
POLICY
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant