diff --git a/module.tf b/module.tf index 17070ec..be5dc16 100644 --- a/module.tf +++ b/module.tf @@ -25,7 +25,7 @@ variable "kubernetes" { value_from = optional(object({ secret_key_ref = object({ name = string - key = string + key = optional(string,null) }) })) # secret_name = optional(string) @@ -207,6 +207,7 @@ resource "kubernetes_deployment_v1" "automatic" { content { name = env.value.value_from.secret_key_ref.name key = env.value.value_from.secret_key_ref.key + optional = true } } } diff --git a/variables.auto.tfvars b/variables.auto.tfvars index bf19c15..84ac5b4 100644 --- a/variables.auto.tfvars +++ b/variables.auto.tfvars @@ -36,8 +36,8 @@ kubernetes = { MY_VAR = { value_from = { secret_key_ref = { - name = "my_secret" - key = "latest" + name = "mysecret" +# key = "latest" } } }