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

Managed node groups' launch template "$Latest" version producing an infinite always-changing plan #2087

Closed
1 task done
tal-asulin opened this issue May 25, 2022 · 5 comments

Comments

@tal-asulin
Copy link

tal-asulin commented May 25, 2022

Description

When using managed node group and setting the launch template version to "$Latest", Terraform will always show a difference in the plan and apply changes.

The issue was first introduced in older version - v17.1.0 and got fixed on v17.1.3 but the same issue happened again #1446 in newer versions (18.21.0).

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

Versions

  • Module version [Required]: 18.21.0

  • Terraform & providers version:
    Terraform v1.2.0
    on darwin_amd64

  • provider registry.terraform.io/hashicorp/aws v4.15.1
  • provider registry.terraform.io/hashicorp/cloudinit v2.2.0
  • provider registry.terraform.io/hashicorp/kubernetes v2.11.0
  • provider registry.terraform.io/hashicorp/tls v3.4.0

Reproduction Code [Required]

Produced using the module' example:

module "eks" {
  source          = "terraform-aws-modules/eks/aws"
  version         = "18.21.0"
  cluster_version = "1.21"
  cluster_name    = "test_cluster"
  vpc_id          = "<VPC_ID>"
  subnet_ids      = ["<SUBNET_ID_1>","<SUBNET_ID_2>]

  eks_managed_node_group_defaults = {
    disk_size               = 50
    instance_types          = ["m6i.large", "m5.large", "m5n.large", "m5zn.large"]
    launch_template_version = "$Latest"
    tags                    = {"default_tag" = "test_tag"}
  }

  eks_managed_node_groups = {
    green = {
      min_size     = 1
      max_size     = 10
      desired_size = 1

      instance_types = ["t3.large"]
      capacity_type  = "SPOT"
    }
  }
}

Steps to reproduce the behavior:

  1. Apply the plan for the first time
  2. Apply the plan again (without making any changes).

Expected behavior

No changes to the launch template version and the plan itself.

Actual behavior

Launch template version will constantly change from static number to $Latest even if no change was done to the plan.

Terminal Output Screenshot(s)

Screen Shot 2022-05-25 at 21 26 05

Additional context

@bryantbiggs
Copy link
Member

Remove this line:

    launch_template_version = "$Latest"

@tal-asulin
Copy link
Author

Removing this line will truly make this behaviour disappear, but isn't it a valid value to set? for example, changing launch template metadata will bump the launch template version and will be resulted with the desired change in Terraform plan.

@bryantbiggs
Copy link
Member

bryantbiggs commented May 25, 2022

It is, but see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group#version

image

@tal-asulin
Copy link
Author

Understood. Thanks @bryantbiggs for the quick response.

@github-actions
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 Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants