From 65006328dd8ddd4be7b438270ae8912e0057a857 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Mon, 13 Jan 2025 15:35:50 -0500 Subject: [PATCH] use cr_url directly --- README.md | 6 +----- eks_console_access.tf | 6 ++++-- outputs.tf | 24 ------------------------ variables.tf | 18 ------------------ 4 files changed, 5 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index db8db8f..4b6bd84 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,8 @@ The module configures an eks cluster with additional components after the cluste A successful apply will yield: Apply complete! Resources: 14 added, 0 changed, 0 destroyed. Outputs: -kubectl_image_full_path = "224384469011.dkr.ecr.us-gov-east-1.amazonaws.com/platform-eng-eks-mcm/kubectl:1.27.14" -kubectl_image_registry = "224384469011.dkr.ecr.us-gov-east-1.amazonaws.com" -kubectl_image_repository = "platform-eng-eks-mcm/kubectl" -kubectl_image_tag = "1.27.14" module_name = "tfmod-eks-configuration" -module_version = "0.0.2" +module_version = "0.1.1" rwo_storage_class = "gp3-encrypted" rwx_storage_class = "efs" real 2m4.048s diff --git a/eks_console_access.tf b/eks_console_access.tf index 4419c97..d39c38b 100644 --- a/eks_console_access.tf +++ b/eks_console_access.tf @@ -25,15 +25,17 @@ locals { }, ] cluster_roles_map = { for cr in local.cluster_roles : cr.name => cr if cr.enabled } - all_access_documents = flatten([for cr_name, cr_data in local.cluster_roles_map : [yamldecode(data.http.cluster_roles[cr_name].body)] if cr_data.enabled]) + all_access_documents = flatten([for cr_name, cr_url in local.cluster_roles_map : [yamldecode(data.http.cluster_roles[cr_url])] if cr_data.enabled]) } # Fetch the YAML files from the specified URLs data "http" "cluster_roles" { for_each = local.cluster_roles_map - url = each.value.url + + 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 } diff --git a/outputs.tf b/outputs.tf index e221d4e..d5e5656 100644 --- a/outputs.tf +++ b/outputs.tf @@ -25,27 +25,3 @@ output "rwx_storage_class" { description = "Kubernetes storage class that supports read/write many." value = kubernetes_storage_class.efs_sc.metadata[0].name } - -# ################################################################################ -# # Details about kubectl image -# ################################################################################ - -# output "kubectl_image_full_path" { -# description = "The full URI to access the kubectl image including the registry/repository:tag" -# value = module.images.images[local.kubectl_key].dest_full_path -# } - -# output "kubectl_image_registry" { -# description = "The registry portion of the URI to access the kubectl image" -# value = module.images.images[local.kubectl_key].dest_registry -# } - -# output "kubectl_image_repository" { -# description = "The repository portion of the URI to access the kubectl image" -# value = module.images.images[local.kubectl_key].dest_repository -# } - -# output "kubectl_image_tag" { -# description = "The tag portion of the URI to access the kubectl image" -# value = module.images.images[local.kubectl_key].tag -# } diff --git a/variables.tf b/variables.tf index c2d1be1..4f4ada5 100644 --- a/variables.tf +++ b/variables.tf @@ -24,18 +24,6 @@ variable "security_group_all_worker_mgmt_id" { type = string } -# # tflint-ignore: terraform_unused_declarations -# variable "eks_managed_node_groups_autoscaling_group_names" { -# description = "List of the autoscaling group names created by EKS managed node groups" -# type = list(string) -# } - -# # tflint-ignore: terraform_unused_declarations -# variable "oidc_provider_arn" { -# description = "The ARN of the OIDC Provider if `enable_irsa = true`" -# type = string -# } - variable "operators_ns" { description = "Namespace to create where operators will be installed." type = string @@ -53,9 +41,3 @@ variable "tags" { type = map(string) default = {} } - -# variable "kubectl_image_tag" { -# description = "The version of bitnami/kubectl image to use." -# type = string -# default = "1.30.4" -# }