Deploy a Highly Available Website with Terraform on AWS


100 students completed the lab in ~21m

Total available time: 35m

31 students rated this lab!

Lab Overview

An attractive feature of the cloud is that you can deploy applications in multiple data centers making them highly available and able to tolerate a high degree of failures. In this Lab, you will deploy a secure and highly available website with Terraform on AWS using a two-tier architecture with private and public subnets. The web servers and Elastic Load Balancer will span multiple availability zones to achieve high availability.

Lab Objectives

Upon completion of this Lab you will be able to:

  • Apply infrastructure changes in Terraform
  • Configure all the network and security infrastructure needed to deploy a highly available website
  • Use user data to bootstrap web servers
  • Destroy infrastructure managed by Terraform

Lab Prerequisites

You should be familiar with:

Lab Environment

Before completing the Lab instructions, the environment will look as follows:

After completing the Lab instructions, the environment should look similar to:

Follow these steps to learn by building helpful cloud resources

Logging in to the Amazon Web Services Console

Your first step to start the Lab experience

Connecting to the Virtual Machine using SSH

Create a secure connection to a remote machine

Configuring the Website on the EC2 Instances with Terraform

Change the existing Terraform configuration to serve a custom website on the instances

Configuring Network Resources for Elastic Load Balancing with Terraform

Configure public subnets, security groups, and a route table to support an internet-facing ELB

Configuring an Elastic Load Balancer with Terraform

Configure an ELB and verify it's distributing website traffic across availability zones

Destroying Resources with Terraform

Destroy a target resource and then all remaining resources