From the course: Learning Terraform

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Expanding your installation

Expanding your installation - Terraform Tutorial

From the course: Learning Terraform

Expanding your installation

- [Instructor] In this lesson, we'll be setting up a load balancer and an autoscaling group for our application. First, we'll set up the load balancer and just point it to our single instance. To start, we'll go to the Terraform Registry and search for alb. And we'll select the terraform-aws-modules/alb. If we scroll down to the README here, there's a good set of example code that we can use to start with. It's a little bit long, but we'll end up deleting some of it. So we'll copy that. So if we go to our README and open up main.tf and then let's open the editor. Close our sidebar here so we can see a little bit better. Let's put this load balancer code right below the instance code here. There are a few things we'll need to change. So let's go up to the top. Let's set the name to blog-alb. And for the VPC ID, we can use the one from our module, module.blog_vpc.vpc_id. And for the subnets, we can use module.blog_vpc.public_subnets. For security group, we'll use the one from our…

Contents