Skip to content

Commit

Permalink
feat: Create SG rule for each new cluster_endpoint_private_access_cid…
Browse files Browse the repository at this point in the history
…r block (#1549)
  • Loading branch information
lisfo4ka authored Sep 6, 2021
1 parent d1d135b commit 7109031
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ resource "aws_security_group_rule" "cluster_https_worker_ingress" {
}

resource "aws_security_group_rule" "cluster_private_access_cidrs_source" {
count = var.create_eks && var.cluster_create_endpoint_private_access_sg_rule && var.cluster_endpoint_private_access && var.cluster_endpoint_private_access_cidrs != null ? 1 : 0
for_each = var.create_eks && var.cluster_create_endpoint_private_access_sg_rule && var.cluster_endpoint_private_access && var.cluster_endpoint_private_access_cidrs != null ? toset(var.cluster_endpoint_private_access_cidrs) : []
description = "Allow private K8S API ingress from custom CIDR source."
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = var.cluster_endpoint_private_access_cidrs
cidr_blocks = [each.value]

security_group_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
}
Expand Down

0 comments on commit 7109031

Please sign in to comment.