fix(eks-v2): generate and export L1 constructs from aws-eks-v2#37640
Open
letsgomeow wants to merge 4 commits into
Open
fix(eks-v2): generate and export L1 constructs from aws-eks-v2#37640letsgomeow wants to merge 4 commits into
letsgomeow wants to merge 4 commits into
Conversation
Generate L1 constructs for aws-eks-v2 by adding an entry in scope-map.json, and export them from index.ts so users can import Cfn* classes (e.g. CfnPodIdentityAssociation) directly from aws-eks-v2 without depending on aws-eks. Also update internal L2 imports to use the local eks.generated and the shared interfaces module, removing all dependencies on aws-eks.
aws-cdk-automation
previously requested changes
Apr 19, 2026
Contributor
Author
|
Exemption Request This fix only adds L1 construct generation and export for |
- Replace deprecated securityGroup with securityGroups in integ.eks-kubectl-security-groups - Switch EKS_USE_NATIVE_OIDC_PROVIDER from false to true in integ.eks-cluster-removal-policy and integ.eks-inference-nodegroup; using false with AlbController causes DeprecationError because OpenIdConnectProvider (Custom Resource) is deprecated - Add stackUpdateWorkflow: false to both tests to reflect the intentional migration from Custom Resource OIDC Provider to native AWS::IAM::OIDCProvider - Update integ snapshots accordingly
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue # (if applicable)
Closes #37563.
Reason for this change
aws-eks-v2is intended to replaceaws-eks, but itsindex.tsonly exported L2constructs. L1 constructs (e.g.
CfnPodIdentityAssociation) were not accessible fromaws-eks-v2, forcing users to import fromaws-eksas well — defeating the purpose ofa self-contained replacement module.
Additionally, the L2 files inside
aws-eks-v2imported their L1 constructs andinterface types from
../../aws-eks, creating a hidden dependency on the module it ismeant to replace.
Description of changes
aws-eks-v2toscripts/scope-map.jsonwith theAWS::EKSnamespace so thateks.generated.tsis generated independently foraws-eks-v2at build time.Language binding targets (
java,dotnet,python) are explicitly specified topreserve the existing
eks_v2/EKSv2/aws_eks_v2naming and avoid conflictswith
aws-eks.export * from './eks.generated'toaws-eks-v2/lib/index.tsso all L1constructs (
CfnAddon,CfnCluster,CfnFargateProfile,CfnIdentityProviderConfig,CfnNodegroup,CfnAccessEntry,CfnCapability,CfnPodIdentityAssociation) arenow publicly accessible from
aws-eks-v2.aws-eks-v2/lib/to import L1 constructs from thelocal
./eks.generatedinstead of../../aws-eks.aws-eks-v2/lib/to import interface types(
IClusterRef,ClusterReference, etc.) directly from../../interfaces/generated/aws-eks-interfaces.generatedinstead of../../aws-eks.These interfaces are already shared across modules by design.
aws-eks-v2/test/nodegroup.test.tsto importCfnNodegroupfrom../libinstead of
../../aws-eks.Describe any new or updated permissions being added
None.
Description of how you validated changes
aws-eks-v2/test/l1-exports.test.tsto verify that all 8 L1 constructs(
CfnAddon,CfnCluster,CfnFargateProfile,CfnIdentityProviderConfig,CfnNodegroup,CfnAccessEntry,CfnCapability,CfnPodIdentityAssociation) areexported from
aws-eks-v2.aws-eks-v2unit tests pass without modification.Checklist
Additional changes in latest commit:
While merging main and running the full aws-eks-v2 integration test suite, I found and fixed three pre-existing test issues unrelated to the original L1 export changes:
securityGroups: [sg] (array form). The synthesized CloudFormation template is identical.
introduced. However, both tests use AlbController, which internally accesses cluster.openIdConnectProvider. With false, this resolves to the deprecated OpenIdConnectProvider (Custom Resource), causing a
DeprecationError at synthesis time. These tests have been broken since chore(deps): update integ runner and cloud assembly versions to include docker build context #37350 was merged.
Changed to EKS_USE_NATIVE_OIDC_PROVIDER: true and added stackUpdateWorkflow: false to reflect the intentional migration from the Custom Resource-based OIDC provider to the native AWS::IAM::OIDCProvider.
The snapshot changes show the removal of Custom::AWSCDKOpenIdConnectProvider, AWS::IAM::Role (Lambda execution role), and AWS::Lambda::Function (provider handler), replaced by a single AWS::IAM::OIDCProvider
resource — this is the expected and desired outcome.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license