terraform-test - Write and run Terraform configuration tests
Guides writing and running Terraform tests for scenarios, assertions, providers, modules, outputs, and validation failures.
Tags
Updated: 2026-12-02Capabilities
Typical Inputs
What this skill does
- Create Terraform test files
- Define test scenarios with run blocks
- Run plan or apply tests
- Validate resources and outputs with assertions
- Mock providers and data sources
- Test expected validation failures
- Test local and registry modules
- Configure plan behavior and variables
- Troubleshoot test syntax and execution
Inputs
- Terraform module configuration
- .tftest.hcl or .tftest.json files
- Test variables and provider configurations
- Module source addresses
- Provider credentials and access
Outputs
- Test pass or failure status
- Assertion failure messages
- Temporary test resources
- Test state changes
Requirements
- Terraform CLI with test framework support
- Configured provider plugins
- Resource permissions for apply-mode tests
