AWS Internet Gateway
An AWS Internet Gateway is a component that facilitates communication between instances within an Amazon Virtual Private Cloud (VPC) and the Internet. It acts as a gateway for internet-bound traffic, allowing resources within a VPC, like EC2 instances, to access the Internet and receive responses from Internet resources.
The following diagram from the Terraform, AWS, and Ansible together tutorial shows an Internet Gateway providing Internet connectivity to a VPC.
Internet Gateways are attached to a VPC and provide a target for traffic destined for public IP addresses or the internet. They enable bidirectional communication—allowing resources within the VPC to initiate outbound connections to the internet and also receive incoming responses from the internet.
For the Internet Gateway to route traffic, it has to be used as a routing destination in the route table of a subnet, or in the main route table of the whole VPC. Instances also need a public IP address (automatic, or an Elastic IP) to be reachable from the Internet. Instances in private subnets use a NAT Gateway instead.
An Internet Gateway is horizontally scaled, redundant and highly available, and has no cost: only the data transfer is charged. It is created with the Terraform resource aws_internet_gateway.
See tutorials using an Internet Gateway:
More tutorials that use Internet Gateway
- AWS with Terraform Tutorial: AWS Routing Tables (8)
- AWS with Terraform Tutorial: AWS NAT Gateway (7)
- AWS Basic VPC Elements
- Terraform AWS EKS Cluster Deployment & Application Publishing through ALB
- AWS with Terraform Tutorial: AWS EC2 Instances (12)
- AWS VPC Subnets, Routing Tables and Internet Access using Terraform (2/5)
- Terraform and OpenTofu on Oracle Cloud (OCI): Getting Started with the OCI Provider
- AWS with Terraform Tutorial: AWS Subnets (5)