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

ReplaceRoute

Description

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

Request Parameters

RouteTableId

The ID of the route table.

Type: String

Default: None

Required: Yes

DestinationCidrBlock

The CIDR address block used for the destination match. The value you provide must match the CIDR of an existing route in the table.

Type: String

Default: None

Required: Yes

GatewayId

The ID of a gateway attached to your VPC.

Type: String

Default: None

Required: Conditional

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

InstanceId

The ID of a NAT instance in your VPC.

Type: String

Default: None

Required: Conditional

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

NetworkInterfaceId

Allows routing to network interface attachments.

Type: String

Default: None

Required: Conditional

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

Response Elements

The following elements are returned in a ReplaceRouteResponse element.

requestId

The ID of the request.

Type: xsd: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/2013-02-01/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <return>true</return>
</ReplaceRouteResponse>