fix: error: No more than 1 "s3_origin_config" blocks are allowed @Eyjafjallajokull (#359)
## what- Fixed
No more than 1 s3_origin_config blocks are allowederror when using multiple S3 origins with origin access identity enabled - Changed
for_eachfrom iterating overvar.s3_originsto using[1]to create a singles3_origin_configblock
why
- AWS CloudFront only allows one s3_origin_config block per origin
- The previous implementation incorrectly created multiple blocks when multiple S3 origins were configured
references
fixes #325
to reproduce error
- in examples/complete/main.tf#L102 replace
origin_access_controlwithorigin_access_identity
https://github.com/Eyjafjallajokull/terraform-aws-cloudfront-s3-cdn/blob/96703043867c986ff3fc1550448118111a9f5659/examples/complete/main.tf#L102 terraform planfails with the above error.