Files
engine/lib/aws/bootstrap/eks-master-sec-group.tf
Romaric Philogene 5fab0ae0fc wip: change eks_cluster_id into kubernetes_cluster_id
wip: change `eks_cluster_name` into `kubernetes_cluster_name`
2020-12-24 00:39:59 +01:00

28 lines
936 B
HCL

resource "aws_security_group" "eks_cluster" {
name = "qovery-eks-${var.kubernetes_cluster_id}"
description = "Cluster communication with worker nodes"
vpc_id = aws_vpc.eks.id
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = local.tags_eks
}
# OPTIONAL: Allow inbound traffic from your local workstation external IP
# to the Kubernetes. You will need to replace A.B.C.D below with
# your real IP. Services like icanhazip.com can help you find this.
resource "aws_security_group_rule" "cluster_ingress_workstation_https" {
cidr_blocks = var.eks_access_cidr_blocks
description = "Allow workstation to communicate with the cluster API Server"
from_port = 443
protocol = "tcp"
security_group_id = aws_security_group.eks_cluster.id
to_port = 443
type = "ingress"
}