Skip to content

Commit 130c1e1

Browse files
Include Materialize instance name in NLB details
1 parent ca960be commit 130c1e1

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ module "nlb" {
170170

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

173+
instance_name = each.value.name
173174
name_prefix = "${local.name_prefix}-${each.value.name}"
174175
namespace = each.value.namespace
175176
internal = each.value.internal_nlb

modules/nlb/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
output "instance_name" {
2+
description = "The name of the Materialize instance."
3+
value = var.instance_name
4+
}
5+
16
output "nlb_dns_name" {
27
description = "DNS name of the Network Load Balancer."
38
value = aws_lb.nlb.dns_name

modules/nlb/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
variable "instance_name" {
2+
description = "The name of the Materialize instance."
3+
type = string
4+
}
5+
16
variable "name_prefix" {
27
description = "Prefix to use for NLB, Target Groups, Listeners, and TargetGroupBindings"
38
type = string

outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ output "operator_details" {
8989

9090
output "nlb_details" {
9191
description = "Details of the Materialize instance NLBs."
92-
value = [
93-
for nlb in module.nlb : {
92+
value = {
93+
for nlb in module.nlb : nlb.instance_name => {
9494
arn = nlb.nlb_arn
9595
dns_name = nlb.nlb_dns_name
9696
}
97-
]
97+
}
9898
}

0 commit comments

Comments
 (0)