Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

In all tutorials for ECS you need to create a cluster and after that an autoscaling group, that will spawn instances. Somehow in all these tutorials the instances magically show up in the cluster, but no one gives a hint what's connecting the autoscaling group and the cluster.

my autoscaling group spawns instances as expected, but they just don't show up on my ecs cluster, who holds my docker definitions.

Where is the connection I'm missing?

1 Answer

0 votes
by (44.4k points)

To get instances in the autoscaling group with your ECS cluster is in the user data. When you arrive at step 3 “Configure details” while you are creating your launch configuration. Now, click on the advanced tab and enter this bash script for your user data.

#!/usr/bin/env bash

echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config

All the parameters for configuring your agent can be found in this document.

http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Browse Categories

...