v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-171,1822,9897.4 MB

Replaces an existing route within a route table in a VPC.

You must specify either a destination CIDR block or a prefix list ID. You must also specify exactly one of the resources from the parameter list, or reset the local route to its default target.

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

get/#Action=ReplaceRoute

Query parameters

DestinationCidrBlockstring

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

DestinationIpv6CidrBlockstring

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

DestinationPrefixListIdstring

The ID of the prefix list for the route.

DryRunboolean

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.

VpcEndpointIdstring

The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.

EgressOnlyInternetGatewayIdstring

[IPv6 traffic only] The ID of an egress-only internet gateway.

GatewayIdstring

The ID of an internet gateway or virtual private gateway.

InstanceIdstring

The ID of a NAT instance in your VPC.

LocalTargetboolean

Specifies whether to reset the local route to its default target (<code>local</code>).

NatGatewayIdstring

[IPv4 traffic only] The ID of a NAT gateway.

TransitGatewayIdstring

The ID of a transit gateway.

LocalGatewayIdstring

The ID of the local gateway.

CarrierGatewayIdstring

[IPv4 traffic only] The ID of a carrier gateway.

NetworkInterfaceIdstring

The ID of a network interface.

RouteTableIdstring required

The ID of the route table.

VpcPeeringConnectionIdstring

The ID of a VPC peering connection.

CoreNetworkArnstring

The Amazon Resource Name (ARN) of the core network.

Action'ReplaceRoute' required
Version'2016-11-15' required

Response

Success