Skip to content

Commit

Permalink
use cr_url directly
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jan 13, 2025
1 parent 0393d71 commit 6500632
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 49 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions eks_console_access.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
24 changes: 0 additions & 24 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
# }
18 changes: 0 additions & 18 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
# }

0 comments on commit 6500632

Please sign in to comment.