diff --git a/aws/platform/main.tf b/aws/platform/main.tf index ea4ccce0..74b8c619 100644 --- a/aws/platform/main.tf +++ b/aws/platform/main.tf @@ -77,6 +77,7 @@ module "aws_load_balancer_controller" { k8s_namespace = var.k8s_namespace oidc_issuer = data.aws_ssm_parameter.oidc_issuer.value vpc_cidr_block = module.network.vpc.cidr_block + vpc_id = module.network.vpc.id depends_on = [module.common_platform] } diff --git a/aws/platform/modules/load-balancer-controller/main.tf b/aws/platform/modules/load-balancer-controller/main.tf index 77b69937..a337b4d5 100644 --- a/aws/platform/modules/load-balancer-controller/main.tf +++ b/aws/platform/modules/load-balancer-controller/main.tf @@ -76,6 +76,8 @@ resource "aws_iam_role_policy_attachment" "this" { policy_arn = aws_iam_policy.this.arn } +data "aws_region" "current" {} + locals { chart_defaults = jsondecode(file("${path.module}/chart.json")) @@ -90,6 +92,8 @@ locals { "eks.amazonaws.com/role-arn" = module.service_account_role.arn } } + region = data.aws_region.current.name + vpcId = var.vpc_id }) ] } diff --git a/aws/platform/modules/load-balancer-controller/variables.tf b/aws/platform/modules/load-balancer-controller/variables.tf index 2a6e9402..ecb824f2 100644 --- a/aws/platform/modules/load-balancer-controller/variables.tf +++ b/aws/platform/modules/load-balancer-controller/variables.tf @@ -66,3 +66,8 @@ variable "vpc_cidr_block" { type = string description = "CIDR block for the AWS VPC in which the load balancer runs" } + +variable "vpc_id" { + type = string + description = "The VPC ID for the Kubernetes cluster." +}