terraform.tfvar
certconfig = {
"cert1" = {
name = "validcert3"
certificatename = {
"app1" = {
contents = "C:/Users/adminuser/Desktop/Appgateway_stg_https/modules/az_keyvault_appgw_policy/certificate/certificate.pfx"
# password = "Plants@12345"
}
}
},
"cert2" = {
name = "validcert4"
certificatename = {
"app2" = {
contents = "C:/Users/adminuser/Desktop/Appgateway_stg_https/modules/az_keyvault_appgw_policy/certificate/certificate2.pfx"
# password = "Plants@12345"
}
}
variables.tf
variable "appgw_pid" {
type = any
default = ""
}
variable "appgw_key_perm" {
type = string
default = ""
}
variable "appgw_cert_perm" {
type = list(string)
default = [""]
}
variable "appgw_secret_perm" {
type = string
default = ""
}
variable "appgw_storage_perm" {
type = string
default = ""
}
variable "tenant_id" {
type = any
default = ""
}
variable "keyvault_id" {
type = any
default = ""
}
# variable "password" {
# default = ""
# type = string
# sensitive = true
# }
variable "certconfig" {
type = map(object({
name = string
# key_vault_id = any
certificate = optional(bool,true)
certificatename = optional(map(object({
contents = any
password = optional(any, null)
})))
}))
}
I want to parse it the password through environment variable like this:
$env:TF_VAR_certconfig_cert2_certificatename_app2 = '{"password":"Plants@12345"}'
but not able to read the password.plz help
Show quoted text