21 Days of AWS using Terraform — Day 4- Creating Application Load Balancer(ALB) using Terraform
Welcome to Day 4 of 21 Days of AWS using Terraform, So far we build VPC and EC2, let’s build Application Load Balancer and add two instances behind it. This is going to be a modular approach i.e we are going to get vpc id,subnet1 and subnet2 created during the VPC module and instance id from EC2 module.
What is the Application Load Balancer?
The Application Load Balancer is a feature of ElasticLoad Balancing that allows a developer to configure and route incoming end-user traffic to applications based in the Amazon Web Services (AWS) public cloud.
Features
- Layer7 load balancer(HTTP and HTTPs traffic)
- Support Path and Host-based routing(which let you route traffic to different target group)
- Listener support IPv6
Some Key Terms
Target Group
Target types:
- Instance types: Route traffic to the Primary Private IP address of that Instance
- IP: Route traffic to a specified IP address
- Lambda function
Health Check
- Determines whether to send traffic to a given instance
- Each instance must pass its a health check
- Sends HTTP GET request and looks for a specific response/success code
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html
Final Code
https://github.com/100daysofdevops/21_days_of_aws_using_terraform
Looking forward for you guys to join this journey
- Website: http://100daysofdevops.com/
- Twitter: @100daysofdevops OR @lakhera2015
- Facebook: https://www.facebook.com/groups/795382630808645/
- Medium: https://medium.com/@devopslearning
- GitHub: https://github.com/100daysofdevops/100daysofdevops
- Slack: https://join.slack.com/t/100daysofdevops/shared_invite/enQtNzg1MjUzMzQzMzgxLWM4Yjk0ZWJiMjY4ZWE3ODBjZjgyYTllZmUxNzFkNTgxZjQ4NDlmZjkzODAwNDczOTYwOTM2MzlhZDNkM2FkMDA
- YouTube Channel: https://www.youtube.com/user/laprashant/videos?view_as=subscriber
In addition to that, I am going to host 5 meetups whose aim is to build the below architecture.
- Meetup: https://www.meetup.com/100daysofdevops
- Day1(Nov 10): Introduction to Terraform https://www.meetup.com/100daysofdevops/events/266192294/
- Day 2(Nov 16): Building VPC using Terraform
- Day 3(Nov 17): Creating EC2 Instance inside this VPC using Terraform
- Day 4(Nov 23): Adding Application Load Balancer and Auto-Scaling to the EC2 instance created on Day 3
- Day5(Nov 24): Add Backend MySQL Database and CloudWatch Alarm using Terraform