@@ -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,198 @@ variable "application" {
175170 description = " Name of the application"
176171}
177172
173+ variable "security_group_id" {
174+ description = " List of security group IDs to attach"
175+ type = list (string )
176+ }
178177
179178variable "ingress_cidr_block" {
180179 type = list (string )
181180 description = " CIDR blocks for EC2 security group ingress rules"
182181}
183182
184- variable "ingress_from_port " {
183+ variable "ingress_cidr_from_port " {
185184 description = " The starting port for ingress rules"
186185 type = list (number )
187186}
188187
189- variable "ingress_to_port " {
188+ variable "ingress_cidr_to_port " {
190189 description = " The ending port for ingress rules"
191190 type = list (number )
192191}
193192
194- variable "ingress_protocol " {
193+ variable "ingress_cidr_protocol " {
195194 description = " The protocol for ingress rules"
196195 type = list (any )
197196}
198197
198+ variable "create_ingress_cidr" {
199+ description = " Whether to create the ingress cidr or not"
200+ type = bool
201+ }
202+
203+ variable "ingress_sg_from_port" {
204+ type = list (number )
205+ description = " List of starting ports for sg ingress rules"
206+ }
207+
208+ variable "ingress_sg_to_port" {
209+ type = list (number )
210+ description = " List of ending ports for sg ingress rules"
211+ }
212+
213+ variable "ingress_sg_protocol" {
214+ type = list (any )
215+ description = " List of protocols for sg ingress rules"
216+ }
217+
218+ variable "create_ingress_sg" {
219+ type = bool
220+ description = " Enable or disable Security Groups ingress rules."
221+ }
222+
199223variable "egress_cidr_block" {
200224 type = list (string )
201- description = " CIDR blocks for EC2 security group egress rules"
225+ description = " CIDR blocks for group egress rules"
226+ }
227+
228+ variable "egress_cidr_from_port" {
229+ description = " The starting port for egress rules"
230+ type = list (number )
231+ }
232+
233+ variable "egress_cidr_to_port" {
234+ description = " The ending port for egress rules"
235+ type = list (number )
236+ }
237+
238+ variable "egress_cidr_protocol" {
239+ description = " The protocol for egress rules"
240+ type = list (any )
241+ }
242+
243+ variable "create_egress_cidr" {
244+ type = bool
245+ description = " Enable or disable CIDR block egress rules."
202246}
203247
204- variable "egress_from_port " {
248+ variable "egress_sg_from_port " {
205249 description = " The starting port for egress rules"
206250 type = list (number )
207251}
208252
209- variable "egress_to_port " {
253+ variable "egress_sg_to_port " {
210254 description = " The ending port for egress rules"
211255 type = list (number )
212256}
213257
214- variable "egress_protocol " {
258+ variable "egress_sg_protocol " {
215259 description = " The protocol for egress rules"
216260 type = list (any )
217261}
218262
263+ variable "create_egress_sg" {
264+ type = bool
265+ description = " Enable or disable CIDR block egress rules."
266+ }
267+
268+
219269variable "alb_ingress_cidr_block" {
220270 type = list (string )
221271 description = " CIDR blocks for EC2 security group ingress rules"
222272}
223273
224- variable "alb_ingress_from_port " {
274+ variable "alb_ingress_cidr_from_port " {
225275 description = " The starting port for ingress rules"
226276 type = list (number )
227277}
228278
229- variable "alb_ingress_to_port " {
279+ variable "alb_ingress_cidr_to_port " {
230280 description = " The ending port for ingress rules"
231281 type = list (number )
232282}
233283
234- variable "alb_ingress_protocol " {
284+ variable "alb_ingress_cidr_protocol " {
235285 description = " The protocol for ingress rules"
236286 type = list (any )
237287}
238288
289+ variable "alb_create_ingress_cidr" {
290+ description = " Whether to create the ingress cidr or not"
291+ type = bool
292+ }
293+
294+ variable "alb_ingress_sg_from_port" {
295+ type = list (number )
296+ description = " List of starting ports for sg ingress rules of the EC2 security group."
297+ }
298+
299+ variable "alb_ingress_sg_to_port" {
300+ type = list (number )
301+ description = " List of ending ports for sg ingress rules of the EC2 security group."
302+ }
303+
304+ variable "alb_ingress_sg_protocol" {
305+ type = list (any )
306+ description = " List of protocols for sg ingress rules of the EC2 security group."
307+ }
308+
309+ variable "alb_create_ingress_sg" {
310+ type = bool
311+ description = " Enable or disable Security Groups ingress rules."
312+ }
313+
239314variable "alb_egress_cidr_block" {
240315 type = list (string )
241316 description = " CIDR blocks for EC2 security group egress rules"
242317}
243318
244- variable "alb_egress_from_port " {
319+ variable "alb_egress_cidr_from_port " {
245320 description = " The starting port for egress rules"
246321 type = list (number )
247322}
248323
249- variable "alb_egress_to_port " {
324+ variable "alb_egress_cidr_to_port " {
250325 description = " The ending port for egress rules"
251326 type = list (number )
252327}
253328
254- variable "alb_egress_protocol " {
329+ variable "alb_egress_cidr_protocol " {
255330 description = " The protocol for egress rules"
256331 type = list (any )
332+ }
333+
334+ variable "alb_create_egress_cidr" {
335+ type = bool
336+ description = " Enable or disable CIDR block egress rules."
337+ }
338+
339+ variable "alb_egress_sg_from_port" {
340+ description = " The starting port for egress rules"
341+ type = list (number )
342+ }
343+
344+ variable "alb_egress_sg_to_port" {
345+ description = " The ending port for egress rules"
346+ type = list (number )
347+ }
348+
349+ variable "alb_egress_sg_protocol" {
350+ description = " The protocol for egress rules"
351+ type = list (any )
352+ }
353+
354+ variable "alb_create_egress_sg" {
355+ type = bool
356+ description = " Enable or disable CIDR block egress rules."
357+ }
358+
359+ variable "sg_name" {
360+ type = string
361+ description = " Name of the security group for the instance."
362+ }
363+
364+ variable "alb_sg_name" {
365+ type = string
366+ description = " Name of the security group for the instance."
257367}
0 commit comments