@@ -120,11 +120,6 @@ variable "asg_subnets" {
120120 type = list (string )
121121}
122122
123- variable "security_group_ids" {
124- type = list (string )
125- description = " Security group id of the ec2 instance"
126- }
127-
128123variable "public_access" {
129124 description = " Whether the instance is public or not"
130125 type = bool
@@ -175,83 +170,195 @@ variable "application" {
175170 description = " Name of the application"
176171}
177172
178-
179173variable "ingress_cidr_block" {
180174 type = list (string )
181- description = " CIDR blocks for EC2 security group ingress rules"
175+ description = " CIDR blocks for the security group ingress rules"
182176}
183177
184- variable "ingress_from_port " {
178+ variable "ingress_cidr_from_port " {
185179 description = " The starting port for ingress rules"
186180 type = list (number )
187181}
188182
189- variable "ingress_to_port " {
183+ variable "ingress_cidr_to_port " {
190184 description = " The ending port for ingress rules"
191185 type = list (number )
192186}
193187
194- variable "ingress_protocol " {
188+ variable "ingress_cidr_protocol " {
195189 description = " The protocol for ingress rules"
196190 type = list (any )
197191}
198192
193+ variable "create_ingress_cidr" {
194+ description = " Whether to create the ingress cidr or not"
195+ type = bool
196+ }
197+
198+ variable "ingress_sg_from_port" {
199+ type = list (number )
200+ description = " List of starting ports for sg ingress rules"
201+ }
202+
203+ variable "ingress_sg_to_port" {
204+ type = list (number )
205+ description = " List of ending ports for sg ingress rules"
206+ }
207+
208+ variable "ingress_sg_protocol" {
209+ type = list (any )
210+ description = " List of protocols for sg ingress rules"
211+ }
212+
213+ variable "ingress_security_group_ids" {
214+ type = list (string )
215+ default = [ " sg-0fe4363da3994c100" ]
216+ description = " List of Security Group ids for sg ingress rules"
217+ }
218+
219+ variable "create_ingress_sg" {
220+ type = bool
221+ description = " Enable or disable Security Groups ingress rules."
222+ }
223+
199224variable "egress_cidr_block" {
200225 type = list (string )
201- description = " CIDR blocks for EC2 security group egress rules"
226+ description = " CIDR blocks for group egress rules"
202227}
203228
204- variable "egress_from_port " {
229+ variable "egress_cidr_from_port " {
205230 description = " The starting port for egress rules"
206231 type = list (number )
207232}
208233
209- variable "egress_to_port " {
234+ variable "egress_cidr_to_port " {
210235 description = " The ending port for egress rules"
211236 type = list (number )
212237}
213238
214- variable "egress_protocol " {
239+ variable "egress_cidr_protocol " {
215240 description = " The protocol for egress rules"
216241 type = list (any )
217242}
218243
244+ variable "create_egress_cidr" {
245+ type = bool
246+ description = " Enable or disable CIDR block egress rules."
247+ }
248+
249+ variable "egress_sg_from_port" {
250+ description = " The starting port for egress rules"
251+ type = list (number )
252+ }
253+
254+ variable "egress_sg_to_port" {
255+ description = " The ending port for egress rules"
256+ type = list (number )
257+ }
258+
259+ variable "egress_sg_protocol" {
260+ description = " The protocol for egress rules"
261+ type = list (any )
262+ }
263+
264+ variable "egress_security_group_ids" {
265+ type = list (string )
266+ default = [ " sg-0fe4363da3994c100" ]
267+ description = " List of Security Group ids for sg egress rules"
268+ }
269+
270+ variable "create_egress_sg" {
271+ type = bool
272+ description = " Enable or disable CIDR block egress rules."
273+ }
274+
275+
219276variable "alb_ingress_cidr_block" {
220277 type = list (string )
221- description = " CIDR blocks for EC2 security group ingress rules"
278+ description = " CIDR blocks for the security group ingress rules"
222279}
223280
224- variable "alb_ingress_from_port " {
281+ variable "alb_ingress_cidr_from_port " {
225282 description = " The starting port for ingress rules"
226283 type = list (number )
227284}
228285
229- variable "alb_ingress_to_port " {
286+ variable "alb_ingress_cidr_to_port " {
230287 description = " The ending port for ingress rules"
231288 type = list (number )
232289}
233290
234- variable "alb_ingress_protocol " {
291+ variable "alb_ingress_cidr_protocol " {
235292 description = " The protocol for ingress rules"
236293 type = list (any )
237294}
238295
296+ variable "alb_create_ingress_cidr" {
297+ description = " Whether to create the ingress cidr or not"
298+ type = bool
299+ }
300+
301+ variable "alb_ingress_sg_from_port" {
302+ type = list (number )
303+ description = " List of starting ports for sg ingress rules"
304+ }
305+
306+ variable "alb_ingress_sg_to_port" {
307+ type = list (number )
308+ description = " List of ending ports for sg ingress rules"
309+ }
310+
311+ variable "alb_ingress_sg_protocol" {
312+ type = list (any )
313+ description = " List of protocols for sg ingress rules"
314+ }
315+
316+ variable "alb_create_ingress_sg" {
317+ type = bool
318+ description = " Enable or disable Security Groups ingress rules."
319+ }
320+
239321variable "alb_egress_cidr_block" {
240322 type = list (string )
241- description = " CIDR blocks for EC2 security group egress rules"
323+ description = " CIDR blocks for the security group egress rules"
242324}
243325
244- variable "alb_egress_from_port " {
326+ variable "alb_egress_cidr_from_port " {
245327 description = " The starting port for egress rules"
246328 type = list (number )
247329}
248330
249- variable "alb_egress_to_port " {
331+ variable "alb_egress_cidr_to_port " {
250332 description = " The ending port for egress rules"
251333 type = list (number )
252334}
253335
254- variable "alb_egress_protocol " {
336+ variable "alb_egress_cidr_protocol " {
255337 description = " The protocol for egress rules"
256338 type = list (any )
257- }
339+ }
340+
341+ variable "alb_create_egress_cidr" {
342+ type = bool
343+ description = " Enable or disable CIDR block egress rules."
344+ }
345+
346+ variable "alb_egress_sg_from_port" {
347+ description = " The starting port for egress rules"
348+ type = list (number )
349+ }
350+
351+ variable "alb_egress_sg_to_port" {
352+ description = " The ending port for egress rules"
353+ type = list (number )
354+ }
355+
356+ variable "alb_egress_sg_protocol" {
357+ description = " The protocol for egress rules"
358+ type = list (any )
359+ }
360+
361+ variable "alb_create_egress_sg" {
362+ type = bool
363+ description = " Enable or disable CIDR block egress rules."
364+ }
0 commit comments