-
Notifications
You must be signed in to change notification settings - Fork 2
/
security-group.tf
73 lines (62 loc) · 1.85 KB
/
security-group.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
##############################################################################
# This file creates the security-rules.
##############################################################################
#FIXME - set rules on f5_sg01
resource "ibm_is_security_group" "f5_sg01" {
name = "${var.vpc_name}-sg01"
vpc = "${data.ibm_is_vpc.f5_vpc.id}"
}
# resource "ibm_is_security_group_rule" "f5_egress_all" {
# depends_on = ["ibm_is_floating_ip.f5_fip01"]
# group = "${ibm_is_security_group.f5_sg01.id}"
# direction = "outbound"
# remote = "0.0.0.0/0"
# tcp = {
# port_min = 80
# port_max = 80
# }
# }
resource "ibm_is_security_group_rule" "f5_sg01_rule1" {
depends_on = ["ibm_is_floating_ip.f5_fip01"]
group = "${ibm_is_security_group.f5_sg01.id}"
direction = "inbound"
remote = "0.0.0.0/0"
tcp = {
port_min = 8443
port_max = 8443
}
}
resource "ibm_is_security_group_rule" "f5_sg01_rule2" {
depends_on = ["ibm_is_floating_ip.f5_fip01"]
group = "${ibm_is_security_group.f5_sg01.id}"
direction = "inbound"
remote = "0.0.0.0/0"
tcp = {
port_min = 80
port_max = 80
}
}
resource "ibm_is_security_group_rule" "f5_sg01_rule3" {
depends_on = ["ibm_is_floating_ip.f5_fip01"]
group = "${ibm_is_security_group.f5_sg01.id}"
direction = "inbound"
remote = "0.0.0.0/0"
tcp = {
port_min = 22
port_max = 22
}
}
resource "ibm_is_security_group_rule" "f5_sg01_icmp_rule" {
depends_on = ["ibm_is_floating_ip.f5_fip01"]
group = "${ibm_is_security_group.f5_sg01.id}"
direction = "inbound"
remote = "0.0.0.0/0"
icmp = {
code = 0
type = 8
}
}
resource "ibm_is_security_group_network_interface_attachment" "f5_sgnic1" {
security_group = "${ibm_is_security_group.f5_sg01.id}"
network_interface = "${ibm_is_instance.f5_vsi.primary_network_interface.0.id}"
}