0

Currently, with rexray, I'm creating an EBS volume per task on each availability zone. I'm looking for a way in which I could create a separate, independent volume for each task instance. To illustrate:

  • 1 ECS service configured across 2 availability zones, set task desired count to 3
  • Task definition that creates an EBS volume
  • The above two creates two volumes, one in each AZ

In the above scenario, two tasks would connect to one volume, and the other task to the other volume.

Is there any way in which I could provision an EBS volume for each instance of a task? The main goal is to have many instances of a task with each their own volume, it would not be a problem if they are attached in a different order when there's a redeployment, but it is important that two tasks do not use the same volume.

TylerH
  • 20,799
  • 66
  • 75
  • 101
agermain
  • 122
  • 11

1 Answers1

0

You can't do this. Instances of tasks in an ECS service are meant to be interchangeable, disposable and same.

I think that for your use-case, a EFS would be better, as you can programmatically, from your app, control access to it.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • 1
    Thanks for the answer. How could one orchestrate this via EFS? The workloads running are identical and there is no need to share disk between them. It seems as if this could be done on an ECS service basis, but it's unfeasible since I can't set to scale the amount of services, only the amount of tasks within such services. – agermain Jul 30 '21 at 09:17