From 380cca4a1971db7848515f2de902c58ef2d5abe6 Mon Sep 17 00:00:00 2001 From: Giuseppe Iannelli <94362884+g-iannelli@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:25:47 +0200 Subject: [PATCH] fix(module,eks): missing nodepool additional-firewall-rules (#69) --- modules/eks/ec2.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/eks/ec2.tf b/modules/eks/ec2.tf index f3ddd60..404be24 100644 --- a/modules/eks/ec2.tf +++ b/modules/eks/ec2.tf @@ -77,7 +77,7 @@ locals { additional_firewall_rules_cidr_blocks = flatten([ for nodePool in var.node_pools : [ - for rule in coalesce(lookup(local.additional_firewall_rules, "cidr_blocks", null), []) : { + for rule in coalesce(lookup(lookup(local.additional_firewall_rules, nodePool.name, {}), "cidr_blocks", null), []) : { description = lookup(rule, "description") security_group_id = aws_security_group.node_pool[nodePool["name"]].id type = lookup(rule, "type") @@ -91,7 +91,7 @@ locals { additional_firewall_rules_source_security_group_id = flatten([ for nodePool in var.node_pools : [ - for rule in coalesce(lookup(local.additional_firewall_rules, "source_security_group_id", null), []) : { + for rule in coalesce(lookup(lookup(local.additional_firewall_rules, nodePool.name, {}), "source_security_group_id", null), []) : { description = lookup(rule, "description") security_group_id = aws_security_group.node_pool[nodePool["name"]].id type = lookup(rule, "type") @@ -105,8 +105,8 @@ locals { additional_firewall_rules_self = flatten([ for nodePool in var.node_pools : [ - for rule in coalesce(lookup(local.additional_firewall_rules, "self", null), []) : { - description = lookup(rule, "description") + for rule in coalesce(lookup(lookup(local.additional_firewall_rules, nodePool.name, {}), "self", null), []) : { + description = lookup(rule, "description") security_group_id = aws_security_group.node_pool[nodePool["name"]].id type = lookup(rule, "type") from_port = lookup(rule, "from_port")