Skip to content

fix(eks-v2): generate and export L1 constructs from aws-eks-v2#37640

Open
letsgomeow wants to merge 4 commits into
aws:mainfrom
letsgomeow:feature/37563
Open

fix(eks-v2): generate and export L1 constructs from aws-eks-v2#37640
letsgomeow wants to merge 4 commits into
aws:mainfrom
letsgomeow:feature/37563

Conversation

@letsgomeow

@letsgomeow letsgomeow commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #37563.

Reason for this change

aws-eks-v2 is intended to replace aws-eks, but its index.ts only exported L2
constructs. L1 constructs (e.g. CfnPodIdentityAssociation) were not accessible from
aws-eks-v2, forcing users to import from aws-eks as well — defeating the purpose of
a self-contained replacement module.

Additionally, the L2 files inside aws-eks-v2 imported their L1 constructs and
interface types from ../../aws-eks, creating a hidden dependency on the module it is
meant to replace.

Description of changes

  • Added aws-eks-v2 to scripts/scope-map.json with the AWS::EKS namespace so that
    eks.generated.ts is generated independently for aws-eks-v2 at build time.
    Language binding targets (java, dotnet, python) are explicitly specified to
    preserve the existing eks_v2 / EKSv2 / aws_eks_v2 naming and avoid conflicts
    with aws-eks.
  • Added export * from './eks.generated' to aws-eks-v2/lib/index.ts so all L1
    constructs (CfnAddon, CfnCluster, CfnFargateProfile, CfnIdentityProviderConfig,
    CfnNodegroup, CfnAccessEntry, CfnCapability, CfnPodIdentityAssociation) are
    now publicly accessible from aws-eks-v2.
  • Updated all L2 source files in aws-eks-v2/lib/ to import L1 constructs from the
    local ./eks.generated instead of ../../aws-eks.
  • Updated all L2 source files in aws-eks-v2/lib/ to import interface types
    (IClusterRef, ClusterReference, etc.) directly from
    ../../interfaces/generated/aws-eks-interfaces.generated instead of ../../aws-eks.
    These interfaces are already shared across modules by design.
  • Updated aws-eks-v2/test/nodegroup.test.ts to import CfnNodegroup from ../lib
    instead of ../../aws-eks.

Describe any new or updated permissions being added

None.

Description of how you validated changes

  • Added aws-eks-v2/test/l1-exports.test.ts to verify that all 8 L1 constructs
    (CfnAddon, CfnCluster, CfnFargateProfile, CfnIdentityProviderConfig,
    CfnNodegroup, CfnAccessEntry, CfnCapability, CfnPodIdentityAssociation) are
    exported from aws-eks-v2.
  • All existing aws-eks-v2 unit 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:

  1. integ.eks-kubectl-security-groups — Test Case 2 used the deprecated securityGroup prop, which causes a DeprecationError under the JSII_DEPRECATED=fail environment that yarn integ enforces. Changed to
    securityGroups: [sg] (array form). The synthesized CloudFormation template is identical.
  2. integ.eks-cluster-removal-policy / integ.eks-inference-nodegroup — Both tests had EKS_USE_NATIVE_OIDC_PROVIDER: false, which was set in chore(deps): update integ runner and cloud assembly versions to include docker build context #37350 to preserve snapshot compatibility after the flag was
    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

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.
@github-actions github-actions Bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p1 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Apr 19, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 19, 2026 12:59

@aws-cdk-automation aws-cdk-automation left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@letsgomeow

Copy link
Copy Markdown
Contributor Author

Exemption Request

This fix only adds L1 construct generation and export for aws-eks-v2. No CloudFormation templates are affected — the synthesized output of existing tests is identical before and after this change. The fix is verified by the added unit test (l1-exports.test.ts), which confirms all 8 L1 constructs are accessible from aws-eks-v2.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Apr 19, 2026
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 19, 2026
- 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
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 28, 2026 10:28

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p1 pr/needs-maintainer-review This PR needs a review from a Core Team Member pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-eks-v2-alpha: CfnPodIdentityAssociation missing from module

2 participants