-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path_securitygroups.tf
67 lines (66 loc) · 1.31 KB
/
_securitygroups.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
resource "openstack_compute_secgroup_v2" "swarm_base" {
name = "${var.cluster_name}_swarm_base"
description = "${var.cluster_name} - Docker Swarm Security Group"
# HTTP
rule {
ip_protocol = "tcp"
from_port = "80"
to_port = "80"
cidr = "${var.whitelist_network}"
}
# SSH
rule {
ip_protocol = "tcp"
from_port = "22"
to_port = "22"
cidr = "${var.whitelist_network}"
}
# DOCKER SWARM
rule {
ip_protocol = "tcp"
from_port = "2375"
to_port = "2375"
cidr = "${var.whitelist_network}"
}
# DOCKER
rule {
ip_protocol = "tcp"
from_port = "2376"
to_port = "2376"
cidr = "${var.whitelist_network}"
}
# INTERNAL Communication only
rule {
ip_protocol = "icmp"
from_port = "-1"
to_port = "-1"
self = true
}
rule {
ip_protocol = "tcp"
from_port = "1"
to_port = "65535"
self = true
}
rule {
ip_protocol = "udp"
from_port = "1"
to_port = "65535"
self = true
}
# DANGER DANGER DANGER
# Uncomment these if you want to allow
# unrestricted inbound access
#rule {
# ip_protocol = "tcp"
# from_port = "1"
# to_port = "65535"
# cidr = "${var.whitelist_network}"
#}
#rule {
# ip_protocol = "udp"
# from_port = "1"
# to_port = "65535"
# cidr = "${var.whitelist_network}"
#}
}