Terraform Cheatsheet
NewTerraform/OpenTofu reference — CLI commands, resource blocks, variables, and state management.
Frequently Asked Questions
What does the 'Show full syntax' toggle do on this page?
It switches cards between short labels like 'terraform plan' or 'count = ...' and fuller syntax or block examples. It's useful when you want either a quick reminder or the exact placeholder shape.
Can I copy both the generic syntax and the worked example?
Yes. Each card has separate buttons for 'Copy syntax' and 'Copy example'. That makes it easy to grab either the template or the more concrete snippet.
Why is terraform refresh here if newer workflows talk about -refresh-only instead?
Because the entry deliberately notes that nuance. The tool still lists terraform refresh, but its description says newer Terraform often prefers plan/apply with -refresh-only.
Does it cover only CLI commands?
No. The categories also include state management, core HCL blocks, variables and outputs, modules and providers, meta-arguments, and expressions/functions. It even includes backend examples for S3, AzureRM, and GCS.
Will this validate my configuration or connect to a backend?
No. It's reference content only. It doesn't parse your HCL, run terraform, or inspect real state.