Troubleshooting Terraform Output Errors

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Hey there, Gurus! Welcome to the lab! This lab will demonstrate how to troubleshoot Terraform output errors. We will go through the different stages of deployment to try and deploy our configuration, and work through the output errors until we have successfully deployed our resources.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Validate Your Code
  1. In the terminal, once logged in to your instance, change to the terraform directory.
  2. In the terraform directory, edit the main.tf file and add in your ami ,subnet_id, and vpc from the resource_ids.txt file.
  3. Run the terraform fmt command.
  4. Initialize your working directory.
  5. If initialization is successful, then validate your code.
Fix the Output Errors
  1. After running the terraform validate command, you should get an error. Read the error and go to each line in the outputs.tf file where the error is.
  2. Fix each output error that you get.
  3. Check the formatting, then validate your code again. If the error is fixed, move on to the next step in your deployment.
Deploy Your Resources
  1. Once you have worked past the error, successfully validated your code, and ran the plan command, then deploy your resources.
  2. The lab is complete when you have successfully deployed 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 admins who have been assigned to use Terraform to manage the company's cloud deployments. You are asked to create a new dev environment to test out new features of the company's site. You have a configuration that will create app servers for the site. You have started to get things ready, and you are ready to use the code to deploy your resources, but you have run into some output errors. Fix the errors and successfully deploy your app servers in AWS using Terraform to complete 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?