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...

CreateRouteTable

Description

Creates a route table within a VPC. After you create a new route table, you can add routes and associate the table with a subnet. For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Parameters

VpcId

The ID of the VPC.

Type: String

Default: None

Required: Yes

Response Elements

The following elements are returned in a CreateRouteTableResponse element.

requestId

The ID of the request.

Type: xsd:string

routeTable

Information about the newly created route table.

Type: RouteTableType

Examples

Example Request

This example creates a route table within the VPC with ID of vpc-11ad4878.

https://ec2.amazonaws.com/?Action=CreateRouteTable
&VpcId=vpc-11ad4878
&AUTHPARAMS

Example Response

By default, every route table includes a local route that enables traffic to flow within the VPC. The following response shows that route.

CreateRouteTableResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01 /">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <routeTable>
      <routeTableId>rtb-f9ad4890</routeTableId>
      <vpcId>vpc-11ad4878</vpcId>
      <routeSet>
         <item>
            <destinationCidrBlock>10.0.0.0/22</destinationCidrBlock>
            <gatewayId>local</gatewayId>
            <state>active</state>
         </item>
      </routeSet>
      <associationSet/>
      <tagSet/>
   </routeTable>
</CreateRouteTableResponse>