diff --git a/k8s_addons.tf b/k8s_addons.tf index 48fcfb0..53ab26f 100644 --- a/k8s_addons.tf +++ b/k8s_addons.tf @@ -2,7 +2,7 @@ module "ingress_nginx" { source = "./modules/eks_addons" enable_ingress_nginx = var.ingress_nginx_config.enable - helm_config = { + ingress_nginx_helm_config = { namespace = "nginx" name = "ingress-nginx" chart = "ingress-nginx" diff --git a/modules/eks_addons/ingress_nginx.tf b/modules/eks_addons/ingress_nginx.tf index 4fb9520..60f2dfc 100644 --- a/modules/eks_addons/ingress_nginx.tf +++ b/modules/eks_addons/ingress_nginx.tf @@ -1,22 +1,22 @@ resource "kubernetes_namespace_v1" "this" { - count = try(var.helm_config.create_namespace, true) && var.helm_config.namespace != "kube-system" && var.enable_ingress_nginx ? 1 : 0 + count = try(var.ingress_nginx_helm_config.create_namespace, true) && var.ingress_nginx_helm_config.namespace != "kube-system" && var.enable_ingress_nginx ? 1 : 0 metadata { - name = var.helm_config.namespace + name = var.ingress_nginx_helm_config.namespace } } resource "helm_release" "ingress_nginx" { count = var.enable_ingress_nginx ? 1 : 0 - namespace = var.helm_config.namespace - name = var.helm_config.name - chart = var.helm_config.chart - repository = var.helm_config.repository - version = var.helm_config.version - description = var.helm_config.description - create_namespace = var.helm_config.create_namespace - dependency_update = var.helm_config.dependency_update - values = var.helm_config.values + namespace = var.ingress_nginx_helm_config.namespace + name = var.ingress_nginx_helm_config.name + chart = var.ingress_nginx_helm_config.chart + repository = var.ingress_nginx_helm_config.repository + version = var.ingress_nginx_helm_config.version + description = var.ingress_nginx_helm_config.description + create_namespace = var.ingress_nginx_helm_config.create_namespace + dependency_update = var.ingress_nginx_helm_config.dependency_update + values = var.ingress_nginx_helm_config.values timeout = 1200 } diff --git a/modules/eks_addons/variables.tf b/modules/eks_addons/variables.tf index 832dc81..05c0321 100644 --- a/modules/eks_addons/variables.tf +++ b/modules/eks_addons/variables.tf @@ -1,5 +1,5 @@ -variable "helm_config" { - description = "Helm Configuration" +variable "ingress_nginx_helm_config" { + description = "Helm Configuration for Ingress Nginx" type = any default = {} }