-
Notifications
You must be signed in to change notification settings - Fork 0
/
security_groups.tf
59 lines (50 loc) · 1.84 KB
/
security_groups.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
51
52
53
54
55
56
57
58
59
resource "scaleway_security_group" "node_sec_group" {
name = "${terraform.workspace}-node"
description = "Kubernetes nodes for ${terraform.workspace} created by Terraform"
stateful = true
inbound_default_policy = "drop"
outbound_default_policy = "accept"
}
resource "scaleway_security_group_rule" "ssh_allow_node" {
count = "${length(var.ssh_ip)}"
security_group = "${scaleway_security_group.node_sec_group.id}"
action = "accept"
direction = "inbound"
ip_range = "${element(var.ssh_ip, count.index)}"
protocol = "TCP"
port = 22
}
resource "scaleway_security_group" "master_sec_group" {
name = "${terraform.workspace}-master"
description = "Kubernetes master for ${terraform.workspace} created by Terraform"
stateful = true
inbound_default_policy = "drop"
outbound_default_policy = "accept"
}
resource "scaleway_security_group_rule" "ssh_allow_master" {
count = "${length(var.ssh_ip)}"
security_group = "${scaleway_security_group.master_sec_group.id}"
action = "accept"
direction = "inbound"
ip_range = "${element(var.ssh_ip, count.index)}"
protocol = "TCP"
port = 22
}
resource "scaleway_security_group_rule" "management_master" {
count = "${length(var.ssh_ip)}"
security_group = "${scaleway_security_group.master_sec_group.id}"
action = "accept"
direction = "inbound"
ip_range = "${element(var.ssh_ip, count.index)}"
protocol = "TCP"
port = 6443
}
resource "scaleway_security_group_rule" "dashboard_master" {
count = "${length(var.ssh_ip)}"
security_group = "${scaleway_security_group.master_sec_group.id}"
action = "accept"
direction = "inbound"
ip_range = "${element(var.ssh_ip, count.index)}"
protocol = "TCP"
port = 8888
}