From 1cdecec925d3ab4956fc86a0475724cfebce23c7 Mon Sep 17 00:00:00 2001 From: Adam Crews Date: Sun, 7 Jun 2020 16:00:39 -0700 Subject: [PATCH] Use splat+join pattern to avoid erroneous recreates of the policy (#29) Co-authored-by: Erik Osterman --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index f22fea41..a4f94674 100644 --- a/main.tf +++ b/main.tf @@ -130,7 +130,7 @@ data "aws_iam_policy_document" "bucket_policy" { sid = "DenyUnEncryptedObjectUploads" effect = "Deny" actions = ["s3:PutObject"] - resources = ["arn:aws:s3:::${aws_s3_bucket.default[0].id}/*"] + resources = ["arn:aws:s3:::${join("", aws_s3_bucket.default.*.id)}/*"] principals { identifiers = ["*"]