From 44b85856e07d7352883a9d43926d9379551ee39d Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 18 Nov 2024 17:57:22 +0000 Subject: [PATCH] try to make the key optional as we might sometime use the full secret but for now it's not working --- module.tf | 3 ++- variables.auto.tfvars | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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" } } }