Issue with aws_cloudfront_distribution.ordered_cache_behavior.forwarded_values.headers #19675
Labels
bug
Addresses a defect in current functionality.
service/cloudfront
Issues and PRs that pertain to the cloudfront service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
TLDR
When the headers are not specified (they are documented as optional), it looks like a possible prior value is being retained on update (via terraform apply). I was expecting a deterministic behavior (such as defaulting to an empty list).
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
aws_cloudfront_distribution
Terraform Configuration Files
Multiple config files. error happens on apply changes to existing resource.
Both config files attached in zip file below.
Steps to Reproduce
I've attached a zip file that includes a reproduce.sh script that will create the resources and demonstrate the issue.
awsCloudfrontHeaderIssue.zip
Expected Behavior
Actual Behavior
Important Factoids
The header name that triggered the error is present in the original tf file, but removed in the target tf file. It looks like that removal was not correctly processed, which triggers the AWS message.
When run, terraform does not report the removal of the headers in the planned change. For my use case, that impacted the origin change from custom->S3.
the diff on the *.tf files in the shell script looks like this
The text was updated successfully, but these errors were encountered: