-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Access a Vpc's Internet Gateway #5327
Comments
Vpc
's Internet Gateway
Update - I found my workaround, using an escape hatch to get the "IGW" child resource in the const igw = vpc.node.findChild('IGW') as CfnInternetGateway;
new CfnRoute(this, 'IGW', {
routeTableId: subnet.routeTable.routeTableId,
destinationCidrBlock: '0.0.0.0/0',
gatewayId: igw.ref,
}); |
Glad you could figure it out! :) Closing this issue. Feel free to reopen. |
Having a stab at this, hope to have a PR out soon. |
This commit introduces a new `internetGateway` attribute to the VPC construct to allow for creative routing using the default IGW added with when using a public subnet. Resolves #5327 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This commit introduces a new `internetGateway` attribute to the VPC construct to allow for creative routing using the default IGW added with when using a public subnet. Resolves aws#5327 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This commit introduces a new `internetGateway` attribute to the VPC construct to allow for creative routing using the default IGW added with when using a public subnet. Resolves aws#5327 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@jeanblanchard This is not working now. |
Don't know if this is a regression, or if it was never fixed, but this still doesn't work in |
Hi @daverickdunn - unless it was added since I did the work on this then the PR never supported getting the IGW ID from an imported VPC, as stated in the README: I just didn't have the time to add it in since that wasn't my use case! Still, I'm curious why the escape hatch isn't working, unless the child name has changed. I'll see if I can dig through and find out. |
@shearn89 Yep, my apologies, I should probably open a new issue for this. FWIW, I did a quick |
It looks like the VPC Context Provider in cx-api isn't actually returning the internet gateway, if I'm reading it correctly... |
Add an accessor to the Internet Gateway that was created by the
Vpc
construct.Use Case
Trying to add a
PublicSubnet
to an existingVpc
(with existing public subnets), there is no way to create a route to theVpc
's existing Internet Gateway, because the reference is not exposed anywhere (that I could find), so thePublicSubnet
is not effectively public.Proposed Solution
PublicSubnet
constructor automagically create the route from the VPC it's a part of.(Or, ideally, both)
Other
I'd take a workaround within CDK, that allows this without creating (and paying for) a second IGW...
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: