-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
40 lines (33 loc) · 902 Bytes
/
main.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
resource "digitalocean_droplet" "_" {
name = "terraform-test-droplet"
size = "s-1vcpu-1gb"
image = "ubuntu-18-04-x64"
region = "nyc3"
}
resource "digitalocean_floating_ip" "_" {
droplet_id = digitalocean_droplet._.id
region = digitalocean_droplet._.region
}
resource "digitalocean_firewall" "_" {
name = "terraform-test-firewall"
droplet_ids = [digitalocean_droplet._.id]
inbound_rule {
protocol = "tcp"
port_range = "22"
source_addresses = ["8.8.8.8/32"]
}
outbound_rule {
protocol = "tcp"
port_range = "1-65535"
destination_addresses = ["8.8.8.8/32"]
}
outbound_rule {
protocol = "udp"
port_range = "1-65535"
destination_addresses = ["8.8.8.8/32"]
}
outbound_rule {
protocol = "icmp"
destination_addresses = ["8.8.8.8/32"]
}
}