Created
December 7, 2021 05:21
-
-
Save tomharrisonjr/efb9e86b2bedcee744300fdcee934e66 to your computer and use it in GitHub Desktop.
Count as enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "aws_iam_policy_document" "data" { | |
count = terraform.workspace == "production" ? 1 : 0 | |
statement { | |
actions = [ | |
"s3:GetBucketLocation", | |
"s3:ListBucket", | |
] | |
resources = [ | |
aws_s3_bucket.data[0].arn, | |
] | |
} | |
statement { | |
actions = [ | |
"s3:GetObject", | |
"s3:PutObject", | |
] | |
resources = [ | |
"${aws_s3_bucket.data[0].arn}/*", | |
"aws_s3_bucket.data[0].arn", | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment