AWS Solutions Architect Associate Certification
Services Networking
Internet Gateways VPC
In this guide, you'll learn how Internet Gateways enable public connectivity for subnets within a Virtual Private Cloud (VPC). Understanding this concept is crucial for configuring your AWS environment for both private and public communication.
By default, subnets in a VPC are created as private. Devices within these subnets cannot access the Internet, and external resources cannot reach them. To convert a subnet into a public subnet, you must attach an Internet Gateway to your VPC.
Important Reminders
- Each VPC can have only one Internet Gateway attached.
- An Internet Gateway can only be attached to one VPC at a time.
An Internet Gateway is a horizontally scaled, redundant, and highly available component that spans all Availability Zones within a region. It provides the essential communication bridge between resources inside your VPC and the Internet. Without an Internet Gateway, all subnets in your VPC remain private by default.
Converting a Private Subnet to a Public Subnet
To transform a private subnet into a public one, follow these essential steps:
- Create an Internet Gateway.
- Attach the Internet Gateway to your VPC.
- Create a custom route table.
- Configure a default route in the route table that points to the Internet Gateway.
This default route ensures that any traffic without a more specific route is forwarded to the Internet Gateway. - Associate the desired subnet with the custom route table.
This association enables all resources within that subnet to access the Internet.
Public and Private IP Addressing
When you deploy resources in a public subnet, they automatically receive a private IP address. To allow Internet-facing communication, you must enable the assignment of public IP addresses.
For example:
- A resource might have a private IP like 192.168.1.1.
- Additionally, it will receive a public IP, such as 1.1.1.1, which external clients can use to reach the resource.
It's important to note that the resource itself only recognizes its private IP. AWS manages the translation between the public and private IP addresses. When an external request is directed to the public IP, AWS forwards it to the corresponding private IP.
Each network interface on a resource can have its own pair of public and private IP addresses. AWS seamlessly manages the mapping between these IP addresses to ensure smooth communication.
Summary
To recap the key points about Internet Gateways and VPC connectivity:
- Internet Gateways provide necessary public connectivity for VPC resources.
- They offer regional resilience by spanning all Availability Zones.
- Each VPC is limited to one Internet Gateway, and an Internet Gateway can be attached to only a single VPC.
- A subnet is converted to a public subnet when its route table includes a default route pointing to the Internet Gateway.
Watch Video
Watch video content