New batchZero to DevOps starts 29 Nov · limited seatsReserve your seat
Cheat sheetsTerraformTerraform
ProSheet 04 of 9

Outputs & Debugging

A comprehensive developer cheatsheet covering Terraform outputs and debugging techniques, featuring essential CLI commands, common flags, and operational workflows for extracting configuration outputs (terraform output), evaluating expressions interactively (terraform console), generating visual dependency graphs (terraform graph), and inspecting provider requirements and versions.

Terraform: Outputs & Debugging


terraform output — Display Output Values

Displays output values defined in the configuration.

Basic Usage

bash
$ terraform output
instance_ip = "54.123.45.67"
instance_id = "i-0dae5d4daa47fe4a2"
vpc_id = "vpc-12345678"

Get Specific Output

bash
$ terraform output instance_ip
"54.123.45.67"

Get Output in JSON Format

bash
$ terraform output -json
{
  "instance_ip": {
    "value": "54.123.45.67",
    "type": "string"
  },
  "instance_id": {
    "value": "i-0dae5d4daa47fe4a2",
    "type": "string"
  }
}

Get Raw Value (No Quotes)

bash
$ terraform output -raw instance_ip
54.123.45.67

Get Specific Output from Module

bash
$ terraform output -module=module.vpc

Get All Outputs with Sensitive Values

bash
$ terraform output -json

Note: Sensitive values are hidden by default. Use -json to see them.


The rest of this sheet is locked6 Pro sheets unlock together, across every toolEveryPro sheet, every toolLifetimeone payment, no renewalNewsheets included as they shipOne-time payment · lifetime access