Detaching an Internet Gateway from a VPC
You can detach an Internet gateway from a Virtual Private Cloud (VPC) to remove its connection to the Internet.
This action also removes routes using the Internet gateway as target.
Detaching an Internet Gateway Using Cockpit v1
Before you begin: Disassociate all External IPs that are associated with instances running in the VPC. For more information, see Disassociating an EIP from an Instance or a Network Interface. |
-
Click VPC > Internet Gateways.
-
Click the Internet gateway you want to detach from a VPC.
The Internet gateway is selected. -
Click Detach .
A confirmation dialog box appears. -
Click Detach to validate.
The Internet gateway is detached from the selected VPC.
Unlinking an Internet Service Using Cockpit v2-beta
Before you begin: Unlink all public IPs that are linked with virtual machines (VMs) running in the Net. For more information, see Disassociating an EIP from an Instance or a Network Interface. |
-
Click inside the Internet Services dashboard to make checkboxes appear.
-
Check the box of the Internet service you want to unlink.
The Internet service is selected and an action menu appears. -
Click
Unlink Internet Service.
A confirmation dialog box appears. -
Click Unlink Internet Service.
The Internet service is unlinked from the Net.
Unlinking an Internet Service Using OSC CLI
Before you begin: Unlink all public IPs from your running virtual machines (VMs) in the Net. For more information, see Disassociating an EIP from an Instance or a Network Interface. |
See the UnlinkInternetService command sample in the documentation of the OUTSCALE API. |
Detaching an Internet Gateway Using AWS CLI
Before you begin: Disassociate all External IPs from your running instances in the VPC. For more information, see Disassociating an EIP from an Instance or a Network Interface. |
To detach an Internet gateway from a VPC, use the detach-internet-gateway command following this syntax:
$ aws ec2 detach-internet-gateway \
--profile YOUR_PROFILE \
--internet-gateway-id igw-12345678 \
--vpc-id vpc-12345678 \
--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. -
internet-gateway-id
: The ID of the Internet gateway. -
vpc-id
: The ID of the VPC. -
endpoint
: The endpoint corresponding to the Region you want to send the request to.
The Internet gateway is detached from the specified 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.