-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vpc: PRIVATE_WITH_EGRESS not getting applied with route to TransitGateway #25626
Comments
You're right, I'm finding the same behavior. When we set the type of imported subnets, we are first checking that the subnet has the type explicitly declared with a tag. If it doesn't, then we will cross reference with the aws-cdk/packages/aws-cdk/lib/context-providers/vpcs.ts Lines 72 to 77 in b60876f
This doesn't account for transit gateway route tables, which are separate. And unfortunately, it doesn't appear we can fetch subnet information from this call. Maybe there's another way we could detect this? |
From what I understand we don't actually need to look at TransitGateway route tables, but just incorporate routes to TransitGatewayIds in the regular route tables. This is how the route looks like in the
So I think what's missing is something like this before line 77
whereas
|
When I do Vpc.fromLookup in a VPC that has subnets with a default route to a TransitGateway the subnet is detected as `PRIVATE_ISOLATED` instead of `PRIVATE_WITH_EGRESS` This PR adds the detection of subnets with TGW routes as `PRIVATE_WITH_EGRESS` instead of `PRIVATE_ISOLATED`. This is potentially a breaking change depending on what is the expected behaviour. To me it seemed rather missed accidentally given that this [previous PR](#21699) mentions that `PRIVATE_WITH_EGRESS` was introduced also for Transit Gateways. Closes #25626 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When I do
Vpc.fromLookup
in a VPC that has subnets with a default route to a TransitGateway the subnet is detected asPRIVATE_ISOLATED
instead ofPRIVATE_WITH_EGRESS
This PR that introduced it talks about TransitGateway too but it doesn't seem to get applied.
Expected Behavior
Detect subnet with a default route to a TransitGateway as
PRIVATE_WITH_EGRESS
Current Behavior
Subnets with a default route to a TransitGateway are detected as
PRIVATE_ISOLATED
Reproduction Steps
Use
Vpc.fromLookup
in a VPC that has subnets with a default route to a TransitGatewayPossible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.66
Framework Version
No response
Node.js Version
16.16
OS
MacOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: