forked from cktf/terraform-hcloud-rke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirewall.tf
38 lines (35 loc) · 864 Bytes
/
firewall.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
resource "hcloud_firewall" "this" {
name = var.name
rule {
protocol = "icmp"
direction = "out"
destination_ips = ["0.0.0.0/0", "::/0"]
description = "ICMP Internet Traffic"
}
rule {
port = "any"
protocol = "tcp"
direction = "out"
destination_ips = ["0.0.0.0/0", "::/0"]
description = "TCP Internet Traffic"
}
rule {
port = "any"
protocol = "udp"
direction = "out"
destination_ips = ["0.0.0.0/0", "::/0"]
description = "UDP Internet Traffic"
}
dynamic "apply_to" {
for_each = var.masters
content {
server = hcloud_server.this[apply_to.key].id
}
}
dynamic "apply_to" {
for_each = var.node_pools
content {
label_selector = "hcloud/node-group=${var.name}-${apply_to.key}"
}
}
}