[Bug]: aws_cloudformation_stack always wants to change templates which (i) do not have a trailing newline and (ii) are greater than 16KB #29342
Labels
bug
Addresses a defect in current functionality.
service/cloudformation
Issues and PRs that pertain to the cloudformation service.
Terraform Core Version
v1.3.8
AWS Provider Version
v4.54.0
Affected Resource(s)
Expected Behavior
If you create an
aws_cloudformation_stack
resource with atemplate_body
that doesn't change between runs,terraform plan
will report "no changes required".Actual Behavior
If your
template_body
parameter:then Terraform will want to update your CloudFormation stack in-place, whether or not you've changed anything.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
This contains a reproduction test case: terraform-cf-repro.zip
This is the Terraform configuration file:
These refer to six different CloudFormation YAML files, also included. Each file is the Hello Bucket example from the AWS CloudFormation documentation, followed by a comment to pad the files to the correct length. For ease of debugging, the comment is just the file's name repeated over and over (e.g.
16383-newline 16383-newline 16383-newline
).The files are named with:
-newline
) or not (-no-newline
)Steps to Reproduce
With the configuration above, run:
Observe that the
terraform plan
output wants to make changes to theaws_cloudformation_stack.hello_bucket_16385_no_newline
resource, and that resource only.Debug Output
I've uploaded debug logs for both the apply and plan commands here: https://gist.github.com/alexwlchan/dc359ac14d277dddbffa3f63bb6e5ff8
Panic Output
No response
Important Factoids
No response
References
I don't know if it's the same root cause, but there have been other issues with
aws_cloudformation_stack
indefinitely applying changes, e.g. #55Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: