Three-tier architecture is a software design pattern that organizes an application into three separate layers or tiers. Each tier has a specific role, making the application easier to manage, scale, and develop.

Extract code:

Create s3 bucket


Create Role to integrate 2 services for Authentication

Steps to create three tier architecture
- VPC creation
- Subnet creation
- Network connectivity
- NAT Gateway
- Routing configuration
- Security Groups
Working:
1.VPC Creation
- VPC only is selected, and fill out the VPC Settings with a Name tag and a CIDR range of your choice.

2.Subnet creation
Need 6 subnets for two availability zones.
az1(zone 1)
- public subnet1
- private subnet1
- private database subnet
az2(zone 2)
- public subnet2
- private subnet2
- private database subnet


3.Internet Connectivity
- Create Internet Gateway(IG)

- allocate Internet Gateway to VPC

*4.Create NAT Gateway *
- NAT Gateway created to connect private subnet with internet.
- Create 2 NAT Gateways-The architecture has 2 zones.
- Before creating NAT Gateway we need to allocate elastic IP in Elastic IPS.


- Follow the same steps for az2(zone 2)
5.Routing configuration
- Improves communication, enforces security, and supports scalability by managing how data flows between layers efficiently.
- Create route table for both public and private subnets

update subnet association for public and private subnets


6.Security groups
- used to control traffic flow between the layers.
- need to create 5 security groups.
- public-internet facing load balancer
- public instances in the web tier
- load balancer
- private instances
- private database instances
** internet facing load balancer**

web tier

load balancer

private instances

** private database instances**

Creating Subnet groups

- Database created!!


App Instance Deployment


