Terraform CLI Cheat Sheet/Run Terraform tests

Execute Terraform test files in the tests directory or specified test directory.

Section: Formatting and Validation

Run Terraform tests

bash
bash
terraform test
Explanation

Execute Terraform test files in the tests directory or specified test directory.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Formatting and Validation
Format current directory
Rewrite Terraform files to canonical style.
OpenIn sheetbashsame section
Format recursively
Format Terraform files in current directory and subdirectories.
OpenIn sheetbashsame section
Validate configuration
Check whether configuration is syntactically valid and internally consistent.
OpenIn sheetbashsame section
Validate and return JSON
Emit machine-readable validation output, useful in CI.
OpenIn sheetbashsame section
Open Terraform console
Interactive REPL for testing expressions and inspecting values from state.
OpenIn sheetbashsame section
Show Terraform version
Print the installed Terraform CLI version and provider versions in use.
OpenIn sheetbash1 tag match