Adding or Removing a Route Table Associated with a VPC Endpoint

You can add or remove route tables associated with the Virtual Private Cloud (VPC) endpoint to specify which subnets can access the corresponding service through the VPC endpoint.

This action automatically adds or removes the appropriate VPC endpoint route in the specified route table, which enables or disables traffic routing from the associated subnets to the VPC endpoint.

Adding or Removing a Route Table Associated with a VPC Endpoint Using Cockpit

  1. Click VPC > VPC Endpoints.

  2. Click the VPC endpoint you want to modify the route tables for.
    The VPC endpoint is selected.

  3. Click Update .
    The UPDATE VPC ENDPOINT dialog box appears.

  4. If adding a route table to the VPC endpoint, select its ID from the Route Table section.

    Multiselection is available.

  5. If removing a route table from the VPC endpoint, clear its ID from the Route Table section.

    Multiselection is available.

  6. Click Update to validate.
    The list of the route tables associated with the VPC endpoint is updated.

Adding or Removing a Route Table Associated with a VPC Endpoint Using AWS CLI

To add or remove a route table associated with a VPC endpoint and the appropriate route, use the modify-vpc-endpoint command following this syntax:

Request sample
$ aws ec2 modify-vpc-endpoint \
    --profile YOUR_PROFILE \
    --vpc-endpoint-id vpce-12345678 \
    --add-route-table-ids rtb-1234abcd rtb-dcba4321 \
    --remove-route-table-ids rtb 5678efgh \
    --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.

  • vpc-endpoints-id: The ID of the VPC endpoint.

  • (optional) add-route-table-ids: One or more IDs of route tables you want to associate with the VPC endpoint.

  • (optional) remove-route-table-ids: One or more IDs of route tables you want to disassociate from the VPC endpoint.

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

The modify-vpc-endpoint command returns a boolean result: if true, the request succeeded and the route is created. Otherwise, it returns an error.

In the above example, the route tables rtb-1234abcd and rtb-4321dcba are associated with the specified VPC endpoint and a route to the VPC endpoint is added to them. The route table rtb-5678efgh is removed from the route tables associated with the VPC endpoint and its VPC endpoint route is deleted.

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.