Difference between revisions of "Terraform validate"

From wikieduonline
Jump to navigation Jump to search
 
(24 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
<code>[[terraform]] validate</code>
+
<code>[[terraform]] validate</code> <ref>https://www.terraform.io/docs/cli/commands/validate.html</ref> validates the configuration files in a directory.
* https://www.terraform.io/docs/cli/commands/validate.html
+
 
 +
* <code>terraform validate</code>
 +
* <code>terraform validate && [[terraform plan]]</code>
 +
 
 +
<code>terraform validate</code> requires an initialized working directory with any referenced plugins and modules installed. Execute: <code>[[terraform init -backend=false]]</code>
  
 
== Example ==
 
== Example ==
Line 7: Line 11:
 
  Success! The configuration is valid.
 
  Success! The configuration is valid.
  
 +
== Examples with errors ==
 +
* <code>[[Error: Could not load plugin]]</code>
 +
* <code>[[Error: Unsupported argument ... An argument named "XXX" is not expected here.]]</code>
  
  terraform validate
+
== Related ==
+
* <code>[[terraform init -backend=false]]</code>
│ Error: Could not load plugin
+
* <code>[[terraform fmt]]</code>
+
* <code>[[terraform fmt -check]]</code>
 
│ Plugin reinitialization required. Please run "[[terraform init]]".
 
 
│ Plugins are external binaries that Terraform uses to access and manipulate
 
│ resources. The configuration provided requires plugins which can't be
 
│ located,
 
│ don't satisfy the version constraints, or are otherwise incompatible.
 
 
│ Terraform automatically discovers provider requirements from your
 
│ configuration, including providers used in child modules. To see the
 
│ requirements and constraints, run "terraform providers".
 
 
│ failed to instantiate provider "registry.terraform.io/hashicorp/aws" to
 
│ obtain schema: unknown provider "registry.terraform.io/hashicorp/aws"
 
 
 
 
 
== Related commands ==
 
* <code>[[terraform fmt]] -check</code>
 
 
* <code>[[terraform plan]]</code>
 
* <code>[[terraform plan]]</code>
 
* <code>[[terraform state]]</code>, <code>[[terraform state show]]</code>
 
* <code>[[terraform state]]</code>, <code>[[terraform state show]]</code>
* <code>[[terraform fmt]]</code>
 
 
* [[Test mode]]
 
* [[Test mode]]
 +
* <code>[[aws cloudformation validate-template]]</code>
 +
* K8s [[datree]] [[plugin]]
 +
* <code>[[terragrunt validate]]</code>
 +
* <code>[[tflint]]</code>
 +
* <code>[[.pre-commit-config.yaml]]</code>
  
 
== See also ==
 
== See also ==
* {{terraform cmd}}
+
* {{tf fmt}}
* {{terraform}}
 
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Latest revision as of 10:45, 29 February 2024

terraform validate [1] validates the configuration files in a directory.

terraform validate requires an initialized working directory with any referenced plugins and modules installed. Execute: terraform init -backend=false

Example[edit]

terraform validate
Success! The configuration is valid.

Examples with errors[edit]

Related[edit]

See also[edit]

  • https://www.terraform.io/docs/cli/commands/validate.html
  • Advertising: