Deleting a Route Table

You can delete a route table that you no longer need and that is not associated with any Subnet. You cannot delete the route table that is set as main.

Deleting a Route Table Using Cockpit v2

Before you begin: Unlink the route table from the Subnets it is linked to. For more information, see Unlinking a Route Table from a Subnet.

  1. In the Route Tables dashboard, click the route table you want to delete.

    Multiselection is available.

    The route table is selected.

  2. Click IconTerminate Delete.
    The DELETE ROUTE TABLES dialog box appears.

  3. Click Delete Route Tables.
    The route table is deleted.

Deleting a Route Table Using OSC CLI

Before you begin: Unlink the route table from the Subnets it is associated with. For more information, see Unlinking a Route Table from a Subnet.

The DeleteRouteTable command deletes a specified route table.
Before deleting a route table, you must disassociate it from any Subnet. You cannot delete the main route table.

Request sample
$ osc-cli api DeleteRouteTable --profile "default" \
    --RouteTableId "rtb-12345678"

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

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • RouteTableId: The ID of the route table you want to delete.

The DeleteRouteTable command returns the following elements:

  • ResponseContext: Information about the context of the response.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Deleting a Route Table Using AWS CLI

Before you begin: Disassociate the route table from the subnets it is associated with. For more information, see Unlinking a Route Table from a Subnet.

To delete a route table, use the delete-route-table command following this syntax:

Request sample
$ aws ec2 delete-route-table \
    --profile YOUR_PROFILE \
    --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.

  • route-table-id: The ID of the route table.

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

The route table is deleted.

Related Pages

Corresponding API Methods

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