Skip to main content

Route Table Association

Associate a subnet to a Route Table

Code

Route Table associated with a subnet

exports.createResources = () => [
{
type: "RouteTableAssociation",
group: "EC2",
dependencies: () => ({
routeTable: "route-table",
subnet: "subnet",
}),
},
];

Examples

Dependencies

List

List only the route tables with the RouteTableAssociation filter:

gc l -t RouteTableAssociation
Listing resources on 1 provider: aws
✓ aws
✓ Initialising
✓ Listing 5/5
┌────────────────────────────────────────────────────────────────────────────────┐
│ 2 EC2::RouteTableAssociation from aws │
├────────────────────────────────────────────────────────────────────────────────┤
│ name: rt-assoc::route-table-public::subnet-1 │
│ managedByUs: Yes │
│ live: │
│ Main: false │
│ RouteTableAssociationId: rtbassoc-0347f6252694e72d0 │
│ RouteTableId: rtb-0c48ec9583f4e9318 │
│ SubnetId: subnet-029068595723f242e │
│ AssociationState: │
│ State: associated │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ name: rt-assoc::route-table-public::subnet-2 │
│ managedByUs: Yes │
│ live: │
│ Main: false │
│ RouteTableAssociationId: rtbassoc-05e975dd7e1adec87 │
│ RouteTableId: rtb-0c48ec9583f4e9318 │
│ SubnetId: subnet-0c9c5cf8b25507188 │
│ AssociationState: │
│ State: associated │
│ │
└────────────────────────────────────────────────────────────────────────────────┘


List Summary:
Provider: aws
┌───────────────────────────────────────────────────────────────────────────────┐
│ aws │
├────────────────────────────┬──────────────────────────────────────────────────┤
│ EC2::RouteTableAssociation │ rt-assoc::route-table-public::subnet-1 │
│ │ rt-assoc::route-table-public::subnet-2 │
└────────────────────────────┴──────────────────────────────────────────────────┘
2 resources, 1 type, 1 provider
Command "gc l -t RouteTableAssociation" executed in 5s