AWS Three-Tier Architecture - Part 2
π Table of Contents
π Networking and Security
π VPC Creation
- Open the VPC dashboard in the AWS console.
- Click on Your VPCs from the left sidebar.
- Select VPC only and enter:
- A Name tag.
- A CIDR range (Ensure it supports at least 6 subnets).
- Click Create VPC.
π Note: Stay consistent with the AWS region for all resources.
ποΈ Subnet Creation
- Navigate to Subnets in the VPC dashboard.
- Click Create Subnet.
- Create six subnets across two Availability Zones:
- Three subnets in AZ-1.
- Three subnets in AZ-2.
- Assign each subnet a Name, Availability Zone, and CIDR range.
π Tip: Use a naming convention like:
Public-Web-Subnet-AZ-1
Private-App-Subnet-AZ-1
Private-DB-Subnet-AZ-1
Note: Each subnetβs CIDR range should be a subset of your VPC CIDR.
π Internet Connectivity
π Internet Gateway (IGW)
- Go to Internet Gateways in the VPC dashboard.
- Click Create Internet Gateway, give it a name, and confirm.
- Attach it to your VPC by selecting the correct VPC and clicking Attach Internet Gateway.
π‘ NAT Gateway
To allow private instances to access the internet:
- Go to NAT Gateways in the VPC dashboard.
- Click Create NAT Gateway and:
- Enter a Name.
- Select one of your public subnets.
- Allocate an Elastic IP.
- Click Create NAT Gateway.
- Repeat for the other public subnet to ensure high availability.
π¦ Routing Configuration
- Go to Route Tables in the VPC dashboard.
- Click Create Route Table and enter a name.
- After creation:
- Go to Routes tab β Click Edit routes.
- Add a route for all external traffic (0.0.0.0/0) to the Internet Gateway.
- Save changes.
- Go to Subnet Associations:
- Edit and associate the two public subnets.
For Private Subnets:
- Create two more route tables (one per availability zone).
- Route external traffic (0.0.0.0/0) to NAT Gateway.
- Associate with the app-layer private subnets.
Private Route table az1
private route table az2
π Security Groups
Security Groups control inbound and outbound traffic.
1οΈβ£ Public Load Balancer Security Group
- Allows HTTP (port 80) traffic from your IP.
2οΈβ£ Web Tier Security Group
- Allows HTTP (port 80) traffic from the public load balancer.
- Allows your IP to access the instances.
3οΈβ£ Internal Load Balancer Security Group
- Allows HTTP (port 80) traffic from the web-tier security group.
4οΈβ£ Private Instances Security Group
- Allows TCP (port 4000) traffic from the internal load balancer.
- Allows your IP for testing.
5οΈβ£ Database Security Group
- Allows MySQL/Aurora (port 3306) traffic from the private instance security group.
β Conclusion
You have now successfully set up the networking and security configurations for your AWS Three-Tier Architecture.
In Part 3, we will proceed with further configurations and deployments.
π Continue to Part 3: AWS Three-Tier Architecture (Part 3)
For Avalability Zone-1
Create-public-Subnet-az1
private-subnet1-az1
private-subnet2-db-az1
For Availability Zone-2
public-subnet-az2
private-subnet1-az2
All the subnets are created Successfully.
Create Internet Gateway
Attach to VPC
Create NAT gateway
For Az 1
*Configure Routing *
Create public Route Table
Create private Route Table for az1
Create private route table for Az2
Edit Routes
Create Security Group
INternet Facing lb sg
Web Tier SG
Internal lb SG
Private Instance SG
Database SG
Top comments (0)