-
Notifications
You must be signed in to change notification settings - Fork 2
/
firewalls.tf
53 lines (45 loc) · 1.34 KB
/
firewalls.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" "gateway" {
name = "gateway"
droplet_ids = [digitalocean_droplet.gateway.id]
depends_on = [digitalocean_droplet.gateway]
inbound_rule {
protocol = "tcp"
port_range = "22"
source_addresses = ["0.0.0.0/0", "::/0"]
}
outbound_rule {
protocol = "tcp"
port_range = "1-65535"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
outbound_rule {
protocol = "udp"
port_range = "1-65535"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
}
resource "digitalocean_firewall" "app" {
name = "app"
droplet_ids = [digitalocean_droplet.app1.id, digitalocean_droplet.app2.id]
depends_on = [digitalocean_droplet.app1, digitalocean_droplet.app2]
inbound_rule {
protocol = "tcp"
port_range = "1-65535"
source_addresses = [digitalocean_vpc.sgp_vpc.ip_range]
}
inbound_rule {
protocol = "udp"
port_range = "1-65535"
source_addresses = [digitalocean_vpc.sgp_vpc.ip_range]
}
outbound_rule {
protocol = "tcp"
port_range = "1-65535"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
outbound_rule {
protocol = "udp"
port_range = "1-65535"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
}