## Terraform的变量 ## 1. 官方文档: terraform 加载变量按照以下的顺序 1. terraform.tfvars 2. terraform.tfvars.json 3. *.auto.tfvars or *.auto.tfvars.json 4. any -var and -var-file options on the command line, in the order they are provided. Terraform loads variables in the following order, with later sources taking precedence over earlier ones: Environment variables The terraform.tfvars file, if present. The terraform.tfvars.json file, if present. Any *.auto.tfvars or *.auto.tfvars.json files, processed in lexical order of their filenames. Any -var and -var-file options on the command line, in the order they are provided. (This includes variables set by a Terraform Cloud workspace.) 2. 三种变量的区别 Input variables are like function arguments. Output values are like function return values. Local values are like a function's temporary local variables.