From 92e6c9b0183d132ea87ecf8f31ea07f5227e96a3 Mon Sep 17 00:00:00 2001 From: itsdalmo Date: Wed, 14 Aug 2019 14:06:25 +0200 Subject: [PATCH 1/4] Add log rotation for Concourse logs --- modules/atc/cloud-config.yml | 13 +++++++++++++ modules/worker/cloud-config.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/modules/atc/cloud-config.yml b/modules/atc/cloud-config.yml index 11df9d3..90af6d7 100644 --- a/modules/atc/cloud-config.yml +++ b/modules/atc/cloud-config.yml @@ -114,6 +114,19 @@ write_files: [Install] WantedBy=multi-user.target + - path: "/etc/logrotate.d/concourse" + permissions: "0644" + owner: "root" + content: | + /var/log/concourse.log { + create 0644 root root + daily + rotate 1 + size 100M + postrotate + systemctl restart concourse-logging awslogsd + endscript + } - path: "/usr/local/scripts/cloudformation-signal.sh" permissions: "0744" owner: "root" diff --git a/modules/worker/cloud-config.yml b/modules/worker/cloud-config.yml index a29660d..074d67c 100644 --- a/modules/worker/cloud-config.yml +++ b/modules/worker/cloud-config.yml @@ -103,6 +103,19 @@ write_files: [Install] WantedBy=multi-user.target + - path: "/etc/logrotate.d/concourse" + permissions: "0644" + owner: "root" + content: | + /var/log/concourse.log { + create 0644 root root + daily + rotate 1 + size 100M + postrotate + systemctl restart concourse-logging awslogsd + endscript + } - path: "/etc/systemd/system/lifecycled.service" permissions: "0644" owner: "root" From 314ee923787774b40107dffd815403e73539d772 Mon Sep 17 00:00:00 2001 From: itsdalmo Date: Thu, 15 Aug 2019 12:38:17 +0200 Subject: [PATCH 2/4] Use multipart cloud init for DRYness --- modules/atc/main.tf | 88 ++++++++++--------- .../cloud-config.yml => cloud-config/atc.yml} | 87 ++---------------- modules/cloud-config/shared.yml | 76 ++++++++++++++++ .../worker.yml} | 73 +-------------- modules/worker/main.tf | 50 +++++++---- 5 files changed, 163 insertions(+), 211 deletions(-) rename modules/{atc/cloud-config.yml => cloud-config/atc.yml} (59%) create mode 100644 modules/cloud-config/shared.yml rename modules/{worker/cloud-config.yml => cloud-config/worker.yml} (63%) diff --git a/modules/atc/main.tf b/modules/atc/main.tf index 7ba4e72..a32483d 100644 --- a/modules/atc/main.tf +++ b/modules/atc/main.tf @@ -51,7 +51,7 @@ module "atc" { version = "3.1.0" name_prefix = "${var.name_prefix}-atc" - user_data = local.user_data + user_data = data.template_cloudinit_config.atc.rendered vpc_id = var.vpc_id subnet_ids = var.private_subnet_ids min_size = var.min_size @@ -67,46 +67,52 @@ module "atc" { tags = var.tags } -locals { - template = "Environment=\"%s=%s\"" - local_user = var.local_user != "" ? format(local.template, "CONCOURSE_ADD_LOCAL_USER", var.local_user) : "" - local_admin_user = var.local_admin_user != "" ? format(local.template, "CONCOURSE_MAIN_TEAM_LOCAL_USER", var.local_admin_user) : "" - github_users = length(var.github_users) > 0 ? format(local.template, "CONCOURSE_MAIN_TEAM_GITHUB_USER", join(",", var.github_users)) : "" - github_teams = length(var.github_teams) > 0 ? format(local.template, "CONCOURSE_MAIN_TEAM_GITHUB_TEAM", join(",", var.github_teams)) : "" - prometheus_bind_ip = var.prometheus_enabled ? format(local.template, "CONCOURSE_PROMETHEUS_BIND_IP", "0.0.0.0") : "" - prometheus_bind_port = var.prometheus_enabled ? format(local.template, "CONCOURSE_PROMETHEUS_BIND_PORT", var.prometheus_port) : "" - start_node_exporter = var.prometheus_enabled ? "systemctl enable node_exporter.service --now" : "echo \"Prometheus disabled, not starting node-exporter\"" - concourse_web_host = "${lower(var.web_protocol)}://${var.domain != "" ? var.domain : module.external_lb.dns_name}:${var.web_port}" - - user_data = templatefile("${path.module}/cloud-config.yml", { - stack_name = "${var.name_prefix}-atc-asg" - region = data.aws_region.current.name - target_group = aws_lb_target_group.internal.arn - atc_port = var.atc_port - tsa_port = var.tsa_port - local_user = local.local_user - local_admin_user = local.local_admin_user - github_client_id = var.github_client_id - github_client_secret = var.github_client_secret - github_users = local.github_users - github_teams = local.github_teams - prometheus_bind_ip = local.prometheus_bind_ip - prometheus_bind_port = local.prometheus_bind_port - start_node_exporter = local.start_node_exporter - concourse_web_host = local.concourse_web_host - postgres_host = var.postgres_host - postgres_port = var.postgres_port - postgres_username = var.postgres_username - postgres_password = var.postgres_password - postgres_database = var.postgres_database - log_group_name = aws_cloudwatch_log_group.atc.name - log_level = var.log_level - tsa_host_key = file("${var.concourse_keys}/tsa_host_key") - session_signing_key = file("${var.concourse_keys}/session_signing_key") - authorized_worker_keys = file("${var.concourse_keys}/authorized_worker_keys") - encryption_key = var.encryption_key - old_encryption_key = var.old_encryption_key - }) +data "template_cloudinit_config" "atc" { + gzip = true + base64_encode = true + + part { + content_type = "text/cloud-config" + + content = templatefile("${path.module}/../cloud-config/shared.yml", { + region = data.aws_region.current.name + log_group_name = aws_cloudwatch_log_group.atc.name + prometheus_enabled = var.prometheus_enabled + }) + } + + part { + content_type = "text/cloud-config" + merge_type = "list(append)+dict(recurse_array)+str()" + + content = templatefile("${path.module}/../cloud-config/atc.yml", { + region = data.aws_region.current.name + stack_name = "${var.name_prefix}-atc-asg" + target_group = aws_lb_target_group.internal.arn + atc_port = var.atc_port + tsa_port = var.tsa_port + local_user = var.local_user + local_admin_user = var.local_admin_user + github_client_id = var.github_client_id + github_client_secret = var.github_client_secret + github_users = var.github_users + github_teams = var.github_teams + prometheus_enabled = var.prometheus_enabled + prometheus_bind_port = var.prometheus_port + concourse_web_host = "${lower(var.web_protocol)}://${var.domain != "" ? var.domain : module.external_lb.dns_name}:${var.web_port}" + postgres_host = var.postgres_host + postgres_port = var.postgres_port + postgres_username = var.postgres_username + postgres_password = var.postgres_password + postgres_database = var.postgres_database + log_level = var.log_level + tsa_host_key = file("${var.concourse_keys}/tsa_host_key") + session_signing_key = file("${var.concourse_keys}/session_signing_key") + authorized_worker_keys = file("${var.concourse_keys}/authorized_worker_keys") + encryption_key = var.encryption_key + old_encryption_key = var.old_encryption_key + }) + } } resource "aws_cloudwatch_log_group" "atc" { diff --git a/modules/atc/cloud-config.yml b/modules/cloud-config/atc.yml similarity index 59% rename from modules/atc/cloud-config.yml rename to modules/cloud-config/atc.yml index 90af6d7..adb3b91 100644 --- a/modules/atc/cloud-config.yml +++ b/modules/cloud-config/atc.yml @@ -15,25 +15,6 @@ write_files: owner: "root" encoding: base64 content: ${base64encode(authorized_worker_keys)} - - path: "/etc/awslogs/awscli.template" - permissions: "0644" - owner: "root" - content: | - [plugins] - cwlogs = cwlogs - [default] - region = ${region} - - path: "/etc/awslogs/awslogs.template" - permissions: "0644" - owner: "root" - content: | - [general] - state_file = /var/lib/awslogs/agent-state - - [/var/log/concourse.log] - file = /var/log/concourse.log - log_group_name = ${log_group_name} - log_stream_name = {instance_id} - path: "/etc/systemd/system/concourse.service" permissions: "0644" owner: "root" @@ -52,17 +33,11 @@ write_files: Environment="CONCOURSE_GITHUB_CLIENT_ID=${github_client_id}" Environment="CONCOURSE_GITHUB_CLIENT_SECRET=${github_client_secret}" - ${github_users} - ${github_teams} - ${local_user} - ${local_admin_user} - Environment="CONCOURSE_POSTGRES_HOST=${postgres_host}" Environment="CONCOURSE_POSTGRES_PORT=${postgres_port}" Environment="CONCOURSE_POSTGRES_USER=${postgres_username}" Environment="CONCOURSE_POSTGRES_PASSWORD=${postgres_password}" Environment="CONCOURSE_POSTGRES_DATABASE=${postgres_database}" - Environment="CONCOURSE_EXTERNAL_URL=${concourse_web_host}" Environment="CONCOURSE_LOG_LEVEL=${log_level}" Environment="CONCOURSE_TSA_LOG_LEVEL=${log_level}" @@ -73,60 +48,18 @@ write_files: Environment="CONCOURSE_OLD_ENCRYPTION_KEY=${old_encryption_key}" Environment="CONCOURSE_AWS_SECRETSMANAGER_REGION=${region}" - ${prometheus_bind_ip} - ${prometheus_bind_port} + %{ if local_user != "" }Environment="CONCOURSE_ADD_LOCAL_USER=${local_user}"%{ endif } + %{ if local_admin_user != "" }Environemnt="CONCOURSE_MAIN_TEAM_LOCAL_USER=${local_admin_user}"%{ endif } + %{ if length(github_users) > 0 }Environment="CONCOURSE_MAIN_TEAM_GITHUB_USER=${join(",", github_users)}"%{ endif } + %{ if length(github_teams) > 0 }Environment="CONCOURSE_MAIN_TEAM_GITHUB_TEAM=${join(",", github_teams)}"%{ endif } + %{ if prometheus_enabled }Environment="CONCOURSE_PROMETHEUS_BIND_IP=0.0.0.0"%{ endif } + %{ if prometheus_enabled }Environment="CONCOURSE_PROMETHEUS_BIND_PORT=${prometheus_bind_port}"%{ endif } ExecStartPre=/bin/bash -c "/bin/systemctl set-environment CONCOURSE_PEER_ADDRESS=$(curl -L http://169.254.169.254/latest/meta-data/local-ipv4)" ExecStart=/usr/local/bin/aws-env exec -- /usr/local/concourse/bin/concourse web [Install] WantedBy=multi-user.target - - path: "/etc/systemd/system/node_exporter.service" - permissions: "0644" - owner: "root" - content: | - [Unit] - Description=Node exporter for Prometheus to scrape - Requires=network-online.target - After=network-online.target - - [Service] - Type=simple - Restart=always - ExecStart=/usr/local/bin/node_exporter - - [Install] - WantedBy=multi-user.target - - path: "/etc/systemd/system/concourse-logging.service" - permissions: "0644" - owner: "root" - content: | - [Unit] - Description=Service for Concourse logging - After=rc-local.service - - [Service] - Type=simple - Restart=always - TimeoutSec=infinity - - ExecStart=/bin/bash -c '/usr/bin/journalctl -u concourse --no-tail -f -o cat > /var/log/concourse.log' - - [Install] - WantedBy=multi-user.target - - path: "/etc/logrotate.d/concourse" - permissions: "0644" - owner: "root" - content: | - /var/log/concourse.log { - create 0644 root root - daily - rotate 1 - size 100M - postrotate - systemctl restart concourse-logging awslogsd - endscript - } - path: "/usr/local/scripts/cloudformation-signal.sh" permissions: "0744" owner: "root" @@ -147,14 +80,6 @@ write_files: echo "State is $${state}" done runcmd: - - | - cp /etc/awslogs/awscli.template /etc/awslogs/awscli.conf - cp /etc/awslogs/awslogs.template /etc/awslogs/awslogs.conf - - | - systemctl enable concourse-logging.service --now - systemctl enable awslogsd.service --now - systemctl enable concourse.service --now - ${start_node_exporter} - | /usr/local/scripts/cloudformation-signal.sh /opt/aws/bin/cfn-signal -e $? --stack ${stack_name} --resource AutoScalingGroup --region ${region} diff --git a/modules/cloud-config/shared.yml b/modules/cloud-config/shared.yml new file mode 100644 index 0000000..bc3b241 --- /dev/null +++ b/modules/cloud-config/shared.yml @@ -0,0 +1,76 @@ +#cloud-config +write_files: + - path: "/etc/awslogs/awscli.template" + permissions: "0644" + owner: "root" + content: | + [plugins] + cwlogs = cwlogs + [default] + region = ${region} + - path: "/etc/awslogs/awslogs.template" + permissions: "0644" + owner: "root" + content: | + [general] + state_file = /var/lib/awslogs/agent-state + + [/var/log/concourse.log] + file = /var/log/concourse.log + log_group_name = ${log_group_name} + log_stream_name = {instance_id} + - path: "/etc/systemd/system/node_exporter.service" + permissions: "0644" + owner: "root" + content: | + [Unit] + Description=Node exporter for Prometheus to scrape + Requires=network-online.target + After=network-online.target + + [Service] + Type=simple + Restart=always + ExecStart=/usr/local/bin/node_exporter + + [Install] + WantedBy=multi-user.target + - path: "/etc/systemd/system/concourse-logging.service" + permissions: "0644" + owner: "root" + content: | + [Unit] + Description=Service for Concourse logging + After=rc-local.service + + [Service] + Type=simple + Restart=always + TimeoutSec=infinity + + ExecStart=/bin/bash -c '/usr/bin/journalctl -u concourse --no-tail -f -o cat > /var/log/concourse.log' + + [Install] + WantedBy=multi-user.target + - path: "/etc/logrotate.d/concourse" + permissions: "0644" + owner: "root" + content: | + /var/log/concourse.log { + create 0644 root root + daily + rotate 1 + size 100M + postrotate + systemctl restart concourse-logging awslogsd + endscript + } +runcmd: + - | + cp /etc/awslogs/awscli.template /etc/awslogs/awscli.conf + cp /etc/awslogs/awslogs.template /etc/awslogs/awslogs.conf + - | + systemctl enable concourse-logging.service --now + systemctl enable awslogsd.service --now + systemctl enable concourse.service --now + %{if prometheus_enabled } systemctl enable node_exporter.service --now %{ endif } diff --git a/modules/worker/cloud-config.yml b/modules/cloud-config/worker.yml similarity index 63% rename from modules/worker/cloud-config.yml rename to modules/cloud-config/worker.yml index 074d67c..8fd603c 100644 --- a/modules/worker/cloud-config.yml +++ b/modules/cloud-config/worker.yml @@ -15,25 +15,6 @@ write_files: owner: "root" encoding: base64 content: ${base64encode(pub_worker_key)} - - path: "/etc/awslogs/awscli.template" - permissions: "0644" - owner: "root" - content: | - [plugins] - cwlogs = cwlogs - [default] - region = ${region} - - path: "/etc/awslogs/awslogs.template" - permissions: "0644" - owner: "root" - content: | - [general] - state_file = /var/lib/awslogs/agent-state - - [/var/log/concourse.log] - file = /var/log/concourse.log - log_group_name = ${log_group_name} - log_stream_name = {instance_id} - path: "/etc/systemd/system/concourse.service" permissions: "0644" owner: "root" @@ -70,52 +51,6 @@ write_files: [Install] WantedBy=multi-user.target - - path: "/etc/systemd/system/node_exporter.service" - permissions: "0644" - owner: "root" - content: | - [Unit] - Description=Node exporter for Prometheus to scrape - Requires=network-online.target - After=network-online.target - - [Service] - Type=simple - Restart=always - ExecStart=/usr/local/bin/node_exporter - - [Install] - WantedBy=multi-user.target - - path: "/etc/systemd/system/concourse-logging.service" - permissions: "0644" - owner: "root" - content: | - [Unit] - Description=Service for Concourse logging - After=rc-local.service - - [Service] - Type=simple - Restart=always - TimeoutSec=infinity - - ExecStart=/bin/bash -c '/usr/bin/journalctl -u concourse --no-tail -f -o cat > /var/log/concourse.log' - - [Install] - WantedBy=multi-user.target - - path: "/etc/logrotate.d/concourse" - permissions: "0644" - owner: "root" - content: | - /var/log/concourse.log { - create 0644 root root - daily - rotate 1 - size 100M - postrotate - systemctl restart concourse-logging awslogsd - endscript - } - path: "/etc/systemd/system/lifecycled.service" permissions: "0644" owner: "root" @@ -168,15 +103,9 @@ write_files: systemctl stop concourse.service runcmd: - - | - cp /etc/awslogs/awscli.template /etc/awslogs/awscli.conf - cp /etc/awslogs/awslogs.template /etc/awslogs/awslogs.conf - | systemctl enable lifecycled.service --now - systemctl enable concourse-logging.service --now - systemctl enable awslogsd.service --now - systemctl enable concourse.service --now - ${start_node_exporter} - | /usr/local/scripts/cloudformation-signal.sh /opt/aws/bin/cfn-signal -e $? --stack ${stack_name} --resource AutoScalingGroup --region ${region} + diff --git a/modules/worker/main.tf b/modules/worker/main.tf index ffdd90c..66ef95a 100644 --- a/modules/worker/main.tf +++ b/modules/worker/main.tf @@ -37,7 +37,7 @@ module "worker" { version = "3.1.0" name_prefix = "${var.name_prefix}-worker" - user_data = local.user_data + user_data = data.template_cloudinit_config.worker.rendered vpc_id = var.vpc_id subnet_ids = var.private_subnet_ids min_size = var.min_size @@ -54,22 +54,38 @@ module "worker" { } -locals { - user_data = templatefile("${path.module}/cloud-config.yml", { - stack_name = "${var.name_prefix}-worker-asg" - region = data.aws_region.current.name - lifecycle_topic = aws_sns_topic.worker.arn - lifecycled_log_group_name = aws_cloudwatch_log_group.worker_lifecycled.name - tsa_host = var.tsa_host - tsa_port = var.tsa_port - log_group_name = aws_cloudwatch_log_group.worker.name - log_level = var.log_level - worker_team = var.worker_team - worker_key = file("${var.concourse_keys}/worker_key") - pub_worker_key = file("${var.concourse_keys}/worker_key.pub") - pub_tsa_host_key = file("${var.concourse_keys}/tsa_host_key.pub") - start_node_exporter = var.prometheus_enabled ? "systemctl enable node_exporter.service --now" : "echo \"Prometheus disabled, not starting node-exporter\"" - }) +data "template_cloudinit_config" "worker" { + gzip = true + base64_encode = true + + part { + content_type = "text/cloud-config" + + content = templatefile("${path.module}/../cloud-config/shared.yml", { + region = data.aws_region.current.name + log_group_name = aws_cloudwatch_log_group.worker.name + prometheus_enabled = var.prometheus_enabled + }) + } + + part { + content_type = "text/cloud-config" + merge_type = "list(append)+dict(recurse_array)+str()" + + content = templatefile("${path.module}/../cloud-config/worker.yml", { + region = data.aws_region.current.name + stack_name = "${var.name_prefix}-worker-asg" + tsa_host = var.tsa_host + tsa_port = var.tsa_port + log_level = var.log_level + worker_team = var.worker_team + worker_key = file("${var.concourse_keys}/worker_key") + pub_worker_key = file("${var.concourse_keys}/worker_key.pub") + pub_tsa_host_key = file("${var.concourse_keys}/tsa_host_key.pub") + lifecycle_topic = aws_sns_topic.worker.arn + lifecycled_log_group_name = aws_cloudwatch_log_group.worker_lifecycled.name + }) + } } resource "aws_cloudwatch_log_group" "worker" { From 4cae81d761569f267035cc1f57f4e1b9df907b4b Mon Sep 17 00:00:00 2001 From: itsdalmo Date: Thu, 15 Aug 2019 14:53:51 +0200 Subject: [PATCH 3/4] Fix failing tests --- modules/atc/main.tf | 2 +- modules/cloud-config/atc.yml | 2 +- modules/worker/main.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/atc/main.tf b/modules/atc/main.tf index a32483d..3ea65ef 100644 --- a/modules/atc/main.tf +++ b/modules/atc/main.tf @@ -68,7 +68,7 @@ module "atc" { } data "template_cloudinit_config" "atc" { - gzip = true + gzip = false base64_encode = true part { diff --git a/modules/cloud-config/atc.yml b/modules/cloud-config/atc.yml index adb3b91..d08b2c1 100644 --- a/modules/cloud-config/atc.yml +++ b/modules/cloud-config/atc.yml @@ -49,7 +49,7 @@ write_files: Environment="CONCOURSE_AWS_SECRETSMANAGER_REGION=${region}" %{ if local_user != "" }Environment="CONCOURSE_ADD_LOCAL_USER=${local_user}"%{ endif } - %{ if local_admin_user != "" }Environemnt="CONCOURSE_MAIN_TEAM_LOCAL_USER=${local_admin_user}"%{ endif } + %{ if local_admin_user != "" }Environment="CONCOURSE_MAIN_TEAM_LOCAL_USER=${local_admin_user}"%{ endif } %{ if length(github_users) > 0 }Environment="CONCOURSE_MAIN_TEAM_GITHUB_USER=${join(",", github_users)}"%{ endif } %{ if length(github_teams) > 0 }Environment="CONCOURSE_MAIN_TEAM_GITHUB_TEAM=${join(",", github_teams)}"%{ endif } %{ if prometheus_enabled }Environment="CONCOURSE_PROMETHEUS_BIND_IP=0.0.0.0"%{ endif } diff --git a/modules/worker/main.tf b/modules/worker/main.tf index 66ef95a..367c30f 100644 --- a/modules/worker/main.tf +++ b/modules/worker/main.tf @@ -55,7 +55,7 @@ module "worker" { } data "template_cloudinit_config" "worker" { - gzip = true + gzip = false base64_encode = true part { From 9cf29715b9f8d15c68ef073ae59dba4fa856b2cd Mon Sep 17 00:00:00 2001 From: itsdalmo Date: Thu, 15 Aug 2019 14:58:40 +0200 Subject: [PATCH 4/4] Rename cloud-config directory --- modules/atc/main.tf | 4 ++-- modules/{cloud-config => cloud-init}/atc.yml | 0 modules/{cloud-config => cloud-init}/shared.yml | 0 modules/{cloud-config => cloud-init}/worker.yml | 0 modules/worker/main.tf | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) rename modules/{cloud-config => cloud-init}/atc.yml (100%) rename modules/{cloud-config => cloud-init}/shared.yml (100%) rename modules/{cloud-config => cloud-init}/worker.yml (100%) diff --git a/modules/atc/main.tf b/modules/atc/main.tf index 3ea65ef..961e083 100644 --- a/modules/atc/main.tf +++ b/modules/atc/main.tf @@ -74,7 +74,7 @@ data "template_cloudinit_config" "atc" { part { content_type = "text/cloud-config" - content = templatefile("${path.module}/../cloud-config/shared.yml", { + content = templatefile("${path.module}/../cloud-init/shared.yml", { region = data.aws_region.current.name log_group_name = aws_cloudwatch_log_group.atc.name prometheus_enabled = var.prometheus_enabled @@ -85,7 +85,7 @@ data "template_cloudinit_config" "atc" { content_type = "text/cloud-config" merge_type = "list(append)+dict(recurse_array)+str()" - content = templatefile("${path.module}/../cloud-config/atc.yml", { + content = templatefile("${path.module}/../cloud-init/atc.yml", { region = data.aws_region.current.name stack_name = "${var.name_prefix}-atc-asg" target_group = aws_lb_target_group.internal.arn diff --git a/modules/cloud-config/atc.yml b/modules/cloud-init/atc.yml similarity index 100% rename from modules/cloud-config/atc.yml rename to modules/cloud-init/atc.yml diff --git a/modules/cloud-config/shared.yml b/modules/cloud-init/shared.yml similarity index 100% rename from modules/cloud-config/shared.yml rename to modules/cloud-init/shared.yml diff --git a/modules/cloud-config/worker.yml b/modules/cloud-init/worker.yml similarity index 100% rename from modules/cloud-config/worker.yml rename to modules/cloud-init/worker.yml diff --git a/modules/worker/main.tf b/modules/worker/main.tf index 367c30f..4b3724f 100644 --- a/modules/worker/main.tf +++ b/modules/worker/main.tf @@ -61,7 +61,7 @@ data "template_cloudinit_config" "worker" { part { content_type = "text/cloud-config" - content = templatefile("${path.module}/../cloud-config/shared.yml", { + content = templatefile("${path.module}/../cloud-init/shared.yml", { region = data.aws_region.current.name log_group_name = aws_cloudwatch_log_group.worker.name prometheus_enabled = var.prometheus_enabled @@ -72,7 +72,7 @@ data "template_cloudinit_config" "worker" { content_type = "text/cloud-config" merge_type = "list(append)+dict(recurse_array)+str()" - content = templatefile("${path.module}/../cloud-config/worker.yml", { + content = templatefile("${path.module}/../cloud-init/worker.yml", { region = data.aws_region.current.name stack_name = "${var.name_prefix}-worker-asg" tsa_host = var.tsa_host