hands-on lab

Manage AWS Resources with Terraform

Up to 1h
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.
Lab description

Lab Overview

Terraform allows you to safely manage your infrastructure by modifying configuration files. Terraform will show you an execution plan that you must approve before any infrastructure changes are applied. This Lab highlights several capabilities of Terraform that make managing infrastructure easy. You will learn how to import existing resources, understand configuration file interpolation syntax to reference resource attributes, and use variables to generalize configuration while you manage AWS resources with Terraform. 

Lab Objectives

Upon completion of this Lab you will be able to:

  • Import existing resources into Terraform
  • Use interpolation syntax to reference resource attributes in configurations
  • Use variables to parameterize Terraform configurations
  • Understand Terraform's concept of state

Lab Prerequisites

You should be familiar with:

  • Working at the command-line in Linux
  • Amazon VPC and EC2 basics
  • Basic Terraform concepts such as resources, and state. It is highly recommended to complete the Create AWS Resources with Terraform Lab before attempting this Lab.

Lab Environment

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

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



May 22nd, 2023 - Resolved an issue that caused the lab to fail to setup on rare occasions

November 29th, 2022 - Updated lab to use EC2 Instance Connect and added checks

February 14th, 2022 - Updated link to Terraform docs page

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

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

About the author
Logan Rakai, opens in a new tab
Lead Content Developer - Labs
Learning paths

Logan has been involved in software development and research since 2007 and has been in the cloud since 2012. He is an AWS Certified DevOps Engineer - Professional, AWS Certified Solutions Architect - Professional, Microsoft Certified Azure Solutions Architect Expert, MCSE: Cloud Platform and Infrastructure, Google Cloud Certified Associate Cloud Engineer, Certified Kubernetes Security Specialist (CKS), Certified Kubernetes Administrator (CKA), Certified Kubernetes Application Developer (CKAD), and Certified OpenStack Administrator (COA). He earned his Ph.D. studying design automation and enjoys all things tech.

LinkedIn, Twitter, GitHub

Covered topics
Lab steps
Logging In to the Amazon Web Services Console
Connecting to an EC2 Instance Using Amazon EC2 Instance Connect
Importing an AWS Resource into Terraform
Creating an EC2 Instance with Terraform
Using Variables to Generalize Terraform Configuration