-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsecurity_group_rule.tf
47 lines (42 loc) · 1.45 KB
/
security_group_rule.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
resource "oci_core_network_security_group_security_rule" "CCCWebSecurityEgressGroupRule" {
network_security_group_id = oci_core_network_security_group.CCCWebSecurityGroup.id
direction = "EGRESS"
protocol = "6"
destination = "0.0.0.0/0"
destination_type = "CIDR_BLOCK"
}
resource "oci_core_network_security_group_security_rule" "CCCWebSecurityIngressGroupRules" {
for_each = toset(var.webservice_ports)
network_security_group_id = oci_core_network_security_group.CCCWebSecurityGroup.id
direction = "INGRESS"
protocol = "6"
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
tcp_options {
destination_port_range {
max = each.value
min = each.value
}
}
}
resource "oci_core_network_security_group_security_rule" "CCCSSHSecurityEgressGroupRule" {
network_security_group_id = oci_core_network_security_group.CCCSSHSecurityGroup.id
direction = "EGRESS"
protocol = "6"
destination = "0.0.0.0/0"
destination_type = "CIDR_BLOCK"
}
resource "oci_core_network_security_group_security_rule" "CCCSSHSecurityIngressGroupRules" {
for_each = toset(var.bastion_ports)
network_security_group_id = oci_core_network_security_group.CCCSSHSecurityGroup.id
direction = "INGRESS"
protocol = "6"
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
tcp_options {
destination_port_range {
max = each.value
min = each.value
}
}
}