hands-on lab

Creating AWS Resources with Terraform

Difficulty: Beginner
Duration: Up to 1 hour
Students: 7,694
Rating: 4.7/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Terraform is a tool for declaring and managing infrastructure as code. With Terraform you can write declarative configuration files, view execution plans, and apply plans to realize the infrastructure declared in the configuration files. An important advantage of Terraform is that is supports over 100 resource providers including the major public cloud providers, such as Amazon Web Services, Microsoft Azure, and Google Cloud Platform. In this Lab, you will learn the basics of working with Terraform and create an Amazon Virtual Private Cloud (VPC) with Terraform.

Lab Objectives

Upon completion of this Lab you will be able to:

  • Install Terraform on Linux
  • Configure Terraform providers
  • Create AWS resources with Terraform

Lab Prerequisites

You should be familiar with:

  • Working at the command-line in Linux
  • Amazon VPC basics 

Updates

March 12th, 2023 - Resolved an issue that caused the lab to fail to set up on rare occasions

July 6th, 2021 - Refactored lab to use EC2 Instance Connect, updated lab environment images, updated version of Terraform to latest

April 16th, 2021 - Moved validation checks to the most relevant lab step for more immediate validation feedback

August 28th, 2020 - Updated the SSH instructions to reflect the new EC2 user interface

July 18th, 2019 - Improved the validation Lab Step to further check the work you perform in the Lab

January 10th, 2019 - Added a validation Lab Step to check the work you perform in the Lab

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Connecting to the Virtual Machine using EC2 Instance Connect
Installing Terraform
Configuring Providers in Terraform
Creating an AWS Resource with Terraform