cloudposse / terraform-aws-eks-node-group

Terraform module to provision a fully managed AWS EKS Node Group
https://cloudposse.com/accelerate
Apache License 2.0
91 stars 128 forks source link

Instance type order preference not respected #135

Closed xeivieni closed 1 year ago

xeivieni commented 1 year ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

As stated in the AWS node group documentation here https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html

Managed node groups use the order of instance types passed in the API to determine which instance type to use first when fulfilling On-Demand capacity. For example, you might specify three instance types in the following order: c5.large, c4.large, and c3.large. When your On-Demand Instances are launched, the managed node group fulfills On-Demand capacity by starting with c5.large, then c4.large, and then c3.large

However, the module overrides the order of the instance_types list by doing a sort on it https://github.com/cloudposse/terraform-aws-eks-node-group/blob/master/main.tf#L74

Expected Behavior

The order of preference of the instance_types shall be passed to the node_group resource as specified by the user

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a node group with three instance types
  2. Apply
  3. Change the order of the instance types
  4. plan
  5. See no changes
Nuru commented 1 year ago

closed by #142