Closed yesteph closed 4 years ago
The fix for this has been merged and will release with version 2.44.0 of the Terraform AWS Provider, early next year. Thanks to @hanazuki for the implementation. 👍
This has been released in version 2.44.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!
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 v0.11.3
Affected Resource(s)
Terraform Configuration Files
We create a aws_cloudformation_stack with a template body specifying some ServerlessApplicationModel SAM resources. This template contains a "Transform": "AWS::Serverless-2016-10-31" directive.
After stack creation, we have two templates in the AWS CloudFormation Console : the Original and the Processed. Among differences, the processed has not anymore the Transform": "AWS::Serverless-2016-10-31" directive.
Expected Behavior
After a terraform apply, we expect no change if we run it again.
Actual Behavior
At the second terraform apply run, aws_cloudformation_stack is planned for change because template_body is considered as changes also, even if the template file has not changed.
Steps to Reproduce
terraform apply
=> the stack is createdterraform apply
=> the stack is changed but I should notImportant Factoids
I looked at the AWS CloudFormation SDK and it is mentionned the "CloudFormation.GetTemplate" AWS API supports the TemplateStage parameter to indicate the 'Original' or 'Processed' one. When activating DEBUG logs in Terraform I see the 'Processed' (without Transform": "AWS::Serverless-2016-10-31").
I suggest to change resource_aws_cloudformation_stack.go line 295 to add TemplateStage: 'Original" in cloudformation.GetTemplateInput.