-
Notifications
You must be signed in to change notification settings - Fork 30
Home
Laurent Nicolas edited this page Sep 15, 2022
·
6 revisions
Please see
- https://www.terraform.io/language/state/sensitive-data
- https://learn.hashicorp.com/tutorials/terraform/sensitive-variables
In a nutshell
- declare sensitive variables in a variable.tf files, and reference them in other resources files
- initialize the variables by using a
.tfvarsfile or by environment variables of the form:TF_VARS_<var_name>
For instance, in variables.tf
variable "cvo_admin_password" {
type = string
sensitive = true
}
and then
either
export TF_VAR_cvo_admin_password=my_password
or use a protected .tfvars file with
cvo_admin_password = "my_password"