Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

DetachInternetGateway

Description

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.

Request Parameters

InternetGatewayId

The ID of the Internet gateway.

Type: String

Default: None

Required: Yes

VpcId

The ID of the VPC.

Type: String

Default: None

Required: Yes

Response Elements

The following elements are returned in a DetachInternetGatewayResponse element.

requestId

The ID of the request.

Type: xsd:string

return

Returns true if the request succeeds. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

The example detaches the Internet gateway with ID igw-eaad4883 from the VPC with ID vpc-11ad4878.

https://ec2.amazonaws.com/?Action=DetachInternetGateway
&InternetGatewayId=igw-eaad4883
&VpcId=vpc-11ad4878
&AUTHPARAMS

Example Response

 <DetachInternetGatewayResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <return>true</return>
</DetachInternetGatewayResponse>