Work with egress-only internet gateways - Amazon Virtual Private Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Work with egress-only internet gateways

The following tasks describe how to create an egress-only (outbound) internet gateway for your private subnet, and to configure routing for the subnet.

Create an egress-only internet gateway

You can create an egress-only internet gateway for your VPC using the Amazon VPC console.

To create an egress-only internet gateway
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Egress Only Internet Gateways.

  3. Choose Create Egress Only Internet Gateway.

  4. (Optional) Add or remove a tag.

    [Add a tag] Choose Add new tag and do the following:

    • For Key, enter the key name.

    • For Value, enter the key value.

    [Remove a tag] Choose Remove to the right of the tag’s Key and Value.

  5. Select the VPC in which to create the egress-only internet gateway.

  6. Choose Create.

View your egress-only internet gateway

You can view information about your egress-only internet gateway in the Amazon VPC console.

To view information about an egress-only internet gateway
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Egress Only Internet Gateways.

  3. Select the egress-only internet gateway to view its information in the details pane.

Create a custom route table

To send traffic destined outside the VPC to the egress-only internet gateway, you must create a custom route table, add a route that sends traffic to the gateway, and then associate it with your subnet.

To create a custom route table and add a route to the egress-only internet gateway
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Route Tables, Create route table.

  3. In the Create route table dialog box, optionally name your route table, then select your VPC and choose Create route table.

  4. Select the custom route table that you just created. The details pane displays tabs for working with its routes, associations, and route propagation.

  5. On the Routes tab, choose Edit routes, specify ::/0 in the Destination box, select the egress-only internet gateway ID in the Target list, and then choose Save changes.

  6. On the Subnet associations tab, choose Edit subnet associations, and select the check box for the subnet. Choose Save.

Alternatively, you can add a route to an existing route table that's associated with your subnet. Select your existing route table, and follow steps 5 and 6 above to add a route for the egress-only internet gateway.

For more information about route tables, see Configure route tables.

Delete an egress-only internet gateway

If you no longer need an egress-only internet gateway, you can delete it. Any route in a route table that points to the deleted egress-only internet gateway remains in a blackhole status until you manually delete or update the route.

To delete an egress-only internet gateway
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Egress Only Internet Gateways, and select the egress-only internet gateway.

  3. Choose Delete.

  4. Choose Delete Egress Only Internet Gateway in the confirmation dialog box.

API and CLI overview

You can perform the tasks described on this page using the command line or an API. For more information about the command line interfaces and a list of available API actions, see Working with Amazon VPC.

Create an egress-only internet gateway
Describe an egress-only internet gateway
Delete an egress-only internet gateway