This workshop is a hands-on walk through of a three-tier web architecture in AWS. We will be manually creating the necessary network, security, app, and database components and configurations in order to run this architecture in an available and scalable manner.
In this architecture, a public-facing Application Load Balancer forwards client traffic to our web tier EC2 instances. The web tier is running Nginx webservers that are configured to serve a React.js website and redirects our API calls to the application tier’s internal facing load balancer. The internal facing load balancer then forwards that traffic to the application tier, which is written in Node.js. The application tier manipulates data in an Aurora MySQL multi-AZ database and returns it to our web tier. Load balancing, health checks and autoscaling groups are created at each layer to maintain the availability of this architecture.
- Create one S3 bucket for storing web-server & app-server code.
- Upload the code to your S3 from your local system.
- Create another S3 bucket for VPC flow logs.
- S3 read only.
- SSM managed instance core.
- Enable auto-assign public IP for web-tier public subnets.
- Create flow logs for VPC & use the S3 bucket created above.
- External-Load-Balancer-SG --> HTTP (80): 0.0.0.0/0.
- Web-Tier-SG --> HTTP --> Ext-LB-SG.
- Internal-Load-Balancer-SG --> HTTP --> Web-Tier-SG.
- App-Tier-SG --> Port 4000 --> Internal-LB-SG.
- DB-Tier-SG --> MySQL (3306) --> App-Tier-SG.
- Create DB subnet group.
- Create RDS - Multi-AZ.
- Place them in DB subnet group created above.
- Test App-Server Commands
- Create AMI.
- Create launch template using AMI.
- Create target group.
- Create internal load balancer.
- Create autoscaling group.
- Edit
nginx.conf
file in local system by adding Internal-LB-DNS & upload the file in S3.
- Test Web-Server Commands
- Create AMI.
- Create launch template using AMI.
- Create target group.
- Create external load balancer.
- Create autoscaling group.
- Delete CloudFront.
- Delete CloudWatch alarms.
- Delete records from Route 53.
- Delete load balancers, target groups, ASG, launch templates.
- Delete security group.
- Delete NAT gateway (it will take 5 mins).
- Release elastic IP.
- Delete VPC.
- Delete RDS subnet group, RDS.