CloudWiki
Resource

Internet Gateway

Amazon Web Services
Network
An internet gateway (IGW) allows resources associated with public IP (IPv4 or IPv6 address) within your VPC to access the internet. Likewise, resources on the internet can initiate a connection to resources in your subnet using the public IPv4 address or IPv6 address.
Terraform Name
terraform
aws_internet_gateway
Internet Gateway
attributes:
  • vpc_id - (Optional) The VPC ID to create in. See the aws_internet_gateway_attachment resource for an alternate way to attach an Internet Gateway to a VPC.
  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Associating resources with a
Internet Gateway
Resources do not "belong" to a
Internet Gateway
Rather, one or more Security Groups are associated to a resource.
Create
Internet Gateway
via Terraform:
The following HCL creates an internet gateway with the tag Name my-igw
Syntax:

resource "aws_internet_gateway" "gw" {
 vpc_id = aws_vpc.main.id

 tags = {
   Name = "my-igw"
 }
}

Create
Internet Gateway
via CLI:
Parametres:

create-internet-gateway
[--tag-specifications <value>]
[--dry-run | --no-dry-run]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]

Example:

aws ec2 create-internet-gateway \
   --tag-specifications ResourceType=internet-gateway,Tags=[{Key=Name,Value=my-igw}]

aws cost
Costs
The cost of using an Internet Gateway is determined by the amount of data processed through it, with no additional charges for creation or deletion of the Internet Gateway. The cost starts at $0.05 per GB of data processed and decreases as data processed increases.
Direct Cost

--

Indirect Cost
No items found.
Best Practices for
Internet Gateway

Categorized by Availability, Security & Compliance and Cost

Low
Access allowed from VPN
No items found.
Low
Auto Scaling Group not in use
No items found.
Medium
Connections towards DynamoDB should be via VPC endpoints
No items found.
Medium
Container in CrashLoopBackOff state
No items found.
Low
EC2 with GPU capabilities
No items found.
Medium
EC2 with high privileged policies
No items found.
Medium
ECS cluster delete alarm
No items found.
Critical
ECS task with Admin access (*:*)
Medium
ECS task with high privileged policies
No items found.
Critical
EKS cluster delete alarm
No items found.
Medium
ElastiCache cluster delete alarm
No items found.
Medium
Ensure Container liveness probe is configured
No items found.
Medium
Ensure ECS task definition has memory limit
No items found.
Critical
Ensure EMR cluster master nodes are not publicly accessible
No items found.
More from
Amazon Web Services