Skip to main content

Command Palette

Search for a command to run...

VPC101

Updated
6 min readView as Markdown
VPC101
K
I am a security cloud engineer from Kenya, passionate about building secure systems that can shape and change lives for the better

When people first start learning cloud computing, one of the most important concepts they encounter is the Virtual Private Cloud (VPC). While the term might sound complex, the idea behind it is actually quite simple.

Think of a VPC as your own private section of a cloud provider's network. Even though you're sharing the cloud provider's physical infrastructure with thousands of other customers, your VPC is isolated and under your control. It's like renting an apartment in a large building—you have your own private space, your own locks, and control over who can enter.

What Exactly is a VPC?

A Virtual Private Cloud is a logically isolated network where you deploy your cloud resources such as servers, databases, and applications.

Inside a VPC, you decide:

  • What IP address range to use

  • How the network is divided into subnets

  • How traffic moves through the network

  • Which resources can access the internet

  • Which resources can communicate with each other

This flexibility allows organizations to build cloud environments that closely resemble traditional corporate networks while taking advantage of the scalability of the cloud.

Why Isolation Matters

One of the biggest benefits of a VPC is isolation.

Resources that live inside the same VPC can communicate with each other privately using internal network addresses. This means data can move between servers and databases without ever touching the public internet.

On the other hand, resources in different VPCs cannot communicate by default. If two VPCs need to exchange information, you must intentionally create a connection between them.

This "deny by default" approach is an important security feature because it reduces the chances of accidental exposure.

Breaking a VPC into Subnets

As applications grow, placing everything in one large network quickly becomes difficult to manage. That's where subnets come in.

A subnet is simply a smaller section of a VPC. Subnets help organize resources based on their purpose and security requirements.

For example, you might place:

  • Web-facing components in one subnet

  • Application servers in another subnet

  • Databases in a separate subnet

Cloud providers also require each subnet to exist within a single Availability Zone, helping organizations build highly available systems across multiple locations.

Public and Private Subnets

One of the most important decisions when designing a cloud network is determining what should be public and what should remain private.

Public Subnets

Public subnets are used for resources that need to receive traffic from the internet.

Examples include:

  • Load balancers

  • Bastion hosts

  • Public websites

These subnets are connected to the internet through an Internet Gateway, allowing users around the world to access the services running inside them.

Private Subnets

Private subnets are used for resources that should not be directly accessible from the internet.

Examples include:

  • Application servers

  • Internal services

  • Databases

Keeping these systems private dramatically improves security because attackers cannot connect to them directly from the internet.

How Private Resources Access the Internet

A common question is: if a server is in a private subnet, how does it download updates or access external services?

This is where a NAT Gateway comes in.

A NAT Gateway acts like a middleman. It allows private resources to initiate connections to the internet while preventing the internet from initiating connections back.

For example, an application server may need to:

  • Download software updates

  • Connect to third-party APIs

  • Pull container images

The NAT Gateway makes these outbound connections possible without exposing the server to inbound internet traffic.

Many cloud environments follow what is known as a three-tier architecture. This design separates different parts of an application into layers.

Tier 1: Presentation Layer

This is the part users interact with.

Typically, load balancers live in public subnets and accept requests from users around the world.

Tier 2: Application Layer

Application servers live in private subnets.

They process requests, execute business logic, and communicate with backend services.

Because they are private, users cannot access them directly.

Tier 3: Database Layer

Databases are usually placed in highly restricted private subnets.

Only application servers are allowed to communicate with them.

This creates an additional security barrier between sensitive data and the outside world.

Security Groups: Your First Line of Defense

Imagine every server in your cloud environment having its own security guard.

That's essentially what Security Groups do.

Security Groups act as virtual firewalls attached directly to resources. They control what traffic is allowed in and out.

For example:

  • A load balancer may allow HTTPS traffic from anyone.

  • Application servers may only accept traffic from the load balancer.

  • Databases may only accept traffic from application servers.

By restricting communication to only what is necessary, Security Groups help reduce security risks.

Network ACLs: Security at the Subnet Level

While Security Groups protect individual resources, Network Access Control Lists (Network ACLs) protect entire subnets.

You can think of them as security checkpoints at the entrance and exit of a neighborhood rather than security guards at individual houses.

Network ACLs provide another layer of protection by controlling which types of traffic can enter or leave a subnet.

Together, Security Groups and Network ACLs create a layered security model that is much stronger than relying on a single control.

Designing a Secure VPC

When designing a VPC, successful cloud architects constantly ask themselves three questions:

  1. What needs to be public?

  2. What should remain private?

  3. Who needs to communicate with whom?

The answers to these questions determine how the network should be structured.

A good design minimizes internet exposure, keeps sensitive systems private, and only allows the communication that is absolutely necessary.

Final Thoughts

A VPC is much more than just a network in the cloud. It is the foundation upon which secure, scalable, and reliable cloud applications are built.

By understanding concepts such as subnets, public and private networks, NAT Gateways, Security Groups, and Network ACLs, you can design cloud environments that protect sensitive resources while still delivering applications efficiently to users.

At its core, cloud networking is really about boundaries. Decide what should be exposed, what should be protected, and how systems should communicate. When those boundaries are clear, building secure cloud infrastructure becomes much easier.

More from this blog

K

kelvin beno develops

17 posts

Technology doesn’t feel like a tool anymore. It feels like a landscape. Vast, shifting, and sometimes overwhelming. There are peaks of innovation that promise clarity, and valleys of confusion where nothing quite works the way it should. Some days, I move through it effortlessly, clicking, building, understanding. Other days, I feel like I’m wandering through fog, chasing solutions that disappear just as I get close. But journaling grounds me.