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.76k stars 9.12k forks source link

[Bug]: aws_eks_addons - heredocs on configuration_values trigger changes #39391

Open davivcgarcia opened 1 week ago

davivcgarcia commented 1 week ago

Terraform Core Version

1.9.6

AWS Provider Version

5.67.0

Affected Resource(s)

aws_eks_addon

Expected Behavior

Provider should handle "heredoc" style of string literal values on configuration_values indepotently.

Actual Behavior

Provider is always triggering changes when the same configuration_values is given. For example:

Terraform will perform the following actions:

  # module.eks.aws_eks_addon.this["snapshot-controller"] will be updated in-place
  ~ resource "aws_eks_addon" "this" {
      ~ configuration_values        = <<-EOT
            tolerations:
              - key: "CriticalAddonsOnly"
                operator: "Exists"
        EOT
        id                          = "kcdporto24:snapshot-controller"
        tags                        = {
            "Environment" = "kcdporto24"
            "GithubOrg"   = "terraform-aws-modules"
            "GithubRepo"  = "terraform-aws-eks"
        }
        # (11 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

N/A

Steps to Reproduce

  1. Create EKS cluster
  2. Add addons with custom configuration values

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 week ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

davivcgarcia commented 1 week ago

If I replace the heredoc literal string with jsonencode, the behaviour is fixed.

configuration_values = jsonencode(
        {
          tolerations = [
            {
              key = "CriticalAddonsOnly"
              operator = "Exists"
            }
          ]
        }
      )