Skip to content

Commit

Permalink
use url via map v2
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jan 13, 2025
1 parent 0c26103 commit b831a3f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions eks_console_access.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ locals {
},
]
cluster_roles_map = { for cr in local.cluster_roles : cr.name => cr if cr.enabled }
all_access_documents = flatten([for name, url in local.cluster_roles : [yamldecode(data.http.cluster_roles[name].body)]])
all_access_documents = flatten([for name, url in local.cluster_roles_map : [yamldecode(data.http.cluster_roles[name].body)]])
}

# Fetch the YAML files from the specified URLs
Expand All @@ -34,10 +34,8 @@ data "http" "cluster_roles" {
url = each.value.url
}


# 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
}

0 comments on commit b831a3f

Please sign in to comment.