terraform-aws-cloudfront-s3-cdn
terraform-aws-cloudfront-s3-cdn copied to clipboard
Deployment will fail with MalformedXML by default
Found a bug? Maybe our Slack Community can help.
Describe the Bug
The aws_s3_bucket.origin
resource will fail with Error: Error putting S3 CORS: MalformedXML: The XML you provided was not well-formed or did not validate against our published schema
with the default settings.
This is because the XML generated contains an empty <CORSRule>
, which is normally created by the aliases
variable.
Expected Behavior
The deployment succeeds with default settings, even if the user doesn't supply an alias or cors_allowed_origins.
Steps to Reproduce
Steps to reproduce the behavior:
module "cloudfront_s3_cdn" {
source = "git::https://github.com/cloudposse/terraform-aws-cloudfront-s3-cdn.git?ref=0.23.1"
namespace = var.namespace
stage = var.promotion_level
name = var.project
acm_certificate_arn = var.certarn
parent_zone_id = var.zone.zone_id
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
- Terraform v0.12.25
- provider.aws v2.63.0
- module v0.23.1
Additional Context
Maybe default cors_allowed_origins
to ["*"]
, or require an alias
?