From fa36c015d338ce29c1e6815371f16eab05fea706 Mon Sep 17 00:00:00 2001 From: Adam Crews Date: Fri, 5 Jun 2020 10:49:48 -0700 Subject: [PATCH] Use splat+join pattern to avoid erroneous recreates of the policy --- 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 = ["*"]