-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirewall.tf
87 lines (84 loc) · 2.6 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
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
// --- Deployment-wide Firewalls definitions --- //
module "firewall_rules" {
source = "terraform-google-modules/network/google//modules/firewall-rules"
depends_on = [
module.vpc_network
]
project_id = var.config_project_id
network_name = module.vpc_network.network_name
// Keep in mind that logging is disabled for the defined firewall rules
rules = [
// SSH
{
name = "${var.config_release_name}-fw-allow-ssh-ingress"
description = "Allow SSH INBOUND traffic to nodes tagged accordingly"
direction = "INGRESS"
ranges = ["0.0.0.0/0"]
target_tags = [local.fw_tag_ssh]
allow = [{
protocol = "tcp"
ports = ["22"]
}]
deny = []
priority = null
source_tags = null
source_service_accounts = null
target_service_accounts = null
log_config = null
},
// HTTP
{
name = "${var.config_release_name}-fw-allow-http-ingress"
description = "Allow HTTP INBOUND traffic to nodes tagged accordingly"
direction = "INGRESS"
ranges = ["0.0.0.0/0"]
target_tags = [local.fw_tag_http]
allow = [{
protocol = "tcp"
ports = ["80", "8080"]
}]
deny = []
priority = null
source_tags = null
source_service_accounts = null
target_service_accounts = null
log_config = null
},
// HTTPS
{
name = "${var.config_release_name}-fw-allow-https-ingress"
description = "Allow HTTPS INBOUND traffic to nodes tagged accordingly"
direction = "INGRESS"
ranges = ["0.0.0.0/0"]
target_tags = [local.fw_tag_https]
allow = [{
protocol = "tcp"
ports = ["443"]
}]
deny = []
priority = null
source_tags = null
source_service_accounts = null
target_service_accounts = null
log_config = null
},
// ICMP
{
name = "${var.config_release_name}-fw-allow-icmp-ingress"
description = "Allow ICMP INBOUND traffic to nodes tagged accordingly"
direction = "INGRESS"
ranges = ["0.0.0.0/0"]
target_tags = null
allow = [{
protocol = "icmp"
ports = []
}]
deny = []
priority = null
source_tags = null
source_service_accounts = null
target_service_accounts = null
log_config = null
}
]
}