Skip to content

Commit

Permalink
chore: improve destroy flow: ignore no existing sg module
Browse files Browse the repository at this point in the history
  • Loading branch information
assafgi committed Jan 2, 2024
1 parent 780954e commit e70129b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prerequisites.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ locals {
subnet_ids = length(var.subnet_ids) == 0 ? module.network[0].subnet_ids : var.subnet_ids
additional_subnet_id = var.create_alb ? var.alb_additional_subnet_id == "" ? module.network[0].additional_subnet_id : var.alb_additional_subnet_id : ""
vpc_id = length(var.subnet_ids) == 0 ? module.network[0].vpc_id : var.vpc_id
sg_ids = length(var.sg_ids) == 0 ? module.security_group[0].sg_ids : var.sg_ids
sg_ids = length(var.sg_ids) == 0 && length(module.security_group) > 0 ? module.security_group[0].sg_ids : var.sg_ids
alb_sg_ids = var.create_alb ? length(var.alb_sg_ids) > 0 ? var.alb_sg_ids : local.sg_ids : []
instance_iam_profile_arn = var.instance_iam_profile_arn == "" ? module.iam[0].instance_iam_profile_arn : var.instance_iam_profile_arn
lambda_iam_role_arn = var.lambda_iam_role_arn == "" ? module.iam[0].lambda_iam_role_arn : var.lambda_iam_role_arn
Expand Down

0 comments on commit e70129b

Please sign in to comment.