-
Notifications
You must be signed in to change notification settings - Fork 19
/
firewall.tf
53 lines (44 loc) · 1.34 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
resource "digitalocean_firewall" "ccm_firewall" {
name = "ccm-firewall"
outbound_rule {
protocol = "icmp"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
}
resource "digitalocean_firewall" "k3s_firewall" {
name = "k3s-firewall"
tags = [digitalocean_tag.server.name, digitalocean_tag.agent.name]
inbound_rule {
# Allow ICMP communication on all ports to defined 'tags' via VPC Network
protocol = "icmp"
source_addresses = [var.vpc_network_range]
}
inbound_rule {
# Allow TCP communication on all ports to defined 'tags' via VPC Network
protocol = "tcp"
port_range = "1-65535"
source_addresses = [var.vpc_network_range]
}
inbound_rule {
# Allow UDP communication on all ports to defined 'tags' via VPC Network
protocol = "udp"
port_range = "1-65535"
source_addresses = [var.vpc_network_range]
}
inbound_rule {
# Allow SSH access from all hosts
protocol = "tcp"
port_range = "22"
source_addresses = ["0.0.0.0/0", "::/0"]
}
outbound_rule {
protocol = "udp"
port_range = "1-65535"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
outbound_rule {
protocol = "tcp"
port_range = "1-65535"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
}