How to Deploy EC2 Instances with an Internal Load Balancer, and ACM SSL Certificate in AWS with Terraform

Guillermo Musumeci
13 min readJun 7, 2022

One of the benefits of using the public cloud is that you can use it as an extension of our data center and deploy internal applications (not exposed to the internet) using automation.

In this story, we will learn how to build several components to create a good foundation base to deploy high available internal web applications in AWS.

We will deploy:

  • Amazon Linux EC2 Instances in multiple AZs
  • An INTERNAL Application Load Balancer (ALB) to distribute the load between these EC2
  • ALB Target Group and Listeners for HTTP and HTTPS protocols
  • Register DNS Records in Route 53
  • Create an SSL certificate using AWS Certificate Manager

If you are interested in deploying similar workloads for public applications, please look at this story → How to Deploy EC2 Instances in Multiple AZs, with a Load Balancer, and SSL Certificate in AWS with Terraform.

Prerequisite #1: AWS Credentials

Before creating our AWS EC2 Instance, we will need AWS Credentials to execute our Terraform code.

--

--

Guillermo Musumeci
Guillermo Musumeci

Written by Guillermo Musumeci

Certified AWS, Azure & GCP Architect | HashiCorp Ambassador | Terraform SME | KopiCloud Founder | ex-AWS | Entrepreneur | Book Author | Husband & Dad of ✌

No responses yet