internet_gateways
Creates, updates, deletes, gets or lists an internet_gateways resource.
Overview
| Name | internet_gateways |
| Type | Resource |
| Id | aws.ec2.internet_gateways |
Fields
The following fields are returned by SELECT queries:
- describe_internet_gateways
| Name | Datatype | Description |
|---|---|---|
attachments | string | Any VPCs attached to the internet gateway. |
internet_gateway_id | string | The ID of the internet gateway. |
owner_id | string | The ID of the Amazon Web Services account that owns the internet gateway. |
tags | string | Any tags assigned to the internet gateway. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_internet_gateways | select | region | NextToken, MaxResults, DryRun, InternetGatewayId, Filter | 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. |
create_internet_gateway | insert | region | TagSpecification, DryRun | 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. |
attach_internet_gateway | update | InternetGatewayId, VpcId, region | DryRun | 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. |
delete_internet_gateway | delete | InternetGatewayId, region | DryRun | Deletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it. |
detach_internet_gateway | exec | InternetGatewayId, VpcId, region | DryRun | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
InternetGatewayId | string | The ID of the internet gateway. |
VpcId | string | The ID of the VPC. |
region | string | AWS region (default: us-east-1) |
DryRun | boolean | Checks 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. |
Filter | array | The 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. |
InternetGatewayId | array | The IDs of the internet gateways. Default: Describes all your internet gateways. |
MaxResults | integer | The 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. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
TagSpecification | array | The tags to assign to the internet gateway. |
SELECT examples
- describe_internet_gateways
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
- create_internet_gateway
- Manifest
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
;
# Description fields are for documentation purposes
- name: internet_gateways
props:
- name: region
value: "{{ region }}"
description: Required parameter for the internet_gateways resource.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to assign to the internet gateway.
description: The tags to assign to the internet gateway.
- name: DryRun
value: {{ DryRun }}
description: Checks 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.
description: Checks 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.
UPDATE examples
- attach_internet_gateway
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
- delete_internet_gateway
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
- detach_internet_gateway
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 }}
;