Troubleshooting a Terraform Deployment

45 minutes
  • 5 Learning Objectives

About this Hands-on Lab

Hey there, Gurus! Welcome to the lab! This lab will demonstrate how to troubleshoot configuration issues when using Terraform to deploy and manage your infrastructure. You, as an admin, are being asked to troubleshoot multiple issues with an infrastructure deployment to your company’s AWS environment. You will first need to troubleshoot a variable interpolation error when formatting your configuration. You will then run into a couple errors when validating your configuration. You will need to fix a `for_each` error as well as an `output` error before you can finally deploy your infrastructure.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Correct the Variable Interpolation Error

In the Terminal

  1. Check the format of your Terraform configuration files.
  2. Correct the interpolation error.
  3. Re-check the format.
Correct the Syntax Error for the Resource

In the Terminal

  1. Initialize your working directory.
  2. Validate your configuration.
  3. Correct the syntax error.
  4. Format your configuration.
Correct the Region Declaration Error

In the Terminal

  1. Validate your configuration.
  2. Correct the region declaration error.
  3. Format your configuration.
Correct the Outputs Error

In the Terminal

  1. Validate your configuration.
  2. Correct the outputs error.
  3. Format your configuration.
Deploy the Infrastructure

In the Terminal

  1. Validate your configuration.
  2. Apply your configuration to deploy your infrastructure.
  3. Confirm your deployment.
  4. Destroy your infrastructure.

Additional Resources

You are an admin who supports one of the largest online comic book retailers in the world. You are one of a handful of Terraform admins who have been assigned to use Terraform to manage the company's cloud deployments. You have been asked to take a look at a coworker's Terraform configuration that is currently having multiple issues. Your coworker is currently on vacation, and you want to take care of this so you don't have to bother them during their vacation. Troubleshoot the configuration and fix the issues so you can successfully deploy the AWS infrastructure for your coworker.

Configuration Used in This Lab

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?