Skip to content

Instantly share code, notes, and snippets.

@voronenko-p
Created July 13, 2018 12:57
Show Gist options
  • Select an option

  • Save voronenko-p/ff26330f78e0ed2cf3d7d6d81923485e to your computer and use it in GitHub Desktop.

Select an option

Save voronenko-p/ff26330f78e0ed2cf3d7d6d81923485e to your computer and use it in GitHub Desktop.
//EKS Master Cluster Security Group
//This security group controls networking access to the Kubernetes masters.
//Needs to be configured also with an ingress rule to allow traffic from the worker nodes.
resource "aws_security_group" "eks-control-plane-sg" {
name = "${local.env}-control-plane"
description = "Cluster communication with worker nodes [${local.env}]"
vpc_id = "${aws_vpc.cluster.id}"
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
# 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" "eks-ingress-workstation-https" {
// cidr_blocks = ["A.B.C.D/32"]
// description = "Allow workstation to communicate with the cluster API Server"
// from_port = 443
// protocol = "tcp"
// security_group_id = "${aws_security_group.eks-control-plane-sg.id}"
// to_port = 443
// type = "ingress"
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment