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.

VPC construct should allow using custom route table for many subnets

See original GitHub issue

Currently it’s not possible to specify either the number of route tables or inject a custom route table to the VPC construct.

Use Case

When creating VPN or Peering connections together with the VPC it would be great when I can customise the route table. For me there is no drawback having only one for many subnets - it’s less complex when modifying it.

Proposed Solution

Make it possible to set the route table per subnet. Currently it’s readonly. Why?

const privateRouteTable = new CfnRouteTable(this, "privateRouteTable", {
    vpcId: vpc.vpcId
})

const selection = vpc.selectSubnets({
    subnetType: ec2.SubnetType.PRIVATE
});
for (const subnet of selection.subnets) {
    subnet.routeTable = privateRouteTable
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:20
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
kennucommented, Apr 12, 2021

I just had to use:

subnetA.node.tryRemoveChild('RouteTableAssociation')
subnetA.node.tryRemoveChild('RouteTable')

To get rid of the autogenerated route tables in my project. They caused problems in replicating an existing VPC configuration to a new deployment of a project. More specifically they caused problems with VPC S3 Endpoint routing.

3reactions
mikepietruszkacommented, Dec 17, 2019

I second this use case. It would be nice to manage the route tables in VPC construct. Currently it’s hard to get a list of created route tables.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure route tables - Amazon Virtual Private Cloud
Each subnet in your VPC must be associated with a route table. A subnet can be explicitly associated with custom route table, or...
Read more >
AWS — VPC Route Table Overview - Medium
A subnet can be explicitly associated with custom route table. Main route table automatically comes with VPC. It controls the routing for all...
Read more >
Terraform Tutorial - VPC, Subnets, RouteTable, ELB, Security ...
Here are the files we need to create. ... The route tables associated with our public subnet (including custom ... Let's see what...
Read more >
How to Build AWS VPC using Terraform - Step by Step
Routes in the route tables drive the decision to enable or disable internet access. When a subnet is associated with a route table...
Read more >
Routes | VPC - Google Cloud
For custom subnets and custom mode VPC networks, you'll need to create your own ingress allow firewall rules. Static routes. Static routes are...
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