validate
What is validate?
validate: Checks that the configuration is syntactically valid and internally consistent — no API calls, no state needed. terraform validate checks that a configuration is syntactically correct and internally consistent: valid HCL, correct argument names and types, and references that point to things that exist. It does not contact any cloud provider or read state.
Frequently asked questions about validate
How is validate used in practice?
That makes it fast and safe to run anywhere, including in CI on every push and in editor plugins while you type.
What should you keep in mind with validate?
It catches typos and structural mistakes early, but it cannot tell you whether a plan will succeed against real infrastructure. A valid configuration can still fail because of permissions, quotas or names that are already taken. Run terraform fmt -check and terraform validate first in a pipeline, then terraform plan for the full picture. Tools like TFLint add further checks, such as invalid instance types for a provider.
What does an example of validate look like?
terraform validate At a glance
| Category | Terraform |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |