-
Notifications
You must be signed in to change notification settings - Fork 25
/
secgroup_public-onedata.tf
55 lines (46 loc) · 1.84 KB
/
secgroup_public-onedata.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
resource "openstack_networking_secgroup_v2" "public-onedata" {
name = "public-onedata"
description = "[tf] Allow public ONEDATA connections (fixed)"
delete_default_rules = "true"
}
variable "onedata-ports" {
description = "ONEDATA ports"
type = list(string)
default = ["53", "80", "443", "6665", "9443"]
}
resource "openstack_networking_secgroup_rule_v2" "public-onedata-ports4" {
direction = "ingress"
ethertype = "IPv4"
protocol = "tcp"
security_group_id = openstack_networking_secgroup_v2.public-onedata.id
count = 4
port_range_min = element(var.onedata-ports, count.index)
port_range_max = element(var.onedata-ports, count.index)
}
resource "openstack_networking_secgroup_rule_v2" "public-onedata-ports6" {
direction = "ingress"
ethertype = "IPv6"
protocol = "tcp"
security_group_id = openstack_networking_secgroup_v2.public-onedata.id
count = 4
port_range_min = element(var.onedata-ports, count.index)
port_range_max = element(var.onedata-ports, count.index)
}
resource "openstack_networking_secgroup_rule_v2" "public-onedata-udp-ports4" {
direction = "ingress"
ethertype = "IPv4"
protocol = "udp"
security_group_id = openstack_networking_secgroup_v2.public-onedata.id
count = 1
port_range_min = element(var.onedata-ports, count.index)
port_range_max = element(var.onedata-ports, count.index)
}
resource "openstack_networking_secgroup_rule_v2" "public-onedata-udp-ports6" {
direction = "ingress"
ethertype = "IPv6"
protocol = "udp"
security_group_id = openstack_networking_secgroup_v2.public-onedata.id
count = 1
port_range_min = element(var.onedata-ports, count.index)
port_range_max = element(var.onedata-ports, count.index)
}