DetachInternetGateway#

Description#

Detaches the internet gateway from a VPC, thus making the VPC inaccessible from the Internet. Before detaching the internet gateway, make sure that there are no running instances with Elastic IP addresses or public IP addresses in the VPC. If such instances exist, first disassociate the Elastic IP addresses or stop the instances.

Request Parameters#

  • InternetGatewayId — The ID of the internet gateway.

    • Type: String

    • Required: Yes

  • VpcId — The ID of the VPC.

    • Type: String

    • Required: Yes

Response Elements#

  • requestId — The request ID.

    • Type: String

  • returnTrue is returned if the request succeeds and an error otherwise.

    • Type: Boolean

Examples#

c2-ec2 DetachInternetGateway InternetGatewayId igw-01234567 VpcId vpc-01234567