0
0
AWScloud~30 mins

Application Load Balancer (ALB) in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Create an Application Load Balancer (ALB) with Target Group in AWS
📖 Scenario: You are setting up a simple web application on AWS. To distribute incoming web traffic evenly across multiple servers, you need to create an Application Load Balancer (ALB) and connect it to a target group of servers.
🎯 Goal: Build an Application Load Balancer (ALB) with a target group and listener using AWS CloudFormation syntax. This will allow your web traffic to be balanced across your servers.
📋 What You'll Learn
Create a target group named MyTargetGroup listening on port 80 with protocol HTTP
Create an Application Load Balancer named MyALB in public subnets
Create a listener on the ALB for port 80 using HTTP protocol
Attach the listener to the target group MyTargetGroup
💡 Why This Matters
🌍 Real World
Load balancers are essential to distribute web traffic evenly across multiple servers, improving availability and performance.
💼 Career
Cloud architects and DevOps engineers often create and configure load balancers to ensure scalable and reliable web applications.
Progress0 / 4 steps
1
Create the Target Group
Create a resource called MyTargetGroup of type AWS::ElasticLoadBalancingV2::TargetGroup with Port set to 80, Protocol set to HTTP, and VpcId set to vpc-123456.
AWS
Need a hint?

The target group needs a name, port, protocol, and VPC ID.

2
Create the Application Load Balancer
Add a resource called MyALB of type AWS::ElasticLoadBalancingV2::LoadBalancer with Subnets set to ["subnet-111111", "subnet-222222"] and Scheme set to internet-facing.
AWS
Need a hint?

The ALB needs to be internet-facing and placed in public subnets.

3
Create the Listener for the ALB
Add a resource called MyListener of type AWS::ElasticLoadBalancingV2::Listener with LoadBalancerArn referencing MyALB, Port set to 80, Protocol set to HTTP, and DefaultActions forwarding to the target group MyTargetGroup.
AWS
Need a hint?

The listener connects the ALB to the target group on port 80 using HTTP.

4
Complete the CloudFormation Template
Add the Outputs section with an output named LoadBalancerDNSName that returns the DNS name of MyALB using !GetAtt MyALB.DNSName.
AWS
Need a hint?

The output helps you find the ALB's DNS name after deployment.