| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need if you want to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.
For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.
RouteTableIdThe ID of the route table.
Type: String
Default: None
Required: Yes
SubnetIdThe ID of the subnet.
Type: String
Default: None
Required: Yes
The following elements are returned in an
AssociateRouteTableResponse element.
requestIdThe ID of the request.
Type: xsd:string
associationIdThe ID that AWS provides to represent the association of the route table and the subnet.
Type: xsd:string
This example associates a route table with ID rtb-e4ad488d with a subnet with ID subnet-15ad487c.
https://ec2.amazonaws.com/?Action=AssociateRouteTable &RouteTableId=rtb-e4ad488d &SubnetId=subnet-15ad487c
<AssociateRouteTableResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <associationId>rtbassoc-f8ad4891</associationId> </AssociateRouteTableResponse>