When you run your ECS on Bottlerocket OS images, make sure that your user data is configured correctly.
❌ Wrong way:
module "autoscaling" {
source = "terraform-aws-modules/autoscaling/aws"
version = "8.3.0"
for_each = {
# On-demand instances
ex_1 = {
instance_type = t3.micro
user_data = <<-EOT
#!/bin/bash
cat <<'EOF' >> user-data.toml
[settings.ecs]
cluster = "ecs-cluster"
EOF
EOT
}
}
✅ Right way:
module "autoscaling" {
source = "terraform-aws-modules/autoscaling/aws"
version = "8.3.0"
for_each = {
# On-demand instances
ex_1 = {
instance_type = t3.micro
user_data = <<-EOT
[settings.ecs]
cluster = "ecs-cluster"
EOT
}
}
Top comments (0)