From 3266c47ff83de7ee299115453831d1096f64bc4e Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Wed, 12 Oct 2022 04:08:37 +1100 Subject: [PATCH] Auto instance refresh (#142) * Support instance refresh * Trigger instance refresh on launch template version updates --- main.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 1c79135..1915542 100644 --- a/main.tf +++ b/main.tf @@ -255,7 +255,7 @@ resource "aws_autoscaling_group" "bastion_auto_scaling_group" { name_prefix = "ASG-${local.name_prefix}" launch_template { id = aws_launch_template.bastion_launch_template.id - version = "$Latest" + version = aws_launch_template.bastion_launch_template.latest_version } max_size = var.bastion_instance_count min_size = var.bastion_instance_count @@ -291,6 +291,10 @@ resource "aws_autoscaling_group" "bastion_auto_scaling_group" { propagate_at_launch = true } + instance_refresh { + strategy = "Rolling" + } + lifecycle { create_before_destroy = true }