Skip to content

Commit

Permalink
chore: improve network destroy flow
Browse files Browse the repository at this point in the history
  • Loading branch information
assafgi committed Jan 2, 2024
1 parent f40cc36 commit f8bf69f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ resource "local_file" "private_key" {
}

resource "aws_placement_group" "placement_group" {
count = var.placement_group_name == null ? 1 : 0
name = "${var.prefix}-${var.cluster_name}-placement-group"
strategy = "cluster"
count = var.placement_group_name == null ? 1 : 0
name = "${var.prefix}-${var.cluster_name}-placement-group"
strategy = "cluster"
depends_on = [module.network]
}

resource "aws_launch_template" "launch_template" {
Expand Down
2 changes: 1 addition & 1 deletion prerequisites.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "vpc_endpoint" {
}

locals {
subnet_ids = length(var.subnet_ids) == 0 ? module.network[0].subnet_ids : var.subnet_ids
subnet_ids = length(var.subnet_ids) == 0 && length(module.network) > 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 && length(module.security_group) > 0 ? module.security_group[0].sg_ids : var.sg_ids
Expand Down

0 comments on commit f8bf69f

Please sign in to comment.