mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-02 13:00:45 -05:00
1.2 KiB
1.2 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| docs | Command: validate | docs-commands-validate | The `terraform validate` command is used to validate the syntax of the terraform files. |
Command: validate
The terraform validate command is used to validate the syntax of the terraform files.
Terraform performs a syntax check on all the terraform files in the directory,
and will display an error if any of the files doesn't validate.
This command does not check formatting (e.g. tabs vs spaces, newlines, comments etc.).
The following can be reported:
- invalid HCL syntax (e.g. missing trailing quote or equal sign)
- invalid HCL references (e.g. variable name or attribute which doesn't exist)
- same
providerdeclared multiple times - same
moduledeclared multiple times - same
resourcedeclared multiple times - invalid
modulename - interpolation used in places where it's unsupported
(e.g.
variable,depends_on,module.source,provider)
Usage
Usage: terraform validate [dir]
By default, validate requires no flags and looks in the current directory
for the configurations.