hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 8.99k forks source link

[Bug]: Terraform aws_cloudformation_stack keeps detecting changes on large template_body #26982

Open njuyen opened 1 year ago

njuyen commented 1 year ago

Terraform Core Version

1.2.6

AWS Provider Version

4.32.0

Affected Resource(s)

aws_cloudformation_stack

Expected Behavior

Terraform aws_cloudformation_stack should not show the diffs on unchanged template_body

Actual Behavior

My terraform aws_cloudformation_stack is loading template_body from yaml file template_body = file("${path.root}/${var.template_url}") This keeps displaying the diffs on unchanged template_body if the file is bigger than ~25KB / ~700 lines, smaller files are working well

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_cloudformation_stack" "this" {
  name = var.name
  parameters = var.parameters
  template_body = file("${path.root}/${var.template_url}")
}

variable "name" {
  type = string
}

variable "template_url" {
  type = string
}

variable "parameters" {
  type    = map(any)
  default = {}
}

Steps to Reproduce

  1. Create aws_cloudformation_stack resources with template_body loaded from local file
  2. Create a large cloud formation template yaml file (700 lines) as input of the resource above
  3. Apply
  4. Plan again to see if the output is not 0 change

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

takkara commented 1 year ago

Hi Team, any updates on this? We can still see the issue in latest terraform and aws-provider versions.