-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 Bucket replication configuration results in MalformedXML issue in 1.42 #6340
Comments
I think it's the missing |
With any value in the prefix terraform apply works fine here, without a prefix value it failes as described by @heyitskev1n . |
Unfortunately none of the existing acceptance tests were using an empty $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3Bucket_ReplicationWithoutPrefix'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3Bucket_ReplicationWithoutPrefix -timeout 120m
=== RUN TestAccAWSS3Bucket_ReplicationWithoutPrefix
=== PAUSE TestAccAWSS3Bucket_ReplicationWithoutPrefix
=== CONT TestAccAWSS3Bucket_ReplicationWithoutPrefix
--- FAIL: TestAccAWSS3Bucket_ReplicationWithoutPrefix (32.97s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_s3_bucket.bucket: 1 error occurred:
* aws_s3_bucket.bucket: Error putting S3 replication configuration: MalformedXML: The XML you provided was not well-formed or did not validate against our published schema
status code: 400, request id: B01E35921C2C94CB, host id: sb+GryOe0m3ANw2IcNXao57E18ZbbGe1qUzi2nkNmHCrN8xFGqLfkzMlOILmK/Eso9GwdHMHmck=
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 32.982s
GNUmakefile:20: recipe for target 'testacc' failed
make: *** [testacc] Error 1 |
even when I leave out prefix in my config, terraform seems to put in an empty one :(. I think we need to be compliant with CRR v2. Checking out the example replication configs at https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-add-config.html shows that to replicate the whole bucket, just leave out the filter section. |
Note: having this problem with Terraform: 0.11.8. Applying a TF config that used to work now fails with the above-referenced error. My replication_configuration block looks like:
|
The fix for this has been merged and will release with version 1.43.0 of the AWS provider, likely later today or tomorrow. 👍 |
This has been released in version 1.43.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform: 0.11.7
AWS Provider: 1.42.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
The apply succeeds.
Actual Behavior
The
terraform apply
command errors with the following error:Steps to Reproduce
terraform apply
.Important Factoids
Pinning our AWS provider version to 1.41 allows the
terraform apply
to succeedagain. Looking in CloudTrail there's a difference in the request parameters of thePutBucketReplication
sent to AWS between using the two different provider versions, specifically around theID
andPrefix
properties.1.41:
1.42:
References
The ReplicationConfiguration docs seem to indicate that "ID" is one of the minimum required fields for a rule but even providing that property on the TF config results in the same issue.
https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-add-config.html
The text was updated successfully, but these errors were encountered: