question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access a Vpc's Internet Gateway

See original GitHub issue

Add an accessor to the Internet Gateway that was created by the Vpc construct.

Use Case

Trying to add a PublicSubnet to an existing Vpc (with existing public subnets), there is no way to create a route to the Vpc’s existing Internet Gateway, because the reference is not exposed anywhere (that I could find), so the PublicSubnet is not effectively public.

Proposed Solution

  • Either add an accessor to a VPC’s internet gateway, if any
  • Or have the 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…

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
jeanblanchardcommented, Dec 6, 2019

Update - I found my workaround, using an escape hatch to get the “IGW” child resource in the Vpc construct:

    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,
    });
3reactions
shearn89commented, May 12, 2020

Having a stab at this, hope to have a PR out soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect to the internet using an internet gateway
An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet.
Read more >
AWS Internet Gateway and VPC Routing - DZone
An Internet Gateway is a logical connection between an AWS VPC and the Internet. It is not a physical device. Each VPC has...
Read more >
AWS — Difference between Internet Gateway and NAT ...
Internet Gateway (IGW) is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet.
Read more >
Internet Gateway and public subnets routing
Attach an Internet gateway · Navigate to the AWS console -> Services. · Under the Networking & Content Delivery section, choose VPC. ·...
Read more >
2.1.3. Create Internet Gateway - Getting Started With AWS
An Internet Gateway (IGW) is a horizontally scaled, redundant, and highly available Amazon VPC component that allows communication between instances in your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found