The Wayback Machine - https://web.archive.org/web/20260119142929/https://www.geeksforgeeks.org/devops/amazon-vpc-networking-components/

Amazon VPC Networking Components

Last Updated : 17 Dec, 2025

Amazon Virtual Private Cloud (VPC) allows you to provision a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you define. It gives you complete control over your virtual networking environment, including IP address ranges, subnets, and route tables.

Core Components: Inside the VPC

These are the building blocks you use to construct your private network.

1. Subnets (Public vs. Private)

A subnet is a range of IP addresses in your VPC. You launch resources (like EC2 instances) inside a subnet.

  • Public Subnet: Has a direct route to an Internet Gateway. Resources here have public IP addresses and can talk to the internet directly. Used for: Load Balancers, Bastion Hosts, NAT Gateways.
  • Private Subnet: Has NO route to an Internet Gateway. Resources here have only private IPs. They cannot accept traffic from the internet. Used for: Application Servers, Databases.

2. Route Tables

A set of rules, called routes, that determine where network traffic from your subnet or gateway is directed.

  • Every subnet must be associated with a route table.
  • Local Route: Every route table automatically gets a "local" route (e.g., 10.0.0.0/16 -> Local), which allows all resources inside the VPC to talk to each other.

3. Internet Gateway (IGW)

A horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet.

  • It performs Network Address Translation (NAT) for instances with public IPv4 addresses.
  • You attach one IGW to a VPC.

4. NAT Gateway (Network Address Translation)

A managed service that allows instances in a private subnet to connect to the internet (e.g., for software updates) but prevents the internet from initiating a connection to those instances.

  • Placement: You must create the NAT Gateway in a Public Subnet.
  • Routing: You update the Private Subnet's route table to send internet traffic (0.0.0.0/0) to the NAT Gateway.

5. Security Groups & Network ACLs (Firewalls)

  • Security Groups: Acts as a virtual firewall for your instance to control inbound and outbound traffic. It is stateful (if you allow a request in, the response is automatically allowed out).
  • Network ACLs (NACLs): An optional layer of security for your subnet. It acts as a firewall for controlling traffic in and out of one or more subnets. It is stateless (you must explicitly allow traffic in both directions).

Connectivity Components

These components connect your VPC to other networks (other VPCs, on-premises data centers, or AWS services).

1. VPC Peering

A networking connection between two VPCs that enables you to route traffic between them using private IPv4 or IPv6 addresses.

  • Use Case: Connecting your "Dev" VPC to your "Shared Services" VPC.
  • Limitation: It is non-transitive. If VPC A peers with B, and B peers with C, A cannot talk to C.

2. AWS Transit Gateway

A cloud router that connects VPCs and on-premises networks through a central hub.

  • Use Case: Connecting hundreds of VPCs together or connecting multiple VPCs to a single on-premise VPN.
  • Advantage: Simplifies management compared to complex meshes of VPC peering.

Enables you to privately connect your VPC to supported AWS services (like S3, DynamoDB, Kinesis, etc.) without requiring an Internet Gateway or NAT device.

  • Interface Endpoints: Elastic Network Interfaces (ENIs) with a private IP that serve as an entry point for traffic destined to a supported service.
  • Gateway Endpoints: A gateway that is a target for a specific route in your route table (supported for S3 and DynamoDB).

4. AWS Site-to-Site VPN

Enables you to create a secure connection between your data center or branch office and your AWS cloud resources.

  • Virtual Private Gateway (VGW): The VPN concentrator on the Amazon side of the connection.
  • Customer Gateway: A physical device or software application on your side of the connection.

5. AWS Direct Connect

A dedicated network connection from your premises to AWS. It bypasses the public internet entirely.

  • Use Case: High-throughput workloads (10Gbps+), consistent network performance, or regulatory requirements for private connectivity.

Benefits Of Using AWS Virtual Private Cloud:

Following are the benefits of using AWS VPC:

  • Efficient coordination: VPC can scale to a vast extent and users have total control over a network size including automation resources.
  • Protection: VPC environment is more secure and its resources contain cloud infrastructure which uses firewalls to protect the system from internet attacks.
  • Enhanced performance: VPCs enable a hybrid cloud environment in which a VPC is used by an organization as an extension of their database instead of having to deal with the complexity of building an on-premises private cloud. 
  • Low Cost: VPCs are within a public cloud so the cost is quite economical.
  • East to use:  AWS VPC can be easily created using AWS Management Console in two ways; first by creating manually and second through Start VPC Wizard. 
  • Variety of Connectivity Options: AWS VPC can be connected to a variety of resources, such as the internet, other VPCs account, VPN connection, etc.

VPC Peering

When you allow to connect one VPC with another VPC through some of direct network route and using some private IP addresses, then this connection is called VPC Peering. and Instances will behave as if they are on the same private network. Users can peer between the regions. From VPC Peering, users can easily peer the VPC's with another AWS accounts and also users can peer the VPCs in the same account.

Pricing for Amazon VPC

As there is no additional charge for using a VPC. but there are charges for using some of VPC components like NAT gateways, IP Address Manager, traffic mirroring and many more. If user wants to create a NAT gateway in their VPC and choose this service, then the users are charged for every “NAT Gateway-hour" used.

Summary Table: When to Use What?

ComponentPurposeTraffic Flow
Internet GatewayPublic internet access.VPC <-> Internet
NAT GatewayOutbound internet access for private servers.Private Subnet -> NAT -> Internet
VPC PeeringConnect two VPCs directly.VPC A <-> VPC B
Transit GatewayConnect many VPCs/VPNs centrally.VPCs <-> Hub <-> VPNs
VPNSecure encrypted tunnel over internet.VPC <-> On-Premises
Direct ConnectDedicated physical fiber connection.VPC <-> On-Premises (No Internet)
Comment