Baby Steps into AWS Networking: Part 1
Learn About AWS Regions, Availability Zones (AZs), Virtual Private Cloud (VPC), Subnets and Launch an EC2 Instance!
Are you intrigued by cloud computing but find yourself puzzled by terms like AWS AZ and VPC? Perhaps you're just starting your AWS journey and crave a solid understanding of the basics If any of this resonates with you, you're in the right place!
This tutorial is designed to be a quick yet effective guide to AWS networking essentials. Originally crafted as a presentation deck, I've adapted it here to provide detailed insights in a format that's easy to digest. Whether you're a beginner or seeking clarification, I'm here to help! if you have any questions or need further clarification, don't hesitate to reach out to me at newsletter@zilhaz.com. Happy learning!
AWS Regions & Availability Zones (AZs)
🌐 When you’re getting started with AWS, one of the first things you’ll need to do is choose a geographic region such as US East (N. Virginia), Asia Pacific (Singapore), etc. Simply put, an AWS Region is a physical location around the world where AWS has data centers.
🌐As of now, there are 33 AWS Regions worldwide. This means that AWS has data centers in 33 different geographic locations around the world, and you can choose to host your services in any of these regions.
🌐 When you log into the AWS console, you can select the Region where you want to host your resource. For example, if you select us-east-1, your service will be hosted in the AWS data center in the US East (N. Virginia) Region.
Remember, choosing the right Region is important because it can affect the latency of your service, the cost, and even the AWS services that are available to you. So, choose wisely! Next, we’ll dive deeper into Availability Zones within these Regions.
Navigating AWS Availability Zones
🌐 In AWS, an Availability Zone (AZ) is akin to a distinct area within a region. Each AZ is a separate physical location equipped with its own set of resources.
🌐 For example, us-east-1, also known as the US East (N. Virginia) region, has 6 availability zones. Each AZ is situated at a meaningful distance, often spanning many kilometers from any other AZ within the region.
🌐 Each AZ has everything it needs to work independently, like power and cooling systems. So, even if there’s a power outage in one AZ, the others are not affected. This is how AWS makes sure your services are always available.
🌐 Each Availability Zone within a Region is denoted by a lowercase letter such as ‘a’, ‘b’, ‘c’, and so on. For example, in the US East (N. Virginia) Region, which is also known as us-east-1, the Availability Zones are labeled as us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1e, and us-east-1f.
Next, we’ll learn about Virtual Private Cloud, or VPC. This will further clarify the concepts of Regions and Availability Zones.
VPC: Your Personal Space in AWS!
🌐 What is a VPC?
A Virtual Private Cloud (VPC) lets you provision a logically isolated section of the AWS cloud. This means it’s like having your own private piece of the AWS environment. It gives you full control over your virtual networking environment. Think of VPC as a network within your on-premise datacenter.
🌐 Default & Custom VPCs
When you create an AWS account, AWS automatically sets up a default VPC for you. In addition to the default VPC, you can create your own custom VPCs. This allows you to tailor your networking setup to meet the specific needs of your application or organization.
🌐 VPC spans across AZs
A VPC resides within a single AWS region (e.g., us-east-1). A VPC cannot span across multiple regions. However, within a single region, it can span across multiple Availability Zones (AZs). For example, you can launch a VPC that spans across us-east-1a, us-east-1b, and us-east-1c.
Simply having a VPC is not sufficient to create an AWS resource. It’s necessary to have at least one subnet within the VPC. Next, we’ll discuss subnets!
Subnets: Your AWS Building Blocks!
🌐 What is a Subnet?
A subnet, or subnetwork, is a segmented section of your VPC. More specifically, it’s a logical subdivision of the IP range of the VPC. The act of dividing a network into two or more networks is known as subnetting.
🌐 Public & Private Subnet
If a subnet’s traffic is routed to a public internet, it’s known as a public subnet. If a subnet doesn’t have a route to the public internet, it’s considered a private subnet.
Let’s get hands-on now! We’re going to create a VPC in the us-east-1 region. This VPC will feature 1 public and 1 private subnet in each of three separate availability zones: us-east-1a, us-east-1b and us-east-1c. Then we will create an EC2 instance in the private subnet of us-east-1a.
Basic Setup with Region, VPC, Subnets and EC2
Let’s create the setup outlined in the diagram below in AWS. But before we proceed, let's clarify what an EC2 instance is. An EC2 instance is like a regular computer or a server in your on-premise data center, but it’s located in Amazon’s data center. You can use it to run applications, host websites, or do anything else you’d do with a regular computer or server. The cool part is you can choose its power (CPU, memory) and turn it on or off whenever you want!
Select ‘us-east-1’ as our intended AWS region.
Then create a VPC with the following specifications:
It spans 3 Availability Zones (AZs): us-east-1a, us-east-1b, and us-east-1c.
Each AZ contains one public subnet and one private subnet.
Create an EC2 instance in the private subnet of us-east-1a.
Select previously create VPC (project-vpc)
Select the private subnet of us-east-1a
Mission Accomplished! We now have a running EC2 instance in the private subnet of us-east-1a. Great job!
🌍 Today, we took a journey through AWS Regions, delved into VPC creation in us-east-1, crafted public and private subnets across three distinct AZs, and successfully launched an EC2 instance in a private subnet.
🔍 Stay tuned for more AWS networking tutorials where we'll dive into essential topics like Security Groups, NACL, NAT Gateway, Internet Gateway and much more!