Skip to content

EC2  >  Operations  >  replace_route

replace_route

Operation

replace_route async

replace_route(request: ReplaceRouteInput | ReplaceRouteInputDict, /, *, plugins: list[Plugin] | None = None) -> ReplaceRouteOutput
replace_route(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[ReplaceRouteInputDict]) -> ReplaceRouteOutput

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.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ReplaceRouteOutput

An instance of ReplaceRouteOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

ReplaceRouteInput dataclass

Bases: _SerdeShape

Dataclass for ReplaceRouteInput structure.

Attributes
carrier_gateway_id class-attribute instance-attribute
carrier_gateway_id: str | None = ...

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

core_network_arn class-attribute instance-attribute
core_network_arn: str | None = ...

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

destination_cidr_block class-attribute instance-attribute
destination_cidr_block: str | None = ...

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.

destination_ipv6_cidr_block class-attribute instance-attribute
destination_ipv6_cidr_block: str | None = ...

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.

destination_prefix_list_id class-attribute instance-attribute
destination_prefix_list_id: str | None = ...

The ID of the prefix list for the route.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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

egress_only_internet_gateway_id class-attribute instance-attribute
egress_only_internet_gateway_id: str | None = ...

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

gateway_id class-attribute instance-attribute
gateway_id: str | None = ...

The ID of an internet gateway or virtual private gateway.

instance_id class-attribute instance-attribute
instance_id: str | None = ...

The ID of a NAT instance in your VPC.

local_gateway_id class-attribute instance-attribute
local_gateway_id: str | None = ...

The ID of the local gateway.

local_target class-attribute instance-attribute
local_target: bool | None = ...

Specifies whether to reset the local route to its default target (local).

nat_gateway_id class-attribute instance-attribute
nat_gateway_id: str | None = ...

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

network_interface_id class-attribute instance-attribute
network_interface_id: str | None = ...

The ID of a network interface.

odb_network_arn class-attribute instance-attribute
odb_network_arn: str | None = ...

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

route_table_id class-attribute instance-attribute
route_table_id: str | None = ...

The ID of the route table.

transit_gateway_id class-attribute instance-attribute
transit_gateway_id: str | None = ...

The ID of a transit gateway.

vpc_endpoint_id class-attribute instance-attribute
vpc_endpoint_id: str | None = ...

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

vpc_peering_connection_id class-attribute instance-attribute
vpc_peering_connection_id: str | None = ...

The ID of a VPC peering connection.

Dictionaries

ReplaceRouteInputDict

Bases: TypedDict

Dictionary form of ReplaceRouteInput.

Attributes
carrier_gateway_id instance-attribute
carrier_gateway_id: str | None

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

core_network_arn instance-attribute
core_network_arn: str | None

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

destination_cidr_block instance-attribute
destination_cidr_block: str | None

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.

destination_ipv6_cidr_block instance-attribute
destination_ipv6_cidr_block: str | None

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.

destination_prefix_list_id instance-attribute
destination_prefix_list_id: str | None

The ID of the prefix list for the route.

dry_run instance-attribute
dry_run: bool | None

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

egress_only_internet_gateway_id instance-attribute
egress_only_internet_gateway_id: str | None

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

gateway_id instance-attribute
gateway_id: str | None

The ID of an internet gateway or virtual private gateway.

instance_id instance-attribute
instance_id: str | None

The ID of a NAT instance in your VPC.

local_gateway_id instance-attribute
local_gateway_id: str | None

The ID of the local gateway.

local_target instance-attribute
local_target: bool | None

Specifies whether to reset the local route to its default target (local).

nat_gateway_id instance-attribute
nat_gateway_id: str | None

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

network_interface_id instance-attribute
network_interface_id: str | None

The ID of a network interface.

odb_network_arn instance-attribute
odb_network_arn: str | None

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

route_table_id instance-attribute
route_table_id: Required[str]

The ID of the route table.

transit_gateway_id instance-attribute
transit_gateway_id: str | None

The ID of a transit gateway.

vpc_endpoint_id instance-attribute
vpc_endpoint_id: str | None

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

vpc_peering_connection_id instance-attribute
vpc_peering_connection_id: str | None

The ID of a VPC peering connection.

Output

ReplaceRouteOutput dataclass

Bases: _SerdeShape

Dataclass for ReplaceRouteOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.