diff --git a/outputs.tf b/outputs.tf index d1bdf09..66153a0 100644 --- a/outputs.tf +++ b/outputs.tf @@ -29,10 +29,10 @@ locals { database_secrets_map = { for p in var.drupal_projects_list : "${p.project_name}-${p.gitlab_project_id}-${p.release_branch_name}" => { secret_name = try( - kubernetes_secret.database_secret_name["${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp"].metadata[0].name, + kubernetes_secret.database_secret_name[replace("${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp", "-", "_")].metadata[0].name, null) namespace = try( - kubernetes_secret.database_secret_name["${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp"].metadata[0].namespace, + kubernetes_secret.database_secret_name[replace("${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp", "-", "_")].metadata[0].namespace, null ) }