github.com/paybyphone/terraform@v0.9.5-0.20170613192930-9706042ddd51/website/docs/commands/validate.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Command: validate" 4 sidebar_current: "docs-commands-validate" 5 description: |- 6 The `terraform validate` command is used to validate the syntax of the terraform files. 7 --- 8 9 # Command: validate 10 11 The `terraform validate` command is used to validate the syntax of the terraform files. 12 Terraform performs a syntax check on all the terraform files in the directory, 13 and will display an error if any of the files doesn't validate. 14 15 This command **does not** check formatting (e.g. tabs vs spaces, newlines, comments etc.). 16 17 The following can be reported: 18 19 * invalid [HCL](https://github.com/hashicorp/hcl) syntax (e.g. missing trailing quote or equal sign) 20 * invalid HCL references (e.g. variable name or attribute which doesn't exist) 21 * same `provider` declared multiple times 22 * same `module` declared multiple times 23 * same `resource` declared multiple times 24 * invalid `module` name 25 * interpolation used in places where it's unsupported 26 (e.g. `variable`, `depends_on`, `module.source`, `provider`) 27 28 ## Usage 29 30 Usage: `terraform validate [dir]` 31 32 By default, `validate` requires no flags and looks in the current directory 33 for the configurations.