Building a Multi-Tier Application with VPC and Load Balancing
In this article, I will walk you through creating a multi-tier application architecture with a Virtual Private Cloud (VPC) on AWS.
We’ll set up two private subnets for the application (Application Backend) and data tiers (Application Database) and a public subnet for the web tier (Application Frontend). We will focus on networking, ensuring the proper configuration of subnets, route tables, and security groups.
After that, you can quickly launch the resources on those subnets.
Our Application Architecture

We will have a minimum of 2 subnets for each tier. We will require 1 VPC, 2 public subnets, and 4 private subnets.
Step 1: Creating a Multi-Tier application Virtual Private Cloud (VPC)
The first thing you need to do is create a VPC. To do that:
Log in to your AWS Management Console.
Navigate to the VPC Dashboard.
Click on “Your VPCs” in the left menu.
Click the “Create VPC” button.

Select “VPC and More.” (We are creating multiple az, subnet, and other features so we are selecting it.)

Give the name of the VPC.
Add “10.0.0.0/16” in the CIDR block field. (We will have multiple IP addresses in this CIDR.)
Select “No IPv6 CIDR block” as we will just be using IPv4.
Select tenancy as Default.

Choose several Availability Zones to “2.” ( We will have our subnet across two AZs.)
Choose the number of public subnets to “2.”
Choose the number of private subnets to “4.”
Choose NAT Gateway as “None.” ( We will not be attaching NAT gateway in our private subnet. If you want to attach it then you can do it.)
Choose VPC endpoints as “None.”

Enable DNS hostnames and DNS resolutions.
If you want to know about these selected features, you can click on “info” to get more information.

Click on “Create VPC.”
It will automatically create the VPC, Subnet, Route Tables, etc.

You can view the VPC and Subnets.
Step 2: Assigning public IPv4 to the public subnet
Go to the subnets section.

Select one of the public subnets from the list.
Click on the “Actions” button located at the top right corner of the page.
From the dropdown menu, choose “Edit subnet settings.”

Select “Enable auto-assign public IPV4 address”, then click “Save.”

Click on “Save.”
Select the second public subnet and repeat the same process.
