Skip to content

Commit 57f3333

Browse files
shikha372hwum
authored andcommitted
fix(eks): looked up vpc causing premature validation errors for private subnets (#33786)
### Issue # (if applicable) Related to one of the related issue for EKS and VPC in #22025 . ### Reason for this change Currently EKS cluster with private endpoint access fails during `cdk synth` operation for a lookedup VPC. investigating further into lookup implementation, the VPC id is first populated through some dummy values including the one for private subnets : ``` { name: 'Private', type: cxapi.VpcSubnetGroupType.PRIVATE, subnets: [ { availabilityZone: 'dummy1a', subnetId: 'p-12345', routeTableId: 'rtb-12345p', cidr: '1.2.3.4/5', }, ``` But there are no dummy values defined for the case of privatesubnetIds : ``` privateSubnetIds: undefined, ``` which results in return of filtering by IDs option as a null object until the values are fully resolved. Reference code: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts#L2705 ### Description of changes using existing field `isPendingLookup` in the SubnetSelection which is being set on the basis of this.incompleteSubnetDefinition = isIncomplete; where `isIncomplete` is set to false during first pass of cdk synth. So during first synth operation, validation will be skipped. ### Describe any new or updated permissions being added NA ### Description of how you validated changes Added unit test and integration test ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent e5f71db commit 57f3333

File tree

190 files changed

+80055
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+80055
-7
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-use-pipeline-service-role-for-actions.js.snapshot/asset.97484721f29e34bf38d7a459804dd2d2a8dea6f8c27d7531e215bf4274fbc895.bundle/index.js

Lines changed: 30674 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-use-pipeline-service-role-for-actions.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-use-pipeline-service-role-for-actions.js.snapshot/integ-test-use-pipeline-service-role-for-actions.assets.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)