You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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*
0 commit comments