mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-04-17 22:39:37 +02:00
feat: Create SG rule for each new cluster_endpoint_private_access_cidr block (#1549)
This commit is contained in:
@@ -91,13 +91,13 @@ resource "aws_security_group_rule" "cluster_https_worker_ingress" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "cluster_private_access_cidrs_source" {
|
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."
|
description = "Allow private K8S API ingress from custom CIDR source."
|
||||||
type = "ingress"
|
type = "ingress"
|
||||||
from_port = 443
|
from_port = 443
|
||||||
to_port = 443
|
to_port = 443
|
||||||
protocol = "tcp"
|
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
|
security_group_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user