replace_route_table_association
¶
replace_route_table_association(
*,
config_overrides: Optional[EC2ClientConfig] = None,
dry_run: Optional[Boolean] = None,
association_id: Optional[RouteTableAssociationId] = None,
route_table_id: Optional[RouteTableId] = None,
) -> ReplaceRouteTableAssociationResult
Changes the route table associated with a given subnet, internet gateway, or virtual private gateway in a VPC. After the operation completes, the subnet or gateway uses the routes in the new route table. For more information about route tables, see Route tables in the Amazon VPC User Guide.
You can also use this operation to change which table is the main route table in the VPC. Specify the main route table's association ID and the route table ID of the new main route table.
Parameters:
-
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. -
association_id(Optional[RouteTableAssociationId], default:None) –The association ID.
-
route_table_id(Optional[RouteTableId], default:None) –The ID of the new route table to associate with the subnet.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To replace the route table associated with a subnet This example associates the specified route table with the subnet for the specified route table association.
>>> client.replace_route_table_association(association_id='rtbassoc-781d0d1a', route_table_id='rtb-22574640')
Source code in docs_src/capo_ec2/_services/ec2.py
57268 57269 57270 57271 57272 57273 57274 57275 57276 57277 57278 57279 57280 57281 57282 57283 57284 57285 57286 57287 57288 57289 57290 57291 57292 57293 57294 57295 57296 57297 57298 57299 57300 57301 57302 57303 57304 57305 57306 57307 57308 57309 57310 57311 57312 57313 57314 57315 57316 57317 57318 57319 57320 57321 57322 57323 57324 57325 57326 | |