Skip to content

Commit

Permalink
Pass in vpc id and region to aws load balancer module
Browse files Browse the repository at this point in the history
  • Loading branch information
OlamideOl1 committed Sep 9, 2024
1 parent f7c7f6c commit db7387d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions aws/platform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down
4 changes: 4 additions & 0 deletions aws/platform/modules/load-balancer-controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand All @@ -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
})
]
}
5 changes: 5 additions & 0 deletions aws/platform/modules/load-balancer-controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}

0 comments on commit db7387d

Please sign in to comment.