replace_route
async
¶
replace_route(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
destination_prefix_list_id: Optional[PrefixListResourceId] = None,
vpc_endpoint_id: Optional[VpcEndpointId] = None,
local_target: Optional[Boolean] = None,
transit_gateway_id: Optional[TransitGatewayId] = None,
local_gateway_id: Optional[LocalGatewayId] = None,
carrier_gateway_id: Optional[CarrierGatewayId] = None,
core_network_arn: Optional[CoreNetworkArn] = None,
odb_network_arn: Optional[OdbNetworkArn] = None,
dry_run: Optional[Boolean] = None,
route_table_id: Optional[RouteTableId] = None,
destination_cidr_block: Optional[String] = None,
gateway_id: Optional[RouteGatewayId] = None,
destination_ipv6_cidr_block: Optional[String] = None,
egress_only_internet_gateway_id: Optional[EgressOnlyInternetGatewayId] = None,
instance_id: Optional[InstanceId] = None,
network_interface_id: Optional[NetworkInterfaceId] = None,
vpc_peering_connection_id: Optional[VpcPeeringConnectionId] = None,
nat_gateway_id: Optional[NatGatewayId] = None,
) -> None
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:
-
destination_prefix_list_id(Optional[PrefixListResourceId], default:None) –The ID of the prefix list for the route.
-
vpc_endpoint_id(Optional[VpcEndpointId], default:None) –The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
-
local_target(Optional[Boolean], default:None) –Specifies whether to reset the local route to its default target (
local). -
transit_gateway_id(Optional[TransitGatewayId], default:None) –The ID of a transit gateway.
-
local_gateway_id(Optional[LocalGatewayId], default:None) –The ID of the local gateway.
-
carrier_gateway_id(Optional[CarrierGatewayId], default:None) –[IPv4 traffic only] The ID of a carrier gateway.
-
core_network_arn(Optional[CoreNetworkArn], default:None) –The Amazon Resource Name (ARN) of the core network.
-
odb_network_arn(Optional[OdbNetworkArn], default:None) –The Amazon Resource Name (ARN) of the ODB network.
-
dry_run(Optional[Boolean], default: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 isUnauthorizedOperation. -
route_table_id(Optional[RouteTableId], default:None) –The ID of the route table.
-
destination_cidr_block(Optional[String], default: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.
-
gateway_id(Optional[RouteGatewayId], default:None) –The ID of an internet gateway or virtual private gateway.
-
destination_ipv6_cidr_block(Optional[String], default: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.
-
egress_only_internet_gateway_id(Optional[EgressOnlyInternetGatewayId], default:None) –[IPv6 traffic only] The ID of an egress-only internet gateway.
-
instance_id(Optional[InstanceId], default:None) –The ID of a NAT instance in your VPC.
-
network_interface_id(Optional[NetworkInterfaceId], default:None) –The ID of a network interface.
-
vpc_peering_connection_id(Optional[VpcPeeringConnectionId], default:None) –The ID of a VPC peering connection.
-
nat_gateway_id(Optional[NatGatewayId], default:None) –[IPv4 traffic only] The ID of a NAT gateway.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To replace a route 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.
>>> await client.replace_route(route_table_id='rtb-22574640', destination_cidr_block='10.0.0.0/16', gateway_id='vgw-9a4cacf3')
Source code in docs_src/capo_ec2/_services/async_ec2.py
57931 57932 57933 57934 57935 57936 57937 57938 57939 57940 57941 57942 57943 57944 57945 57946 57947 57948 57949 57950 57951 57952 57953 57954 57955 57956 57957 57958 57959 57960 57961 57962 57963 57964 57965 57966 57967 57968 57969 57970 57971 57972 57973 57974 57975 57976 57977 57978 57979 57980 57981 57982 57983 57984 57985 57986 57987 57988 57989 57990 57991 57992 57993 57994 57995 57996 57997 57998 57999 58000 58001 58002 58003 58004 58005 58006 58007 58008 58009 58010 58011 58012 58013 58014 58015 58016 58017 58018 58019 58020 58021 58022 58023 58024 58025 58026 58027 58028 58029 58030 58031 58032 58033 58034 58035 58036 58037 58038 58039 58040 58041 58042 58043 58044 58045 58046 58047 58048 58049 58050 58051 58052 58053 58054 58055 58056 58057 58058 58059 58060 58061 58062 58063 58064 58065 58066 | |