Skip to main content

internet_gateways

Creates, updates, deletes, gets or lists an internet_gateways resource.

Overview

Nameinternet_gateways
TypeResource
Idaws.ec2.internet_gateways

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
attachmentsstringAny VPCs attached to the internet gateway.
internet_gateway_idstringThe ID of the internet gateway.
owner_idstringThe ID of the Amazon Web Services account that owns the internet gateway.
tagsstringAny tags assigned to the internet gateway.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_internet_gatewaysselectregionNextToken, MaxResults, DryRun, InternetGatewayId, FilterDescribes your internet gateways. The default is to describe all your internet gateways. Alternatively, you can specify specific internet gateway IDs or filter the results to include only the internet gateways that match specific criteria.
create_internet_gatewayinsertregionTagSpecification, DryRunCreates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using AttachInternetGateway. For more information, see Internet gateways in the Amazon VPC User Guide.
attach_internet_gatewayupdateInternetGatewayId, VpcId, regionDryRunAttaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC. For more information, see Internet gateways in the Amazon VPC User Guide.
delete_internet_gatewaydeleteInternetGatewayId, regionDryRunDeletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it.
detach_internet_gatewayexecInternetGatewayId, VpcId, regionDryRunDetaches 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 or public IPv4 addresses.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
InternetGatewayIdstringThe ID of the internet gateway.
VpcIdstringThe ID of the VPC.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayThe filters. attachment.state - The current state of the attachment between the gateway and the VPC (available). Present only if a VPC is attached. attachment.vpc-id - The ID of an attached VPC. internet-gateway-id - The ID of the Internet gateway. owner-id - The ID of the Amazon Web Services account that owns the internet gateway. tag - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.
InternetGatewayIdarrayThe IDs of the internet gateways. Default: Describes all your internet gateways.
MaxResultsintegerThe maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
TagSpecificationarrayThe tags to assign to the internet gateway.

SELECT examples

Describes your internet gateways. The default is to describe all your internet gateways. Alternatively, you can specify specific internet gateway IDs or filter the results to include only the internet gateways that match specific criteria.

SELECT
attachments,
internet_gateway_id,
owner_id,
tags
FROM aws.ec2.internet_gateways
WHERE region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND DryRun = '{{ DryRun }}'
AND InternetGatewayId = '{{ InternetGatewayId }}'
AND Filter = '{{ Filter }}'
;

INSERT examples

Creates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using AttachInternetGateway. For more information, see Internet gateways in the Amazon VPC User Guide.

INSERT INTO aws.ec2.internet_gateways (
region,
TagSpecification,
DryRun
)
SELECT
'{{ region }}',
'{{ TagSpecification }}',
'{{ DryRun }}'
RETURNING
attachments,
internet_gateway_id,
owner_id,
tags
;

UPDATE examples

Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC. For more information, see Internet gateways in the Amazon VPC User Guide.

UPDATE aws.ec2.internet_gateways
SET
-- No updatable properties
WHERE
InternetGatewayId = '{{ InternetGatewayId }}' --required
AND VpcId = '{{ VpcId }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}};

DELETE examples

Deletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it.

DELETE FROM aws.ec2.internet_gateways
WHERE InternetGatewayId = '{{ InternetGatewayId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;

Lifecycle Methods

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 or public IPv4 addresses.

EXEC aws.ec2.internet_gateways.detach_internet_gateway
@InternetGatewayId='{{ InternetGatewayId }}' --required,
@VpcId='{{ VpcId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;