File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
cloud-foundation/modules/cloud-foundation-library/network-subnet/module Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,31 @@ variable "tcp_all_ports_egress_cidrs" {
73
73
description = " used to creste stateful rcp security list rules from all destination ports to the given list of source cidrs"
74
74
}
75
75
76
+
77
+
78
+
79
+ variable "custom_udp_ingress_rules" {
80
+ type = map (object ({
81
+ source_cidr = string ,
82
+ min = number ,
83
+ max = number ,
84
+ }))
85
+ default = {}
86
+ description = " creates stateful udp security list rules to a range of destination ports from any port with a specific source cidr"
87
+ }
88
+
89
+ variable "custom_udp_egress_rules" {
90
+ type = map (object ({
91
+ source_cidr = string ,
92
+ min = number ,
93
+ max = number ,
94
+ }))
95
+ default = {}
96
+ description = " creates stateful udp security list rules from a range of destination ports to any port with a specific destination cidr"
97
+ }
98
+
99
+
100
+
76
101
/* expected defined values
77
102
var.compartment - ocid
78
103
var.vcn - ocid
@@ -168,6 +193,19 @@ resource "oci_core_security_list" "this" {
168
193
}
169
194
}
170
195
196
+ dynamic "egress_security_rules" {
197
+ // allow custom udp traffic to specific ports from any port in a specific cidr range
198
+ for_each = var. custom_udp_egress_rules
199
+ content {
200
+ protocol = " 17"
201
+ destination = egress_security_rules. value . dest_cidr
202
+ udp_options {
203
+ min = egress_security_rules. value . min
204
+ max = egress_security_rules. value . max
205
+ }
206
+ }
207
+ }
208
+
171
209
172
210
173
211
# Ingress Rules
@@ -253,4 +291,18 @@ dynamic "ingress_security_rules" {
253
291
}
254
292
}
255
293
294
+ dynamic "ingress_security_rules" {
295
+ // allows udp traffic to specific ports from any port in a specific cidr range
296
+ for_each = var. custom_udp_ingress_rules
297
+ content {
298
+ protocol = " 17"
299
+ source = ingress_security_rules. value . source_cidr
300
+
301
+ udp_options {
302
+ min = ingress_security_rules. value . min
303
+ max = ingress_security_rules. value . max
304
+ }
305
+ }
306
+ }
307
+
256
308
}
You can’t perform that action at this time.
0 commit comments