1

I need to calculate the task on my Fargate cluster and after finishing calculating the task should be stopped or terminated to decrease payments.

The consequence of my actions:

  1. One task always running on EC2 Cluster and checking DB to the new data.
  2. If new data appears, Boto3 runs the Fargate container.
  3. After the job is done, the task should be stopped.

Also if in the DB appears the second row of data during proceeding the first task, Fargate should create a second task for the second job. and then stop tasks...

So, I have:

  • Task written on Python and deployed on ECR
  • Fargate cluster
  • Task definition (describe Memory, CPU's and container)

How task know, that it should be closed? Any idea or solution to stop task after job done?

Igor-Potapov
  • 43
  • 2
  • 9
  • I am curious, do you want a new task whenever there is a new record in DB? can you elaborate on the use case and what kind of system it is? you can terminate a specific task using boto 3. I don't wanna take my time answering something that might not match your use case. I don't see any cost optimisation here. – Nick Mar 06 '22 at 07:53

0 Answers0