Skip to content

Commit 75944e9

Browse files
fix: error: No more than 1 "s3_origin_config" blocks are allowed (#359)
When using multiple s3_origins with origin_access_type set to "origin_access_identity", multiple s3_origin_config blocks were incorrectly created. Fixed to create only one s3_origin_config block.
1 parent b07360f commit 75944e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ resource "aws_cloudfront_distribution" "default" {
601601
) : null
602602

603603
dynamic "s3_origin_config" {
604-
for_each = local.origin_access_identity_enabled ? var.s3_origins : []
604+
for_each = local.origin_access_identity_enabled ? [1] : []
605605
content {
606606
# the following enables specifying the origin_access_identity used by the origin created by this module, prior to the module's creation:
607607
origin_access_identity = (

0 commit comments

Comments
 (0)