terraform-test - Write and run Terraform tests
Guides writing and running Terraform tests with test files, run blocks, assertions, mocks, module checks, and troubleshooting.
Tags
Updated: 2026-12-02Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Create Terraform test files
- Define test scenarios
- Configure plan and apply modes
- Write validation assertions
- Mock providers and data sources
- Test module outputs
- Test resource configurations
- Specify expected failures
- Troubleshoot test syntax
- Troubleshoot test execution
Inputs
- Terraform configuration
- Test requirements
- Provider configurations
- Module sources
- Test variables
Outputs
- Terraform test files
- Test execution results
- Validation failure messages
- Temporary test resources
- Terraform test state changes
Requirements
- Terraform CLI
- Terraform 1.6+ for test blocks
- Terraform 1.7+ for mock providers
- Terraform 1.9+ for state_key and run parallelism
