| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
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.
RouteTableIdThe ID of the route table.
Type: String
Default: None
Required: Yes
DestinationCidrBlockThe 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
GatewayIdThe 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.
InstanceIdThe 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.
NetworkInterfaceIdAllows routing to network interface attachments.
Type: String
Default: None
Required: Conditional
Condition: You must provide only one of the following: GatewayId, InstanceId, or
NetworkInterfaceId.
The following elements are returned in a
ReplaceRouteResponse element.
requestIdThe ID of the request.
Type: xsd:string
returnReturns true if the request succeeds. Otherwise, returns an error.
Type: xsd:boolean
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
<ReplaceRouteResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <return>true</return> </ReplaceRouteResponse>