Autoscaling Groups With Terraform on AWS Part 3: Elastic Load Balancer and Health Check
In this article, see part three of how to autoscale groups with Terraform and add a load balancer in front of the autoscaling group.
Join the DZone community and get the full member experience.Join For Free
Previously, we set up some Apache Ignite servers in an autoscaling group. The next step is to add a Load Balancer in front of the autoscaling group.
Before any steps let’s add some environment variables to variables.tf
First, we shall add the security group for the Load Balancer.
Then we need to retrieve the availability zones for the Load Balancer.
Then let’s add the Load Balancer.
Then let’s match the Load Balancer with the autoscaling group and set the health type to ELB.
As before you apply your terraform solution:
Published at DZone with permission of Emmanouil Gkatziouras, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.