Editing Terraform variables

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
TOMERGE:  [[Terraform variables: variables.tf]]
+
 
* https://www.terraform.io/language/values/variables: <code>[[string]], number, [[bool]], any</code>
+
* https://www.terraform.io/language/values/variables
 
* [[Terraform Cloud]]: https://www.terraform.io/cloud-docs/workspaces/variables
 
* [[Terraform Cloud]]: https://www.terraform.io/cloud-docs/workspaces/variables
  
* Terraform variable definition: <code>[[Terraform variables: variables.tf|variables.tf]]</code>
 
  
== Examples ==
+
* <code>terraform apply [[-var]]="[[image_id]]=ami-abc123"</code>
Using command line parameters:
 
* <code>[[terraform apply]] [[-var]]="[[image_id]]=ami-abc123"</code>
 
 
* <code>terraform apply [[-var]]="[[image_id]]=ami-abc123 [[-var]]="your_second_var=yourvalue"</code>
 
* <code>terraform apply [[-var]]="[[image_id]]=ami-abc123 [[-var]]="your_second_var=yourvalue"</code>
 
Using a file:
 
 
* <code>terraform apply [[-var-file]]="your_file[[.tfvars]]"</code>
 
* <code>terraform apply [[-var-file]]="your_file[[.tfvars]]"</code>
 
== Errors ==
 
* <code>[[Error: Reference to undeclared input variable]]</code>
 
* <code>[[Error: Variables not allowed]]</code>
 
* <code>[[Error: Duplicate variable declaration]]</code>
 
* <code>[[Error: No value for required variable]]</code>
 
  
 
== Related ==
 
== Related ==
* [[Terraform variable types]]: <code>[[string]], [[number]], [[bool]], any</code>
 
* [[Terraform environment variables]]
 
* [[Terraform configuration variables]]
 
 
* [[Terraform: variables.tf]]
 
* [[Terraform: variables.tf]]
* <code>[[auto.tfvars]]</code>
+
* [[Variables]]
* <code>[[nullable]]</code> [[Terraform v1.1.0]] (Dec 2021)
+
* [[auto.tfvars]]
* <code>[[validation]]</code> block introduced in terraform CLI [[Terraform changelog|v0.13.0]] (August 2020)
 
* <code>[[Terraform: output|output]]</code>
 
* <code>[[-var-file]]</code>
 
* <code>[[locals]]: [[locals.tf]]</code>: https://www.terraform.io/language/values/locals
 
* [[Terragrunt: inputs:]]
 
* <code>[[TF_VAR_]]</code>
 
  
 
== See also ==
 
== See also ==
* {{Terraform variables}}
+
* {{Terraform}}
* {{Terraform types}}
 
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: