Detaching a Virtual Private Gateway

You can detach a virtual private gateway from a Virtual Private Cloud (VPC).

This action updates the attachment state of the virtual private gateway from attached to detached, while the virtual private gateway remains in the available state. For more information, see About Virtual Private Gateways > Lifecycle.

Detaching a Virtual Private Gateway Using Cockpit v1

  1. Click Virtual Private Gateways.

  2. Select the virtual private gateway you want to detach.
    The virtual private gateway is selected.

  3. Click Detach .
    A confirmation dialog box appears.

  4. Click Detach to validate.
    The specified virtual private gateway is detached from the VPC.

Unlinking a Virtual Gateway Using OSC CLI

See the UnlinkVirtualGateway command sample in the documentation of the OUTSCALE API.

Detaching a Virtual Private Gateway Using AWS CLI

To detach a virtual private gateway from a VPC, use the detach-vpn-gateway command following this syntax:

Request sample
$ aws ec2 detach-vpn-gateway \
    --profile YOUR_PROFILE \
    --vpn-gateway-id vgw-00ac2c82 \
    --vpc-id vpc-eb1e7306 \
    --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.

  • vpn-gateway-id: The ID of the virtual private gateway you want to detach.

  • vpc-id: The ID of the VPC you want to detach the virtual private gateway from.

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

The specified virtual private gateway is detached from the VPC.

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.