-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfirewall.tf
39 lines (31 loc) · 1023 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
39
resource "google_compute_firewall" "hivemetastore_allow_sql_access" {
name = "allow-cloudsqlproxy-access"
network = "${google_compute_network.network.self_link}"
priority = "800"
direction = "EGRESS"
description = "Allow outbound access for cloud sql proxy to the hive metastore instance"
allow {
protocol = "tcp"
ports = ["3307"]
}
destination_ranges = ["${google_sql_database_instance.hive_metastore_instance.ip_address.0.ip_address}/32"]
target_tags = ["sql-egress"]
}
resource "google_compute_firewall" "dataproc_firewall" {
name = "${google_compute_network.network.name}-allow-internal"
network = "${google_compute_network.network.self_link}"
description = "Firewall rule for dataproc"
priority = "800"
allow {
protocol = "tcp"
ports = ["0-65535"]
}
allow {
protocol = "udp"
ports = ["0-65535"]
}
allow {
protocol = "icmp"
}
target_tags = ["${google_compute_network.network.name}-allow-internal"]
}