associate_route_table
¶
associate_route_table(
*,
config_overrides: Optional[EC2ClientConfig] = None,
gateway_id: Optional[RouteGatewayId] = None,
public_ipv4_pool: Optional[Ipv4PoolEc2Id] = None,
dry_run: Optional[Boolean] = None,
subnet_id: Optional[SubnetId] = None,
route_table_id: Optional[RouteTableId] = None,
) -> AssociateRouteTableResult
Associates a subnet in your VPC or an internet gateway or virtual private gateway attached to your VPC with a route table in your VPC. This association causes traffic from the subnet or gateway to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table later. A route table can be associated with multiple subnets.
For more information, see Route tables in the Amazon VPC User Guide.
Parameters:
-
gateway_id(Optional[RouteGatewayId], default:None) –The ID of the internet gateway or virtual private gateway.
-
public_ipv4_pool(Optional[Ipv4PoolEc2Id], default:None) –The ID of a public IPv4 pool. A public IPv4 pool is a pool of IPv4 addresses that you've brought to Amazon Web Services with BYOIP.
-
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. -
subnet_id(Optional[SubnetId], default:None) –The ID of the subnet.
-
route_table_id(Optional[RouteTableId], default:None) –The ID of the route table.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To associate a route table with a subnet This example associates the specified route table with the specified subnet.
Source code in docs_src/capo_ec2/_services/ec2.py
4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 | |