From 80c4f2f81163b22bc41834dd61f27d57d767c09f Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Mon, 13 Jan 2025 16:11:58 -0500 Subject: [PATCH] start over --- eks_console_access.tf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eks_console_access.tf b/eks_console_access.tf index efb64d3..eebb559 100644 --- a/eks_console_access.tf +++ b/eks_console_access.tf @@ -24,8 +24,7 @@ locals { enabled = false }, ] - cluster_roles_map = { for cr in local.cluster_roles : cr.name => cr if cr.enabled } - all_access_documents = flatten([for name, cr in local.cluster_roles_map : [yamldecode(data.http.cluster_roles[name].body)]]) + cluster_roles_map = { for cr in local.cluster_roles : cr.name => cr if cr.enabled } } # Fetch the YAML files from the specified URLs @@ -36,6 +35,6 @@ data "http" "cluster_roles" { # Apply the Kubernetes manifests to the cluster resource "kubernetes_manifest" "deploy_cluster_roles" { - for_each = { for idx, doc in local.all_access_documents : idx => doc } - manifest = each.value + for_each = local.cluster_roles_map + manifest = data.http.cluster_roles[each.key].body }