We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d378e4b commit f6c3ce2Copy full SHA for f6c3ce2
main.tf
@@ -87,8 +87,11 @@ data "aws_iam_policy_document" "origin_website" {
87
}
88
89
resource "aws_s3_bucket_policy" "default" {
90
- count = (module.this.enabled && (! local.using_existing_origin || var.override_origin_bucket_policy)) ? 1 : 0
91
- bucket = join("", aws_s3_bucket.origin.*.bucket)
+ count = (module.this.enabled && (! local.using_existing_origin || var.override_origin_bucket_policy)) ? 1 : 0
+ bucket = join("", local.using_existing_origin
92
+ ? data.aws_s3_bucket.selected.*.bucket # Existing origin S3 bucket
93
+ : aws_s3_bucket.origin.*.bucket # Origin S3 bucket this module manages
94
+ )
95
policy = local.iam_policy_document
96
97
0 commit comments