fix: add ip address when manage_aws_auth is true and public_access is false (#745)

This commit is contained in:
slimm609
2020-03-19 11:22:22 -04:00
committed by GitHub
parent 0c23191cd3
commit 9951c87a86
3 changed files with 19 additions and 0 deletions

View File

@@ -45,6 +45,18 @@ resource "aws_eks_cluster" "this" {
]
}
resource "aws_security_group_rule" "cluster_private_access" {
count = var.create_eks && var.manage_aws_auth && var.cluster_endpoint_private_access && var.cluster_endpoint_public_access == false ? 1 : 0
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = var.cluster_endpoint_private_access_cidrs
security_group_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
}
resource "null_resource" "wait_for_cluster" {
count = var.create_eks && var.manage_aws_auth ? 1 : 0