replace_route
¶
replace_route(
*,
config_overrides: Optional[EC2ClientConfig] = 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.
>>> 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/ec2.py
57132 57133 57134 57135 57136 57137 57138 57139 57140 57141 57142 57143 57144 57145 57146 57147 57148 57149 57150 57151 57152 57153 57154 57155 57156 57157 57158 57159 57160 57161 57162 57163 57164 57165 57166 57167 57168 57169 57170 57171 57172 57173 57174 57175 57176 57177 57178 57179 57180 57181 57182 57183 57184 57185 57186 57187 57188 57189 57190 57191 57192 57193 57194 57195 57196 57197 57198 57199 57200 57201 57202 57203 57204 57205 57206 57207 57208 57209 57210 57211 57212 57213 57214 57215 57216 57217 57218 57219 57220 57221 57222 57223 57224 57225 57226 57227 57228 57229 57230 57231 57232 57233 57234 57235 57236 57237 57238 57239 57240 57241 57242 57243 57244 57245 57246 57247 57248 57249 57250 57251 57252 57253 57254 57255 57256 57257 57258 57259 57260 57261 57262 57263 57264 57265 57266 | |