Skip to content

Commit 0421077

Browse files
committed
Add global name prefix to the individual NLB AWS resource
1 parent 2f3a65d commit 0421077

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module "aws_lbc" {
4646
source = "./modules/aws-lbc"
4747
count = var.install_aws_load_balancer_controller ? 1 : 0
4848

49-
name_prefix = "${var.namespace}-${var.environment}"
49+
name_prefix = local.name_prefix
5050
eks_cluster_name = module.eks.cluster_name
5151
oidc_provider_arn = module.eks.oidc_provider_arn
5252
oidc_issuer_url = module.eks.cluster_oidc_issuer_url
@@ -139,7 +139,7 @@ module "nlb" {
139139

140140
for_each = { for idx, instance in local.instances : instance.name => instance if lookup(instance, "create_nlb", true) }
141141

142-
name_prefix = each.value.name
142+
name_prefix = "${local.name_prefix}-${each.value.name}"
143143
namespace = each.value.namespace
144144
internal = each.value.internal_nlb
145145
subnet_ids = each.value.internal_nlb ? local.network_private_subnet_ids : local.network_public_subnet_ids

0 commit comments

Comments
 (0)