Skip to content

Commit

Permalink
loop on manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jan 14, 2025
1 parent ec24288 commit 0167dd2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions eks_console_access.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ locals {
},
]
cluster_roles_map = { for cr in local.cluster_roles : cr.name => cr if cr.enabled }
# roles = provider::kubernetes::manifest_decode_multi(data.http.cluster_roles[each.key].body)
}

# Fetch the YAML files from the specified URLs
Expand All @@ -45,11 +46,8 @@ data "http" "cluster_roles" {

# # Apply the Kubernetes manifests to the cluster
resource "kubernetes_manifest" "deploy_cluster_roles" {
for_each = { for k, v in local.cluster_roles_map : k => v if v.enabled }
manifest = {
name = data.http.cluster_roles[each.key]
value = provider::kubernetes::manifest_decode_multi(data.http.cluster_roles[each.key].body)
}
for_each = { for manifest in provider::kubernetes::manifest_decode_multi(data.http.cluster_roles[each.key].body) : "${lower(manifest.kind)}-${manifest.metadata.name}-${manifest.metadata.namespace}" => manifest }
manifest = each.value
# manifest = [split("---\n", data.http.cluster_roles[each.key].body)]
}

Expand Down

0 comments on commit 0167dd2

Please sign in to comment.