Terraform
State Checks
During the Lifecycle (config) mode of a TestStep
, the testing framework will run terraform apply
.
The execution of terraform apply
results in a state file, and can be represented by this JSON format.
A state check is a test assertion that inspects the state file. Multiple state checks can be run, all assertion errors returned are aggregated, reported as a test failure, and all test cleanup logic is executed.
Refer to:
- Resource State Checks for built-in managed resource and data source state checks.
- Output State Checks for built-in output-related state checks.
- Custom State Checks for defining bespoke state checks.