terraform validate

The command that checks a configuration is internally consistent, such as correct syntax, types and references, without contacting any real infrastructure.

In more detail

It needs providers to be installed, so run terraform init first; otherwise it tells you to. It cannot tell whether a cloud will accept a value, only whether the configuration makes sense. Pipelines run it after formatting and before planning.

Example

terraform init -backend=false && terraform validate

Related terms

Taught in

References

Certification courses