Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

DescribeRouteTables

Description

Describes one or more of your route tables.

For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Parameters

RouteTableId.n

One or more route table IDs.

Type: String

Default: Returns all route tables, or only those otherwise specified.

Required: No

Filter.n.Name

The name of a filter. See the Supported Filters section for a list of supported filter names.

Type: String

Default: None

Required: No

Filter.n.Value.m

A value for the filter. See the Supported Filters section for a list of supported values for each filter.

Type: String

Default: None

Required: No

Supported Filters

You can specify filters so that the response includes information for only certain tables. For example, you can use a filter to specify that you're interested in the tables associated with a particular subnet. You can specify multiple values for a filter. The response includes information for a table only if it matches at least one of the filter values that you specified.

You can specify multiple filters; for example, specify tables that have a specific route and are associated with a specific subnet. The response includes information for a table only if it matches all the filters that you specified. If there's no match, no special message is returned, the response is simply empty.

You can use wildcards in a filter value. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character. You can escape special characters using a backslash (\) before the character. For example, a value of \*amazon\?\\ searches for the literal string *amazon?\.

The following are the available filters.

association.route-table-association-id

The ID of an association ID for the route table.

Type: String

association.route-table-id

The ID of the route table involved in the association.

Type: String

association.subnet-id

The ID of the subnet involved in the association.

Type: String

association.main

Indicates whether the route table is the main route table for the VPC.

Type: Boolean

route-table-id

The ID of the route table.

Type: String

route.destination-cidr-block

The CIDR range specified in a route in the table.

Type: String

route.gateway-id

The ID of a gateway specified in a route in the table.

Type: String

route.instance-id

The ID of an instance specified in a route in the table.

Type: String

route.origin

Describes how the route was created.

Type: String

Valid values: CreateRouteTable | CreateRoute | EnableVgwRoutePropogation

CreateRouteTable indicates that route was automatically created when the route table was created.

CreateRoute indicates that the route was manually added to the route table.

EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

route.state

The state of a route in the route table. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on).

Type: String

Valid values: active | blackhole

tag-key

The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key filter.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide.

Type: String

tag-value

The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

Type: String

tag:key

Filters the response based on a specific tag/value combination.

Example: To list just the resources that have been assigned tag Purpose=X, specify:

Filter.1.Name=tag:Purpose

Filter.1.Value.1=X

Example: To list just resources that have been assigned tag Purpose=X OR Purpose=Y, specify:

Filter.1.Name=tag:Purpose

Filter.1.Value.1=X

Filter.1.Value.2=Y

vpc-id

The ID of the VPC for the route table.

Type: String

Response Elements

The following elements are returned in a DescribeRouteTablesResponse element.

requestId

The ID of the request.

Type: xsd:string

routeTableSet

A list of route tables, each one wrapped in an item element.

Type: RouteTableType

Examples

Example Request

This example describes all route tables in the VPC.

https://ec2.amazonaws.com/?Action=DescribeRouteTables

Example Response

The first route table in the returned list is the VPC's main route table. Its association ID represents the association between the table and the VPC

DescribeRouteTablesResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
   <requestId>6f570b0b-9c18-4b07-bdec-73740dcf861a</requestId>
   <routeTableSet>
      <item>
         <routeTableId>rtb-13ad487a</routeTableId>
         <vpcId>vpc-11ad4878</vpcId>
         <routeSet>
            <item>
               <destinationCidrBlock>10.0.0.0/22</destinationCidrBlock>
               <gatewayId>local</gatewayId>
               <state>active</state>
               <origin>CreateRouteTable</origin>
            </item>
         </routeSet>
         <associationSet>
             <item>
                <routeTableAssociationId>rtbassoc-12ad487b</routeTableAssociationId>
                <routeTableId>rtb-13ad487a</routeTableId>
                <main>true</main>
             </item>
         </associationSet>
        <tagSet/>
      </item>
      <item>
         <routeTableId>rtb-f9ad4890</routeTableId>
         <vpcId>vpc-11ad4878</vpcId>
         <routeSet>
            <item>
               <destinationCidrBlock>10.0.0.0/22</destinationCidrBlock>
               <gatewayId>local</gatewayId>
               <state>active</state>
               <origin>CreateRouteTable</origin>
            </item>
            <item>
               <destinationCidrBlock>0.0.0.0/0</destinationCidrBlock>
               <gatewayId>igw-eaad4883</gatewayId>
               <state>active</state>
            </item>
         </routeSet>
         <associationSet>
            <item>
                <routeTableAssociationId>rtbassoc-faad4893</routeTableAssociationId>
                <routeTableId>rtb-f9ad4890</routeTableId>
                <subnetId>subnet-15ad487c</subnetId>
            </item>
         </associationSet>
         <tagSet/>
      </item>
   </routeTableSet>
</DescribeRouteTablesResponse>