0
0
AWScloud~30 mins

High availability design patterns in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
High Availability Design Patterns with AWS
📖 Scenario: You are working as a cloud architect for a small online store. The store wants to make sure their website stays online even if one server fails. You will build a simple AWS setup that uses high availability design patterns to keep the website running smoothly.
🎯 Goal: Build an AWS infrastructure using an Elastic Load Balancer (ELB) and two EC2 instances in different Availability Zones to ensure high availability for the website.
📋 What You'll Learn
Create two EC2 instances in different Availability Zones
Create an Elastic Load Balancer that distributes traffic to both instances
Configure health checks for the load balancer
Ensure the setup is simple and follows AWS best practices for high availability
💡 Why This Matters
🌍 Real World
High availability design patterns are essential for websites and applications that must stay online without interruption, even if some servers fail.
💼 Career
Cloud architects and DevOps engineers use these patterns daily to design resilient and scalable cloud infrastructures.
Progress0 / 4 steps
1
Create two EC2 instances in different Availability Zones
Create two EC2 instances named web_server_1 and web_server_2. Place web_server_1 in Availability Zone us-east-1a and web_server_2 in Availability Zone us-east-1b. Use the Amazon Linux 2 AMI and instance type t3.micro for both.
AWS
Need a hint?

Use the aws_instance resource twice with different availability_zone values.

2
Create an Elastic Load Balancer
Create an Elastic Load Balancer named web_elb that listens on port 80 and forwards traffic to the EC2 instances. Use the application load balancer type and place it in Availability Zones us-east-1a and us-east-1b.
AWS
Need a hint?

Use aws_lb for the load balancer and aws_lb_listener for the listener on port 80.

3
Create a target group and register EC2 instances
Create a target group named web_tg for the load balancer that uses port 80 and protocol HTTP. Register both web_server_1 and web_server_2 instances as targets in this group.
AWS
Need a hint?

Use aws_lb_target_group to create the target group and aws_lb_target_group_attachment to register each instance.

4
Configure health checks for the load balancer
Add a health check configuration to the target group web_tg that checks the root path / every 30 seconds with a timeout of 5 seconds. Set healthy threshold to 2 and unhealthy threshold to 2.
AWS
Need a hint?

Inside the aws_lb_target_group resource, add a health_check block with the specified settings.