Difference between revisions of "Terraform variables"
Jump to navigation
Jump to search
Line 21: | Line 21: | ||
* [[Terraform variable types]]: <code>[[string]], [[number]], [[bool]], any</code> | * [[Terraform variable types]]: <code>[[string]], [[number]], [[bool]], any</code> | ||
* [[Terraform environment variables]] | * [[Terraform environment variables]] | ||
+ | * [[Terraform configuration variables]] | ||
* [[Terraform: variables.tf]] | * [[Terraform: variables.tf]] | ||
* <code>[[auto.tfvars]]</code> | * <code>[[auto.tfvars]]</code> |
Revision as of 16:21, 4 April 2023
TOMERGE: Terraform variables: variables.tf
- https://www.terraform.io/language/values/variables:
string, number, bool, any
- Terraform Cloud: https://www.terraform.io/cloud-docs/workspaces/variables
- Terraform variable definition:
variables.tf
Contents
Examples
Using command line parameters:
terraform apply -var="image_id=ami-abc123"
terraform apply -var="image_id=ami-abc123 -var="your_second_var=yourvalue"
Using a file:
Errors
Error: Reference to undeclared input variable
- Error: Variables not allowed
- Error: Duplicate variable declaration
Related
- Terraform variable types:
string, number, bool, any
- Terraform environment variables
- Terraform configuration variables
- Terraform: variables.tf
auto.tfvars
nullable
Terraform v1.1.0 (Dec 2021)validation
block introduced in terraform CLI v0.13.0 (August 2020)output
-var-file
locals
: https://www.terraform.io/language/values/locals- Terragrunt: inputs:
TF_VAR_
See also
Advertising: