How can I connect my autoscaling group to my ecs cluster?

前端 未结 3 976
独厮守ぢ
独厮守ぢ 2021-01-31 02:52

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

3条回答
  •  你的背包
    2021-01-31 03:10

    I was struggling with this for a while. The key to getting the instances in the autoscaling group associated with your ECS cluster is in the user data. When you are creating your launch config when you get to step 3 "Configure Details" hit the advanced tab and enter a simple bash script like the following for your user data.

    #!/usr/bin/env bash
    echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config
    

    All the available parameters for agent configuration can be found here http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html

提交回复
热议问题