feat(eks): add support for EC2, HYBRID_LINUX, and HYPERPOD_LINUX access entry types #36350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP
Issue # (if applicable)
Closes #34394.
Reason for this change
When provisioning an EKS cluster in Auto Mode with custom node roles, users need to grant the node role access to the cluster with the
EC2access entry type. Currently, thegrantAccess()method doesn't support specifying the access entry type, defaulting toSTANDARD, which prevents nodes from joining Auto Mode clusters.Additionally, the
AccessEntryTypeenum is missing three CloudFormation-supported types:EC2,HYBRID_LINUX, andHYPERPOD_LINUX.Description of changes
This PR adds support for specifying access entry types in the
grantAccess()method and extends theAccessEntryTypeenum with missing CloudFormation-supported values.Changes made:
AccessEntryTypeenum with three new values:EC2- For EKS Auto Mode node rolesHYBRID_LINUX- For EKS Hybrid NodesHYPERPOD_LINUX- For Amazon SageMaker HyperPodaccessEntryTypeparameter toCluster.grantAccess()methodaddToAccessEntry()method to pass type through to AccessEntry constructor@aws-cdk/aws-eks-v2-alpha(alpha) andaws-cdk-lib/aws-eks(stable) packagesAPI changes:
CloudFormation impact:
accessEntryTypeis provided:Typeproperty is set inAWS::EKS::AccessEntryaccessEntryTypeis not provided:Typeproperty remains undefined (backward compatible)No breaking changes: This is a fully backward-compatible feature addition. The new parameter is optional and placed at the end of the method signature. All existing code continues to work without modification.
Describe any new or updated permissions being added
N/A - No new IAM permissions required. This change only exposes existing CloudFormation access entry types through the CDK L2 API.
Description of how you validated changes
Unit tests:
Integration tests:
integ.eks-grant-access-with-type.tsin both packagesAccessEntryTypevalues (EC2,HYBRID_LINUX,HYPERPOD_LINUX)STANDARDtype withgrantAccess()Backward compatibility verification:
JSII compilation: Successful for all target languages (TypeScript, Python, Java, C#, Go)
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license