-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirewalls.tf
97 lines (76 loc) · 2.09 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
resource "google_compute_firewall" "access_http" {
name = "access-http"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["80"]
}
target_tags = ["http-server"]
source_ranges = ["0.0.0.0/0"]
}
resource "google_compute_firewall" "access_https" {
name = "access-https"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["443"]
}
target_tags = ["https-server"]
source_ranges = ["0.0.0.0/0"]
}
resource "google_compute_firewall" "access_ssh" {
name = "access-ssh"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["22"]
}
source_ranges = ["0.0.0.0/0"]
}
resource "google_compute_firewall" "vault_internal_access" {
name = "vault-internal-access"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["8200", "8201"]
}
target_tags = ["vault"]
source_tags = ["vault"]
}
resource "google_compute_firewall" "gke_access_vault" {
name = "gke-access-vault"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["8200"]
}
target_tags = ["vault"]
source_ranges = ["172.16.0.0/22"] # pod range
}
resource "google_compute_firewall" "master_node" {
name = "master-node"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["6443", "2379", "2380", "10250", "10259", "10257"]
}
target_tags = ["master"]
source_ranges = ["10.255.0.0/24"] # asia-east1 subnet range
}
resource "google_compute_firewall" "worker_node" {
name = "worker-node"
network = google_compute_network.quangpham5.self_link
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["10250", "30000-32767"]
}
target_tags = ["worker"]
source_ranges = ["10.255.0.0/24"] # asia-east1 subnet range
}