terraform-aws-modules / terraform-aws-eks

Terraform module to create Amazon Elastic Kubernetes (EKS) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/eks/aws
Apache License 2.0
4.47k stars 4.08k forks source link

Master branch commit fdd44c - broken launch configurations for multiple worker node configurations #140

Closed mmcaya closed 6 years ago

mmcaya commented 6 years ago

I have issues

@max-rocket-internet Quick heads-up This change broke worker launch configurations for multiple worker group configurations: https://github.com/terraform-aws-modules/terraform-aws-eks/blame/master/workers.tf#L31

* module.eks.aws_launch_configuration.workers[1]: Resource 'aws_iam_instance_profile.workers' not found for variable 'aws_iam_instance_profile.workers.id'
* module.eks.aws_launch_configuration.workers[0]: Resource 'aws_iam_instance_profile.workers' not found for variable 'aws_iam_instance_profile.workers.id'

Previous code had it properly select via the count index

-  iam_instance_profile        = "${aws_iam_instance_profile.workers.id}"
+  iam_instance_profile        = "${element(aws_iam_instance_profile.workers.*.id, count.index)}"

I'm submitting a...

What is the current behavior?

If this is a bug, how to reproduce? Please include a code sample if relevvant.

Sample multi worker group config

worker_groups = [
  {
    "name"                 = "green"
    "instance_type"        = "m4.large"
    "asg_desired_capacity" = "0"
    "asg_max_size"         = "0"
    "asg_min_size"         = "0"
  },
  {
    "name"                 = "blue"
    "instance_type"        = "m4.large"
    "asg_desired_capacity" = "2"
    "asg_max_size"         = "2"
    "asg_min_size"         = "2"
  },
]

worker_group_count = "2"

What's the expected behavior?

Are you able to fix this problem and submit a PR? Link here if you have already.

Can submit PR by end of day 9/25 if a fix doesn't make it in

Environment details

Any other relevant info

max-rocket-internet commented 6 years ago

Thanks! Can you confirm this fixes it? https://github.com/terraform-aws-modules/terraform-aws-eks/pull/141

mmcaya commented 6 years ago

👍 look good from my local testing,

------------------------------------------------------------------------
No changes. Infrastructure is up-to-date.
max-rocket-internet commented 6 years ago

Thanks! My mistake.

github-actions[bot] commented 1 year ago

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.