Bootstrap FreeKB - Terraform - Validate your Terraform syntax is correct using the terraform validate command
Terraform - Validate your Terraform syntax is correct using the terraform validate command

Updated:   |  Terraform articles

Let's say output.tf has the following. Notice in this example that "values" is used instead of "value". The correct key is "value", not "values".

output "example" {
  values = "hello world"
}

 

The terraform validate command can be used to know if you have any syntax errors.

]$ terraform validate
╷
│ Error: Missing required argument
│ 
│   on outputs.tf line 1, in output "example":
│    1: output "example" {
│ 
│ The argument "value" is required, but no definition was found.
╵
╷
│ Error: Unsupported argument
│ 
│   on outputs.tf line 2, in output "example":
│    2:   values = "hello world"
│ 
│ An argument named "values" is not expected here. Did you mean "value"?

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 94fdc2 in the box below so that we can be sure you are a human.