1
votes

I have one ECS Cluster with two ASGs. The ASGs use different AMIs. Also, I have two ECS Services.

Each service needs to be launched on a different ASG (one reason is the services require different AMIs).

In other words, I'd like to run Service 1 on ASG 1 and the Service 2 on ASG 2, with both ASGs in the same Cluster.

Given a Cluster, I can't find a way to point a service to a specific ASG. One hack I've managed to work around this problem is creating two ECS Clusters with one ASG each.

AWS ECS Service Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html

1
Trying to understand your use-case, can you not create an AMI that supports both services?RaGe

1 Answers

2
votes

Use ECS task placement constraints.

You can use built-in attribute ecs.ami-id directly, or you can define custom attributes by ASG.