docs: Clarify use cases in docs for the validate cmd

This commit is contained in:
Radek Simko 2016-02-08 12:36:10 +00:00
parent e968bfd55e
commit 7fed07a0a2
1 changed files with 14 additions and 9 deletions

View File

@ -3,22 +3,27 @@ layout: "docs"
page_title: "Command: validate" page_title: "Command: validate"
sidebar_current: "docs-commands-validate" sidebar_current: "docs-commands-validate"
description: |- description: |-
The `terraform validate` command is used to validate the format and structure of the terraform files. The `terraform validate` command is used to validate the syntax of the terraform files.
--- ---
# Command: verify # Command: validate
The `terraform validate` command is used to validate the syntax of the terraform files. 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 the file(s) Terraform performs a syntax check on all the terraform files in the directory,
doesn't validate. and will display an error if any of the files doesn't validate.
These errors include: This command **does not** check formatting (e.g. tabs vs spaces, newlines, comments etc.).
* Interpolation in variable values, depends_on, module source etc. The following can be reported:
* Duplicate names in resource, modules and providers. * invalid [HCL](https://github.com/hashicorp/hcl) syntax (e.g. missing trailing quote or equal sign)
* invalid HCL references (e.g. variable name or attribute which doesn't exist)
* Missing variable values. * same `provider` declared multiple times
* same `module` declared multiple times
* same `resource` declared multiple times
* invalid `module` name
* interpolation used in places where it's unsupported
(e.g. `variable`, `depends_on`, `module.source`, `provider`)
## Usage ## Usage