Unlinking a Virtual Gateway

You can unlink a virtual gateway from a Net.

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

Unlinking a Virtual Gateway Using Cockpit v2

  1. Click inside the Virtual Gateways dashboard to make checkboxes appear.

  2. Check the box of the virtual gateway you want to unlink from a Net.
    The virtual gateway is selected and an action menu appears.

  3. Click IconUnlink Unlink from Net.
    The UNLINK FROM NET dialog box appears.

  4. Click Unlink.
    The virtual gateway is unlinked from the Net.

Unlinking a Virtual Gateway Using OSC CLI

The UnlinkVirtualGateway command detaches a virtual gateway from a Net.
You must wait until the virtual gateway is in the detached state before you can attach another Net to it or delete the Net it was previously attached to.

Request sample
$ osc-cli api UnlinkVirtualGateway --profile "default" \
    --VirtualGatewayId "vgw-12345678" \
    --NetId "vpc-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.

  • NetId: The ID of the Net from which you want to detach the virtual gateway.

  • VirtualGatewayId: The ID of the virtual gateway.

The UnlinkVirtualGateway command returns the following elements:

  • ResponseContext: Information about the context of the response.

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

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.