aws / aws/aws-cdk

aws-eks: AutoScalingGroupCapacityOptions - support MixedInstancesPolicy

Open
#35,732 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-eks @aws-cdk/aws-eks-v2-alpha effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Add MixedInstancesPolicy as an optional parameter to the AutoScalingGroupCapacityOptions interface. Update validation logic to address incompatible arguments.

### Use Case

I am unable to specify multiple instance types for my EKS self managed capacity created via `cluster.addAutoScalingGroupCapacity`. This can be accomplished by specifying multiple instance types in a `MixedInstancesPolicy`.

### Proposed Solution

Add a new optional parameter `MixedInstancesPolicy` to the `AutoScalingGroupCapacityOptions` interface. Make `instanceType` an optional field. Adjust validation logic to handle cases where certain fields cannot be specified alongside `MixedInstancesPolicy`. The validation will be similar to what is done in the EKS `NodeGroup` constructor https://github.com/aws/aws-cdk/blob/v2.219.0/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts#L389

### Other Information

_No response_

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

aws-cdk-lib@2.215.0

### AWS CDK CLI version

2.1030.0

### Environment details (OS name and version, etc.)

MacOS Sequoia 15.7.1

Contributor guide

Open the contributing guide

Research direction

Start with cluster.addAutoScalingGroupCapacity and the AutoScalingGroupCapacityOptions interface, then compare its validation with the EKS NodeGroup constructor in packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts around line 389. Done means MixedInstancesPolicy is accepted optionally, instanceType is optional, and incompatible arguments are rejected by validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, kubernetes, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.