From ebe5b1a3aec76b236cfedd03ee5beacee9a128d2 Mon Sep 17 00:00:00 2001 From: Daniel Bernstein Date: Fri, 13 Dec 2024 11:27:25 -0800 Subject: [PATCH] Ensure the default version of the launch template is updated on when it changes. Otherwise new instances will not have the latest version of the launch template. --- mill/audit-worker.tf | 1 + mill/bit-report-worker.tf | 1 + mill/bit-worker.tf | 2 +- mill/high-priority-dup-worker.tf | 1 + mill/low-priority-dup-worker.tf | 1 + mill/sentinel.tf | 1 + mill/storage-stats-worker.tf | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mill/audit-worker.tf b/mill/audit-worker.tf index bd3385e..d141929 100644 --- a/mill/audit-worker.tf +++ b/mill/audit-worker.tf @@ -7,6 +7,7 @@ resource "aws_launch_template" "audit_worker_launch_template" { vpc_security_group_ids = [aws_security_group.mill_instance.id] key_name = var.ec2_keypair user_data = base64encode(templatefile("${path.module}/resources/cloud-init.tpl", merge(local.cloud_init_props, { node_type = "audit-worker" }))) + update_default_version = true block_device_mappings { device_name = "/dev/sda1" diff --git a/mill/bit-report-worker.tf b/mill/bit-report-worker.tf index d4e5463..244eac7 100644 --- a/mill/bit-report-worker.tf +++ b/mill/bit-report-worker.tf @@ -11,6 +11,7 @@ resource "aws_launch_template" "bit_report_worker_launch_template" { node_type = "bit-report-worker" max_worker_threads = var.bit_report_max_worker_threads }))) + update_default_version = true block_device_mappings { device_name = "/dev/sda1" diff --git a/mill/bit-worker.tf b/mill/bit-worker.tf index aad39b2..fcbf93d 100644 --- a/mill/bit-worker.tf +++ b/mill/bit-worker.tf @@ -7,7 +7,7 @@ resource "aws_launch_template" "bit_worker_launch_template" { vpc_security_group_ids = [aws_security_group.mill_instance.id] key_name = var.ec2_keypair user_data = base64encode(templatefile("${path.module}/resources/cloud-init.tpl", merge(local.cloud_init_props, { node_type = "bit-worker" }))) - + update_default_version = true block_device_mappings { device_name = "/dev/sda1" ebs { diff --git a/mill/high-priority-dup-worker.tf b/mill/high-priority-dup-worker.tf index ccd7ff5..39b6b5d 100644 --- a/mill/high-priority-dup-worker.tf +++ b/mill/high-priority-dup-worker.tf @@ -7,6 +7,7 @@ resource "aws_launch_template" "high_priority_dup_worker_launch_template" { vpc_security_group_ids = [aws_security_group.mill_instance.id] key_name = var.ec2_keypair user_data = base64encode(templatefile("${path.module}/resources/cloud-init.tpl", merge(local.cloud_init_props, { node_type = "dup-worker" }))) + update_default_version = true block_device_mappings { device_name = "/dev/sda1" diff --git a/mill/low-priority-dup-worker.tf b/mill/low-priority-dup-worker.tf index c850d29..d32c7b4 100644 --- a/mill/low-priority-dup-worker.tf +++ b/mill/low-priority-dup-worker.tf @@ -7,6 +7,7 @@ resource "aws_launch_template" "low_priority_dup_worker_launch_template" { vpc_security_group_ids = [aws_security_group.mill_instance.id] key_name = var.ec2_keypair user_data = base64encode(templatefile("${path.module}/resources/cloud-init.tpl", merge(local.cloud_init_props, { node_type = "dup-worker" }))) + update_default_version = true block_device_mappings { device_name = "/dev/sda1" diff --git a/mill/sentinel.tf b/mill/sentinel.tf index 750d109..32c7a53 100644 --- a/mill/sentinel.tf +++ b/mill/sentinel.tf @@ -6,6 +6,7 @@ resource "aws_launch_template" "sentinel_launch_template" { vpc_security_group_ids = [aws_security_group.mill_instance.id] key_name = var.ec2_keypair user_data = base64encode(templatefile("${path.module}/resources/cloud-init.tpl", merge(local.cloud_init_props, { node_type = "sentinel" }))) + update_default_version = true block_device_mappings { device_name = "/dev/sda1" diff --git a/mill/storage-stats-worker.tf b/mill/storage-stats-worker.tf index 81f36b6..0331407 100644 --- a/mill/storage-stats-worker.tf +++ b/mill/storage-stats-worker.tf @@ -7,6 +7,7 @@ resource "aws_launch_template" "storage_stats_worker_launch_template" { vpc_security_group_ids = [aws_security_group.mill_instance.id] key_name = var.ec2_keypair user_data = base64encode(templatefile("${path.module}/resources/cloud-init.tpl", merge(local.cloud_init_props, { node_type = "storage_stats-worker" }))) + update_default_version = true block_device_mappings { device_name = "/dev/sda1"