- Newest
- Most votes
- Most comments
Good answer from Riku_Kobayashi - I'd like to point out one other thing:
When you create a Transit Gateway there is a single route table. But Transit Gateways can have more than one route tables to enabled for attachment traffic separation (think, VRF-Lite in traditional routers).
So the way to see "entire route table for the transit gateway" is to look at all of them, understanding that a route table is associated with an attachment (which you could consider to be a router interface in the traditional sense - VPCs, Direct Connect, VPNs and SD-WAN appliances can all be attachments).
For more information: https://youtu.be/X_4ekgRc4C8?t=710
Hello.
I was looking through the AWS CLI commands for Transit Gateway and I have settled on 'search-transit-gateway-routes' but I can't tell if that would actually get me the destination and attachments or just the ID of the transit gateway route table.
An example output is provided in the document below, and the attachment ID, destination CIDR, etc. are output.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/search-transit-gateway-routes.html
In fact, if you run it using the "--filters "Name=state,Values=active"" you're expecting, you'll see output like the one below.
You can use "--filters "Name=state,Values=active"" to get routes with status "active".
{
"Routes": [
{
"DestinationCidrBlock": "172.31.0.0/16",
"TransitGatewayRouteTableAnnouncementId": "",
"TransitGatewayAttachments": [
{
"ResourceId": "vpc-d05042b7",
"TransitGatewayAttachmentId": "tgw-attach-1111111111",
"ResourceType": "vpc"
}
],
"Type": "propagated",
"State": "active"
}
],
"AdditionalRoutesAvailable": false
}
Also, if you want to get a list of TransitGateway route table IDs, you can use "describe-transit-gateway-route-tables" as shown below.
aws ec2 describe-transit-gateway-route-tables --query "TransitGatewayRouteTables"[]."TransitGatewayRouteTableId" | jq -r .[]
Relevant content
- asked 8 months ago
- Accepted Answerasked 4 years ago
- Accepted Answerasked a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
So I need to specifically query the list of attachments (route table IDs?) and then for each of the associated route tables in order to see all of the routes?
If you you're trying to map which VPCs (and other attachments) can reach specific routes then you will need both the routes that are in each route table; and the mapping of which route tables are assigned to each attachment. So listing the attachments and the route tables associated with them is a good start.