-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecurity.tf
50 lines (44 loc) · 1.21 KB
/
security.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
resource "aws_security_group" "kubernetes_sg" {
name = "kubernetes_sg"
vpc_id = aws_vpc.k8s_env_vpc.id
ingress {
description = "SSH access from dev env for ansible"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.outbound_ip.response_body)}/32"]
}
ingress {
description = "https access from dev env to k8s control plane"
from_port = 6443
to_port = 6443
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.outbound_ip.response_body)}/32"]
}
ingress {
description = "http access from dev env, to connect to k8s service"
from_port = 30004
to_port = 30005
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.outbound_ip.response_body)}/32"]
}
ingress {
description = "No restrictions on traffic inside the VPC"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["${var.base_cidr_block}"]
}
egress {
description = "No restrictions on outbound traffic"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
"Name" = "kubernetes_sg"
"Creator" = var.creator
"Terraform" = true
}
}