AWS Builder Center
🌐 Amazon VPC Explained: Build Your First Secure Network in AWS ā˜ļøšŸ”

🌐 Amazon VPC Explained: Build Your First Secure Network in AWS ā˜ļøšŸ”

Amazon VPC

šŸš€ Introduction

When we think about Cloud Computing, we often imagine virtual servers, databases, and applications running in the cloud.
But have you ever wondered how these resources communicate securely with each other?
That's where Amazon Virtual Private Cloud (Amazon VPC) comes in!
Amazon VPC is one of the fundamental networking services in AWS. It allows you to create your own logically isolated virtual network where you can deploy resources, control network traffic, and design secure cloud architectures.
In this article, we'll explore Amazon VPC, understand its main components, and build a simple network architecture step by step.
Let's get started! šŸš€

ā˜ļø 1. What Is Amazon VPC?

Amazon Virtual Private Cloud (Amazon VPC) is an AWS service that allows you to create a logically isolated network within the AWS Cloud.
Think of it as your own virtual data center, where you control how resources communicate.
With Amazon VPC, you can:
  • Define your own IP address ranges.
  • Create public and private subnets.
  • Configure network routing.
  • Control inbound and outbound traffic.
  • Connect cloud resources securely.
  • Design scalable and highly available architectures.
Why is it important?
Because networking is the foundation of almost every cloud application!

🧩 2. Understanding the Main VPC Components

Before creating our architecture, let's understand six essential components.
🌐 VPC: Your virtual network in AWS. You define its IP address range using CIDR notation, such as 10.0.0.0/16.
🟢 Public Subnet: A subnet with a route to an Internet Gateway. Resources can communicate with the internet when they also have the necessary public addressing and security configuration.
šŸ”’ Private Subnet: A subnet without a direct route to an Internet Gateway. It is commonly used for application servers and databases that should not be directly exposed to the internet.
🚪 Internet Gateway: Connects a VPC to the internet when properly configured with route tables and public IP addressing.
šŸ›£ļø Route Tables: Determine where network traffic is directed. Each subnet uses a route table to control its network paths.
šŸ›”ļø Security Groups: Act as stateful virtual firewalls, controlling allowed inbound and outbound traffic for resources such as EC2 instances.
Another useful component is a NAT Gateway, which can provide outbound internet connectivity to private resources without allowing unsolicited inbound internet connections.

šŸ—ļø 3. Our VPC Architecture

Let's imagine we're building a small web application.
We want a web server accessible from the internet while keeping our database isolated in a private subnet.
Our architecture will use:
ComponentConfiguration
VPC10.0.0.0/16
Public Subnet10.0.1.0/24
Private Subnet10.0.2.0/24
Internet GatewayAttached to the VPC
Public EC2 InstanceWeb server
Private DatabaseRDS example
Route TablesPublic and private routing
Security GroupsRestricted access
The diagram below illustrates how these components connect.
Architecture Diagram: Amazon VPC with Public and Private Subnets
Insert the architecture image here.
The main idea is simple: public-facing resources can handle incoming requests, while sensitive resources remain in private network segments.

šŸ› ļø 4. Hands-On Lab: Create Your First VPC

Now let's create the networking foundation using the AWS Management Console.

Step 1: Create a VPC

  1. Open the AWS Management Console.
  2. Search for VPC.
  3. Select Create VPC.
  4. Choose VPC only.
  5. Enter the following values:
  • Name: My-First-VPC
  • IPv4 CIDR: 10.0.0.0/16
  • IPv6 CIDR: No IPv6 CIDR block
  • Tenancy: Default
  1. Click Create VPC.
Congratulations! šŸŽ‰ You now have your own virtual network.

Step 2: Create Two Subnets

Navigate to VPC → Subnets → Create subnet.
Create the following:
Public Subnet
  • Name: Public-Subnet
  • VPC: My-First-VPC
  • IPv4 CIDR: 10.0.1.0/24
Private Subnet
  • Name: Private-Subnet
  • VPC: My-First-VPC
  • IPv4 CIDR: 10.0.2.0/24
For this beginner lab, you can place both subnets in the same Availability Zone. In production, use multiple Availability Zones for higher availability.

Step 3: Create an Internet Gateway

Navigate to Internet Gateways.
  1. Click Create internet gateway.
  2. Name it My-Internet-Gateway.
  3. Create the gateway.
  4. Select Actions → Attach to VPC.
  5. Choose My-First-VPC.
The gateway is now attached, but we still need to configure routing.

Step 4: Configure Route Tables

Create a route table named Public-Route-Table.
Associate it with Public-Subnet and add the following route:
DestinationTarget
10.0.0.0/16local
0.0.0.0/0Internet Gateway
For the private subnet, create Private-Route-Table with only the local route:
DestinationTarget
10.0.0.0/16local
Associate it with Private-Subnet.
This means our public subnet has a path to the internet, while our private subnet remains isolated from direct internet connectivity.

Step 5: Configure Security Groups

Create a security group for a demonstration web server.
For inbound traffic:
TypePortSource
HTTP800.0.0.0/0
HTTPS4430.0.0.0/0
Only enable the ports actually needed. Use HTTPS for real applications and avoid exposing administrative ports to the entire internet.
For a database security group, allow only the required database port from the application server's security group.

šŸ’» 5. Create Your VPC Using AWS CLI

You can also create the same basic network using the AWS Command Line Interface.
First, make sure the AWS CLI is installed and configured with appropriate credentials and permissions.
Create the VPC:
1
2
aws ec2 create-vpc \
--cidr-block 10.0.0.0/16
Save the returned VPC ID.
Create the public subnet:
1
2
3
aws ec2 create-subnet \
--vpc-id vpc-xxxxxxxx \
--cidr-block 10.0.1.0/24
Create the private subnet:
1
2
3
aws ec2 create-subnet \
--vpc-id vpc-xxxxxxxx \
--cidr-block 10.0.2.0/24
Create an Internet Gateway:
1
aws ec2 create-internet-gateway
Attach the Internet Gateway:
1
2
3
aws ec2 attach-internet-gateway \
--vpc-id vpc-xxxxxxxx \
--internet-gateway-id igw-xxxxxxxx
Replace the placeholder IDs with the actual resource IDs returned by AWS.
These commands create the initial networking resources. To complete the public subnet configuration, you must also create and associate a public route table, add its default route to the Internet Gateway, and configure public IP addressing for resources requiring internet access.

šŸ” 6. AWS VPC Security Best Practices

Security should always be part of cloud architecture design.
Here are some important recommendations:
āœ… Use private subnets for databases and internal services.
āœ… Apply the principle of least privilege to security groups.
āœ… Avoid exposing SSH and RDP access to the entire internet.
āœ… Use VPC Flow Logs to help analyze network traffic.
āœ… Consider VPC endpoints for private connectivity to supported AWS services.
āœ… Design applications across multiple Availability Zones when high availability is required.
āœ… Regularly review route tables and security group rules.
Remember: A private subnet is an important security boundary, but it does not replace application-level security, authentication, or encryption.

šŸ“ˆ 7. Real-World Use Cases

Amazon VPC is widely used in cloud architectures, including:
  • Web applications: Public load balancers with private application servers.
  • Database environments: Amazon RDS databases deployed in private subnets.
  • Enterprise networks: Hybrid connectivity between on-premises environments and AWS.
  • Microservices: Internal communication between distributed cloud services.
  • Development environments: Isolated networks for testing applications.

šŸ’” 8. What I Learned

Exploring Amazon VPC helped me better understand how cloud networking works.
Some of my key takeaways are:
  • A VPC provides the network foundation for AWS resources.
  • Public and private subnets serve different purposes.
  • Route tables determine the paths network traffic can take.
  • Security groups are essential for controlling resource access.
  • Good network design improves security, scalability, and maintainability.
Learning these concepts is an important step toward building real-world AWS architectures.

šŸŽÆ Conclusion

Amazon VPC is much more than a networking service. It is a fundamental building block for designing secure, reliable, and scalable cloud applications.
Understanding how VPCs, subnets, Internet Gateways, route tables, and security groups work together gives us a strong foundation for more advanced AWS architectures.
This is another step in my Cloud Computing learning journey, and I'm excited to keep exploring AWS technologies! ā˜ļøšŸ’œ
šŸ’¬ Have you already created your first Amazon VPC? What was the most interesting part of learning AWS networking?
Let's keep learning and building in the cloud! šŸš€

šŸ“š References

šŸ·ļø Hashtags

#AWS #AmazonVPC #CloudComputing #AWSNetworking #CloudSecurity #AWSCommunity #AWSBuilderCenter #LearnAWS #CloudArchitecture #WomenInCloud
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article