Skip to content

Commit

Permalink
start over
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jan 13, 2025
1 parent 07a749f commit 80c4f2f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions eks_console_access.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

0 comments on commit 80c4f2f

Please sign in to comment.