Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karpenter module tries to re-add empty tags to aws_eks_pod_identity_association #3137

Closed
1 task done
al-lac opened this issue Aug 26, 2024 · 4 comments
Closed
1 task done

Comments

@al-lac
Copy link

al-lac commented Aug 26, 2024

Description

When using the Karpenter module and using the default tag value which is {} the aws_eks_pod_identity_association always tries to add empty tags.

If your request is for a new feature, please use the Feature request template.

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 20.24.0

  • Terraform version: 1.7.3

  • Provider version(s):
    • provider registry.terraform.io/hashicorp/aws v5.64.0
    • provider registry.terraform.io/hashicorp/kubernetes v2.32.0

Reproduction Code [Required]

module "karpenter" {
  source  = "terraform-aws-modules/eks/aws//modules/karpenter"
  version = "~> 20.0"

  cluster_name = module.eks.cluster_name

  enable_v1_permissions = true

  enable_pod_identity             = true
  create_pod_identity_association = true

  # Used to attach additional IAM policies to the Karpenter node IAM role
  node_iam_role_additional_policies = {
    AmazonSSMManagedInstanceCore = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
  }

  #tags = null
}

Steps to reproduce the behavior:

  • Deploy EKS Cluster
  • Use Karpenter module
  • Run terraform apply

Expected behavior

Terraform should show no changes on the tags.

No changes. Your infrastructure matches the configuration.

Actual behavior

Terraform tries to add the empty tags on every run:

  # module.karpenter.aws_eks_pod_identity_association.karpenter[0] will be updated in-place
  ~ resource "aws_eks_pod_identity_association" "karpenter" {
        id              = "<id>"
      + tags            = {}
        # (7 unchanged attributes hidden)
    }

Terminal Output Screenshot(s)

Additional context

Also mentioned in this issue on the aws provider repo: hashicorp/terraform-provider-aws#37146

Possible solution could be to set the default value to null.

@bryantbiggs
Copy link
Member

see #3138 (comment)

@al-lac
Copy link
Author

al-lac commented Aug 26, 2024

Hey @bryantbiggs, looked into adding the CustomizeDiff: verify.SetTagsDiff to the resource. So far i am not sure how this would work out.

As the issue was closed on the provider and also this one in a different module was closed, I wonder if this will ever be fixed or if just setting the tags to some value of null is enough for now...

@al-lac
Copy link
Author

al-lac commented Aug 27, 2024

Ok there seems to be another issue open already here: hashicorp/terraform-provider-aws#38173

And also a PR, so hopefully this is fixed soon on the provider level: hashicorp/terraform-provider-aws#38636

@al-lac al-lac closed this as completed Aug 27, 2024
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants
@bryantbiggs @al-lac and others