Getting Information About Your Route Tables

You can get information about one or more of your route tables, like the Virtual Private Cloud (VPC) they are created for or the routes they contain.

If you exceed the number of identical requests allowed for a configured time period, the RequestLimitExceeded error message is returned.

This procedure uses AWS CLI only. Information about these resources is also available from Cockpit. For more information, see VPC User Interface (for Cockpit v1) or the Route Tables dashboard (for Cockpit v2-beta).

To get information about one or more route tables, use the describe-route-tables command following this syntax:

Request sample
$ aws ec2 describe-route-tables \
    --profile YOUR_PROFILE \
    [--route-table-id NOT_SPECIFIED] \
    --filters Name=vpc-id,Values=vpc-12345678 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • (optional) route-table-ids: One or more IDs of route tables.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • association.route-table-association-id: The ID of an association for the route table.

    • association.route-table-id: The ID of the route table involved in the association.

    • association.subnet-id: The ID of the subnet involved in the association.

    • association.main: Indicates whether the route table is the main one for the VPC (true | false).

    • route-table-id: The ID of the route table.

    • route.destination-cidr-block: The destination range of IPs specified in a route in the table, in CIDR notation.

    • route.destination-prefix-list-id: The prefix list ID of the service reachable through a VPC endpoint specified in a route in the table. For more information, see Getting Information About Prefix Lists.

    • route.gateway-id: The ID of the Internet gateway or Virtual Private gateway attached to the VPC used as the route target.

    • route.instance-id: The ID of an instance in the VPC used as the route target.

    • route.nat-gateway-id: The ID of a NAT gateway used a the route target.

    • route.origin: Indicates how the route was created (create-route-table if the route was automatically created when creating the route table, create-route if the route was manually created, or vgw-route-propagation if the route was propagated using route propagation).

    • route.state: The state of a route in the route table (active | blackhole). For more information, see About Route Tables.

    • route.vpc-peering-connection-id: The ID of a VPC peering connection specified in a route of the route table.

    • tag-key: The key of a tag associated with the resource.

    • tag-value: The value of a tag associated with the resource.

    • tag:XXXX: The value of a tag associated with the resource, where XXXX is the key of the tag.

      To filter a tag whose key is XXXX and value is YYYY, you can therefore use either of the following two formats:

      • --filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY

      • --filters Name=tag:XXXX,Values=YYYY

    • vpc-id: The ID of the VPC.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-route-tables command returns the following elements:

  • RouteTable: Information about one or more route tables. This element contains the following information:

    • Association: One or more associations between the route table and subnets. This element contains the following information:

      • RouteTableAssociationId: The ID of the association between the route table and a subnet.

      • Main: If true, the route table is the main one for the VPC. If false, it is not.

      • RouteTableId: The ID of the route table.

    • RouteTableId: The ID of the route table.

    • VpcId: The ID of the VPC.

    • PropagatingVgws: Virtual Private gateways (VGW) propagating routes, in BGP protocol.

    • Tags: One or more tags associated with the route table. This element contains the following information:

      • Value: The value of the tag.

      • Key: The key of the tag.

    • Routes: Information about the routes contained in the route table. This element contains the following information:

      • GatewayId: The target gateway used for the route.

        This can also be a instance-id or a nat-gateway-id.

      • DestinationCidrBlock: The destination range of IPs, in CIDR notation.

      • State: The state of the route.

Result sample
{
    "RouteTables": [
        {
            "Associations": [
                {
                    "RouteTableAssociationId": "rtbassoc-1234abcd",
                    "Main": true,
                    "RouteTableId": "rtb-4321dcba"
                }
            ],
            "RouteTableId": "rtb-5678abcd",
            "VpcId": "vpc-12345678",
            "PropagatingVgws": [],
            "Tags": [
                {
                    "Value": "SUB1",
                    "Key": "Name"
                }
            ],
            "Routes": [
                {
                    "GatewayId": "local",
                    "DestinationCidrBlock": "10.0.0.0/16",
                    "State": "active"
                }
            ]
        }
    ]
}

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.