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