1

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

Alex Walczak
  • 1,276
  • 1
  • 12
  • 27
  • Trying to understand your use-case, can you not create an AMI that supports both services? – RaGe Apr 09 '18 at 18:09

1 Answers1

2

Use ECS task placement constraints.

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

RaGe
  • 22,696
  • 11
  • 72
  • 104