terraform-aws-cloudfront-s3-cdn icon indicating copy to clipboard operation
terraform-aws-cloudfront-s3-cdn copied to clipboard

Deployment will fail with MalformedXML by default

Open Makeshift opened this issue 4 years ago • 0 comments

Found a bug? Maybe our Slack Community can help.

Slack Community

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?

Makeshift avatar Jun 03 '20 13:06 Makeshift