Setting the Main Route Table

You can set the route table you want to use as the main one for the Virtual Private Cloud (VPC). This route table is then automatically applied to subnets that are not explicitly associated with a route table.

Setting the Main Route Table Using Cockpit

  1. Click Network/Security > Route Tables.

  2. Click the route table you want to set as the main one.
    The route table is selected.

  3. Click Set Main .
    The RTB-XXXXXXXX: SET MAIN dialog box appears.

  4. Click Yes to validate.
    The selected route table is set as the main one for the VPC, and the icon appears in the corresponding line of the Route Tables tab.

Setting the Main Route Table Using AWS CLI

To set a route table as main, use the replace-route-table-association command following this syntax:

Request sample
$ aws ec2 replace-route-table-association \
    --profile YOUR_PROFILE \
    --association-id rtbassoc-4321dcba \
    --route-table-id rtb-1234abcd \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • association-id: The association ID of the current main route table. For more information, see Getting Information About Your Route Tables.

  • route-table-id: The ID of the route table you want to set as main.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The replace-route-table-association command returns the following element:

  • NewAssociationId: The new association ID.

Result sample
 {
    "NewAssociationId": "rtbassoc-abcd1234"
}

The route table is set as the main one for the VPC.

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.