소스 검색

Merge pull request #518 from mdr-engineering/feature/ftd_MSOCI-2340_RevertSplunkDataNLB

Reverts Splunk Indexer NLB to be 3 AZs
Frederick Damstra 2 년 전
부모
커밋
0c74bb950d
1개의 변경된 파일13개의 추가작업 그리고 7개의 파일을 삭제
  1. 13 7
      base/splunk_servers/indexer_cluster/nlb-splunk-data.tf

+ 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 {