aws-eks: Support `CUSTOM` AMI type on Nodegroups
Artemigos opened this issue · comments
Describe the feature
CloudFormation supports passing CUSTOM
as value for AmiType
: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-amitype
This is not available in CDK, making the use of custom AMIs impossible.
Use Case
When building custom AMIs for a cluster (e.g. based on the EKS optimized images) you should be able to use them.
Proposed Solution
Rough idea:
- add the
CUSTOM
type to the enum: - modify
to append
CUSTOM
as the last option for all architectures
It looks like this should already be enough, but I didn't actually attempt doing this.
Other Information
I tried forcing the issue by bypassing TypeScript checks: amiType: ('CUSTOM' as any)
- internal check rejected it. After investigating a little - the Nodegroup
constructor tries to do the right thing and validates the value, but completely ignores the existence of CUSTOM
in CloudFormation.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.133.0
Environment details (OS name and version, etc.)
Ubuntu 22.04.4 LTS
@Artemigos Yes we should support that.
- when
CUSTOM
is provided, a launch template has to be provided as well. - we probably should add CUSTOM to possibleAmiTypes here:
Feel free to submit a PR for it. Thank you.