Amazon Elastic Compute Cloud
API Reference (API Version 2012-04-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

ReplaceRoute

Description

Replaces an existing route within a route table in a VPC. For more information about route tables, go to Route Tables in the Amazon Virtual Private Cloud User Guide.

Request Parameters

NameDescriptionRequired

RouteTableId

The ID of the route table where the route will be replaced.

Type: String

Default: None

Yes

DestinationCidrBlock

The CIDR address block used for the destination match. For example: 0.0.0.0/0. The value you provide must match the CIDR of an existing route in the table.

Type: String

Default: None

Yes
GatewayId

The ID of a gateway attached to your VPC.

Type: String

Default: None

Condition: You must provide only one of the following: a GatewayID, InstanceID, or NetworkInterfaceId.

Conditional

InstanceId

The ID of a NAT instance in your VPC.

Type: String

Default: None

Condition: You must provide only one of the following: a GatewayID, InstanceID, or NetworkInterfaceId.

Conditional

NetworkInterfaceId

Allow routing to network interface attachments.

Type: String

Default: None

Condition: You must provide only one of the following: GatewayId, InstanceId, or NetworkInterfaceId.

Conditional

Response Elements

The elements in the following table are wrapped in a ReplaceRouteResponse structure.

NameDescription

requestId

The ID of the request.

Type: String

return

Returns true if the request succeeds. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

This example replaces a route in the route table with ID rtb-e4ad488d. The new route matches the CIDR 10.0.0.0/8 and sends the traffic to the virtual private gateway with ID vgw-1d00376e.

https://ec2.amazonaws.com/?Action=ReplaceRoute
&RouteTableId=rtb-e4ad488d
&DestinationCidrBlock=10.0.0.0/8
&GatewayId=vgw-1d00376e
&AUTHPARAMS

Example Response

<ReplaceRouteResponse xmlns="http://ec2.amazonaws.com/doc/2012-04-01/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <return>true</return>
</ReplaceRouteResponse>