1.

Explain the command terraform validate in the context of Terraform.

Answer»

The terraform validate command verifies the configuration files in a directory, focusing solely on the configuration and excluding any outside services such as remote state, provider APIs, and so on. Validate performs checks to see if a configuration is syntactically correct and internally CONSISTENT, REGARDLESS of any variables or current state. As a result, it's best used for general verification of reusable modules, such as ensuring that attribute names and value types are correct. This command can be executed automatically, for example as a post-save check in a TEXT editor or as a test step for a reusable module in a continuous integration system.

Syntax: terraform validate [options]

The following options are available with this command:

  • -json - CREATE output in the machine-readable JSON format, appropriate for integration with text editors and other automated systems. Color is always turned off.
  • -no-color - If supplied, the output will be COLOURLESS.


Discussion

No Comment Found