From ca7b13d78c4d38f4ba65866f484fc3be394292fe Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:52:26 -0700 Subject: [PATCH] Try handling dependency with depends_on --- deployments/spacelift/dpe-k8s/main.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deployments/spacelift/dpe-k8s/main.tf b/deployments/spacelift/dpe-k8s/main.tf index 19810a54..cdd6ba50 100644 --- a/deployments/spacelift/dpe-k8s/main.tf +++ b/deployments/spacelift/dpe-k8s/main.tf @@ -259,7 +259,11 @@ resource "spacelift_stack_destructor" "auth0-stack-destructor" { resource "spacelift_environment_variable" "auth0-stack-environment-variables" { - for_each = var.deploy_auth0 ? local.auth0_stack_variables : tomap({}) + depends_on = [ + spacelift_stack.auth0 + ] + + for_each = local.auth0_stack_variables stack_id = spacelift_stack.auth0[0].id name = "TF_VAR_${each.key}"