diff --git a/terraform/aws/aws-ec2-autoscaling-dual-subnet/main.tf b/terraform/aws/aws-ec2-autoscaling-dual-subnet/main.tf index e8873b8..a7826c5 100644 --- a/terraform/aws/aws-ec2-autoscaling-dual-subnet/main.tf +++ b/terraform/aws/aws-ec2-autoscaling-dual-subnet/main.tf @@ -1,7 +1,7 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : { + tags = length(var.tags) > 0 ? var.tags : { Name = local.name } } diff --git a/terraform/aws/aws-ec2-autoscaling-session-recorder/main.tf b/terraform/aws/aws-ec2-autoscaling-session-recorder/main.tf index 9cfb027..322f30d 100644 --- a/terraform/aws/aws-ec2-autoscaling-session-recorder/main.tf +++ b/terraform/aws/aws-ec2-autoscaling-session-recorder/main.tf @@ -1,7 +1,7 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : { + tags = length(var.tags) > 0 ? var.tags : { Name = local.name } } diff --git a/terraform/aws/aws-ec2-autoscaling/main.tf b/terraform/aws/aws-ec2-autoscaling/main.tf index dba7422..7635a7c 100644 --- a/terraform/aws/aws-ec2-autoscaling/main.tf +++ b/terraform/aws/aws-ec2-autoscaling/main.tf @@ -1,7 +1,7 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : { + tags = length(var.tags) > 0 ? var.tags : { Name = local.name } } diff --git a/terraform/aws/aws-ec2-instance-dual-stack-ipv4-ipv6/main.tf b/terraform/aws/aws-ec2-instance-dual-stack-ipv4-ipv6/main.tf index f4ade56..0ae5d9b 100644 --- a/terraform/aws/aws-ec2-instance-dual-stack-ipv4-ipv6/main.tf +++ b/terraform/aws/aws-ec2-instance-dual-stack-ipv4-ipv6/main.tf @@ -1,7 +1,7 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : { + tags = length(var.tags) > 0 ? var.tags : { Name = local.name } } diff --git a/terraform/aws/aws-ec2-instance/main.tf b/terraform/aws/aws-ec2-instance/main.tf index 4c19ce0..6a2acca 100644 --- a/terraform/aws/aws-ec2-instance/main.tf +++ b/terraform/aws/aws-ec2-instance/main.tf @@ -1,7 +1,7 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : { + tags = length(var.tags) > 0 ? var.tags : { Name = local.name } } diff --git a/terraform/aws/internal-modules/aws-ec2-autoscaling/main.tf b/terraform/aws/internal-modules/aws-ec2-autoscaling/main.tf index c4b445b..82d7807 100644 --- a/terraform/aws/internal-modules/aws-ec2-autoscaling/main.tf +++ b/terraform/aws/internal-modules/aws-ec2-autoscaling/main.tf @@ -91,15 +91,22 @@ resource "aws_autoscaling_group" "tailscale" { version = aws_launch_template.tailscale.latest_version } - max_size = 1 - min_size = 1 + availability_zones = [data.aws_network_interface.selected[0].availability_zone] + desired_capacity = 1 + min_size = 1 + max_size = 2 + + instance_refresh { + strategy = "Rolling" + preferences { + min_healthy_percentage = 50 + } + } health_check_grace_period = 300 health_check_type = "EC2" - availability_zones = [data.aws_network_interface.selected[0].availability_zone] - timeouts { delete = "15m" } diff --git a/terraform/azure/azure-linux-vm/main.tf b/terraform/azure/azure-linux-vm/main.tf index ed831f2..e3d0adb 100644 --- a/terraform/azure/azure-linux-vm/main.tf +++ b/terraform/azure/azure-linux-vm/main.tf @@ -1,7 +1,7 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : { + tags = length(var.tags) > 0 ? var.tags : { Name = local.name } } diff --git a/terraform/google/google-compute-instance/main.tf b/terraform/google/google-compute-instance/main.tf index fdf298c..ba4c9be 100644 --- a/terraform/google/google-compute-instance/main.tf +++ b/terraform/google/google-compute-instance/main.tf @@ -1,9 +1,9 @@ locals { name = var.name != "" ? var.name : "example-${basename(path.cwd)}" - tags = var.tags != "" ? var.tags : ["example"] + tags = length(var.tags) > 0 ? var.tags : ["example"] - metadata = var.metadata != "" ? var.metadata : { + metadata = length(var.metadata) > 0 ? var.metadata : { Name = local.name } }