| Did this page help you? Yes No Tell us about it... |
Changes the route table associated with a given subnet in a VPC.
You can also use this to change which table is the main route table in the VPC. You just specify the main route table's association ID and the route table that you want to be the new main route table.
After you execute this action, the subnet uses the routes in the new route table it's associated with. For more information about route tables, go to Route Tables in the Amazon Virtual Private Cloud User Guide.
The short version of this command is ec2reprtbassoc.
ec2-replace-route-table-association
route_table_association_id -r route_table_id
| Name | Description | Required |
|---|---|---|
|
|
The ID for the existing association to replace (which was returned to you when you associated the original route table with subnet). Type: String Default: None Example: rtbassoc-93a045fa |
Yes |
|
|
The ID of the new route table to associate with the subnet. Type: String Default: None Example: -r rtb-6aa34603 |
Yes |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
The command returns a table that contains the following information:
Output type identifier ("ASSOCIATION")
The new association ID
The route table ID
Amazon EC2 command line tools display errors on stderr.
This example starts with a route table associated with a subnet, and a corresponding association ID rtbassoc-f8ad4891. You want to associate a different route table (table rtb-f9ad4890) to the subnet. The result is a new association ID representing the new association.
PROMPT>ec2-replace-route-table-association rtbassoc-f8ad4891 -r rtb-f9ad4890ASSOCIATION rtbassoc-61a34608 rtb-f9ad4890