If you no longer require a virtual private gateway for your VPC, you can detach it from the VPC.
To detach a virtual private gateway using the console
In the navigation pane, choose Virtual private gateways.
Select the virtual private gateway and choose Actions, Detach from VPC.
Choose Detach virtual private gateway.
If you no longer require a detached virtual private gateway, you can delete it. You
can't delete a virtual private gateway that's still attached to a VPC. After you delete
your virtual private gateway, it remains visible for a short while with a state of
deleted
, and then the entry is automatically removed.
To delete a virtual private gateway using the console
In the navigation pane, choose Virtual private gateways.
Select the virtual private gateway and choose Actions, Delete virtual private gateway.
When prompted for confirmation, enter
delete
and then choose Delete.
To detach a virtual private gateway using the command line or API
-
DetachVpnGateway (Amazon EC2 Query API)
-
detach-vpn-gateway
(AWS CLI) -
Dismount-EC2VpnGateway (AWS Tools for Windows PowerShell)
To delete a virtual private gateway using the command line or API
-
DeleteVpnGateway (Amazon EC2 Query API)
-
delete-vpn-gateway
(AWS CLI) -
Remove-EC2VpnGateway (AWS Tools for Windows PowerShell)