| Did this page help you? Yes No Tell us about it... |
Detaches an Internet gateway from a VPC, disabling connectivity between the Internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses. For more information about your VPC and Internet gateway, go to the Amazon Virtual Private Cloud User Guide.
The short version of this command is ec2detigw.
ec2-detach-internet-gateway
vpn_gateway_id -c vpc_id
| Name | Description | Required |
|---|---|---|
|
|
The ID of the Internet gateway to detach. Type: String Default: None Example: igw-8db04f81 |
Yes |
|
|
The ID of the VPC. Type: String Default: None Example: -c vpc-1a2b3c4d |
Yes |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
The command returns a table that contains the following information:
Boolean true or false
Amazon EC2 command line tools display errors on stderr.
This example detaches the Internet gateway with ID igw-eaad4883 from the VPC with ID vpc-11ad4878.
PROMPT>ec2-detach-internet-gateway igw-eaad4883 -c vpc-11ad4878RETURN true