Replace Route
ec2_replace_route | R Documentation |
Replaces an existing route within a route table in a VPC¶
Description¶
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 VPC User Guide.
Usage¶
ec2_replace_route(DestinationCidrBlock, DestinationIpv6CidrBlock,
DestinationPrefixListId, DryRun, VpcEndpointId,
EgressOnlyInternetGatewayId, GatewayId, InstanceId, LocalTarget,
NatGatewayId, TransitGatewayId, LocalGatewayId, CarrierGatewayId,
NetworkInterfaceId, RouteTableId, VpcPeeringConnectionId,
CoreNetworkArn)
Arguments¶
DestinationCidrBlock
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.
DestinationIpv6CidrBlock
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.
DestinationPrefixListId
The ID of the prefix list for the route.
DryRun
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
DryRunOperation
. Otherwise, it isUnauthorizedOperation
.VpcEndpointId
The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
EgressOnlyInternetGatewayId
[IPv6 traffic only] The ID of an egress-only internet gateway.
GatewayId
The ID of an internet gateway or virtual private gateway.
InstanceId
The ID of a NAT instance in your VPC.
LocalTarget
Specifies whether to reset the local route to its default target (
local
).NatGatewayId
[IPv4 traffic only] The ID of a NAT gateway.
TransitGatewayId
The ID of a transit gateway.
LocalGatewayId
The ID of the local gateway.
CarrierGatewayId
[IPv4 traffic only] The ID of a carrier gateway.
NetworkInterfaceId
The ID of a network interface.
RouteTableId
[required] The ID of the route table.
VpcPeeringConnectionId
The ID of a VPC peering connection.
CoreNetworkArn
The Amazon Resource Name (ARN) of the core network.
Value¶
An empty list.
Request syntax¶
svc$replace_route(
DestinationCidrBlock = "string",
DestinationIpv6CidrBlock = "string",
DestinationPrefixListId = "string",
DryRun = TRUE|FALSE,
VpcEndpointId = "string",
EgressOnlyInternetGatewayId = "string",
GatewayId = "string",
InstanceId = "string",
LocalTarget = TRUE|FALSE,
NatGatewayId = "string",
TransitGatewayId = "string",
LocalGatewayId = "string",
CarrierGatewayId = "string",
NetworkInterfaceId = "string",
RouteTableId = "string",
VpcPeeringConnectionId = "string",
CoreNetworkArn = "string"
)
Examples¶
## Not run:
# This example replaces the specified route in the specified table table.
# The new route matches the specified CIDR and sends the traffic to the
# specified virtual private gateway.
svc$replace_route(
DestinationCidrBlock = "10.0.0.0/16",
GatewayId = "vgw-9a4cacf3",
RouteTableId = "rtb-22574640"
)
## End(Not run)