Skip to content

Support instance weights for override_instance_types #1720

@ghost

Description

It would be great when using an ASG with multiple instance types, to be able to specify weights, something like:

override_instance_types = [
        {
          instance_type     = "t3a.xlarge"
          weighted_capacity = 4
        },
        {
          instance_type     = "t3.xlarge"
          weighted_capacity = 4
        },
        {
          instance_type     = "t3a.large"
          weighted_capacity = 2
        },
        {
          instance_type     = "t3.large"
          weighted_capacity = 2
        },
      ]

But this seems impossible due to https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/workers_launch_template.tf#L168

https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/spot-instances.md#using-launch-templates-with-both-spot-and-on-demand mentions "(first in the array if they are not weighted)." but I do not see how to weight them.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions