Przeglądaj źródła

Reverts Splunk Indexer NLB to be 3 AZs

Cross-zone load balancing should fix the timeout issue while keeping the
flexibility of not having to update outputs.conf on the systems.

To be tagged v5.4.2
Fred Damstra [afs macbook] 2 lat temu
rodzic
commit
853fcc2ef5

+ 13 - 7
base/splunk_servers/indexer_cluster/nlb-splunk-data.tf

@@ -28,13 +28,19 @@ resource "aws_lb" "nlb" {
   #subnets            = data.terraform_remote_state.infra.public_subnets
   enable_cross_zone_load_balancing = true
 
-  dynamic "subnet_mapping" {
-    # create a subnet endpoint for each subnet where there's an asg group
-    for_each = [for n in local.splunk_asg_sizes : "yes" if n > 0]
-    content {
-      subnet_id     = element(var.public_subnets, subnet_mapping.key) # subnet_mapping.key is the index of the list
-      allocation_id = element(aws_eip.nlb.*.id, subnet_mapping.key)
-    }
+  subnet_mapping {
+    subnet_id     = element(var.public_subnets, 0)
+    allocation_id = element(aws_eip.nlb.*.id, 0)
+  }
+
+  subnet_mapping {
+    subnet_id     = element(var.public_subnets, 1)
+    allocation_id = element(aws_eip.nlb.*.id, 1)
+  }
+
+  subnet_mapping {
+    subnet_id     = element(var.public_subnets, 2)
+    allocation_id = element(aws_eip.nlb.*.id, 2)
   }
 
   access_logs {