# 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

- Source: https://www.itwonderlab.com/aws-internet-gateway/
- Published: 2023-11-22
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

An AWS Internet Gateway is a component that facilitates communication between instances within an Amazon Virtual Private Cloud ([VPC](https://www.itwonderlab.com/aws-vpc/)) and the Internet. It acts as a gateway for internet-bound traffic, allowing resources within a VPC, like [EC2](https://www.itwonderlab.com/aws-ec2/) instances, to access the Internet and receive responses from Internet resources.

The following diagram from the [Terraform, AWS, and Ansible together](https://www.itwonderlab.com/terraform-aws-ansible/) tutorial shows an Internet Gateway providing Internet connectivity to a VPC.

![Terraform AWS Ansible VPC Subnet Routing](https://www.itwonderlab.com/media/tutorials/Terraform-AWS-Ansible/ITWL-Tutorials-Terraform-AWS-Ansible-VPC-Subnet-Routing.svg)

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](https://www.itwonderlab.com/aws-route-tables/) of a [subnet](https://www.itwonderlab.com/aws-subnets/), or in the main route table of the whole VPC. Instances also need a public IP address (automatic, or an [Elastic IP](https://www.itwonderlab.com/aws-elastic-ip/)) to be reachable from the Internet. Instances in private subnets use a [NAT Gateway](https://www.itwonderlab.com/aws-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:

-   [AWS with Terraform: The Essential Guide (6/21) – AWS Internet Gateway](https://www.itwonderlab.com/aws-terraform-tutorial-aws-internet-gateway/)
-   [Terraform, AWS, and Ansible together](https://www.itwonderlab.com/terraform-aws-ansible/)
-   [How to Deploy Containers in AWS ECS with Terraform and Fargate](https://www.itwonderlab.com/containers-aws-ecs-terraform-fargate/)
