CloudOps Observer
← All labs

Terraform / Beginner / 15–25 min

The Terraform plan with a missing input

A local Terraform plan cannot find a required input. Trace the variable configuration and restore a stable plan.

LAB IDcloudops-01-terraform-variableTRACK / cloudops.observer
Engineer working beside connected cloud servers

The scenario

An infrastructure configuration fails before it can plan because an expected input is missing. This exercise uses only Terraform's built-in local resource and local state, not a cloud account.

Mission objectives

  • Inspect the plan error, variable declarations, and input file.
  • Supply the intended input without changing the resource definition.
  • Apply locally and verify that a subsequent plan has no changes.

Lab README

Terraform plan with a missing input

A Terraform configuration cannot plan because an expected input is missing. Investigate its variable declarations and input file, then restore a stable plan without changing the resource definition.

Before you begin

You need Bash, Python 3 and Terraform 1.4 or newer. This exercise uses local Terraform state and terraform_data; it does not create cloud resources or use cloud credentials.

Run and clean up

From this directory, run ./setup.sh, then inspect the plan in .lab-state with terraform -chdir=.lab-state plan -input=false. After your changes, run ./verify.sh and ./teardown.sh. Teardown removes the local lab state.

View Markdown source ↗

Get the lab

Download and inspect the installer before running it. It checks the archive's SHA-256 digest and refuses to overwrite an existing lab directory.

curl -fsSLO https://devops.download/labs/cloudops-01-terraform-variable.sh
less cloudops-01-terraform-variable.sh
bash cloudops-01-terraform-variable.sh
cd labs/cloudops-01-terraform-variable
./setup.sh

When you've made your changes, run ./verify.sh. Remove lab resources with ./teardown.sh.

Download the archive instead ↗

Need a nudge?

Hint #1

Run Terraform with -input=false inside .lab-state to see the error.

Hint #2

Compare the declared variable name with the key in terraform.tfvars.

Hint #3 · Deep Dive Runbook on opsbreakfix.com

Read the deep dive runbook ↗

Solved it?

Read the Official Root Cause Analysis & Certification Roadmap on opsbreakfix.com

Continue to opsbreakfix.com ↗

One ecosystem.
Many perspectives.

Follow the connection from a hands-on lab to the knowledge and tools behind it.