AWS ECS Periodic job - automatically scales, for example

Amazon ECS provides really good service for scheduled tasks: ECS scheduled tasks that work very well. However, it is important that one instance of ECS is always stored in ECS. What is the best way:

  • Launch / scale in an ECS instance for a periodic job (just before the task);
  • Starting ECS ​​tasks for a newly created instance;
  • Finish / deploy instance after completion.

One possible way to solve the problem is to write a lambda that will do smth. ( run ec2 ), but it looks like too much pain.

+4
source share
1 answer

Finally, I found an easy solution to this problem. Everything was pretty simple:

  • Go to the autosave groups (this can be found in the EC2-> Autoscaling dashboard section);
  • Create a planned action (in this case, the required frequency can be specified for the container instance);
  • Save the configuration. The instance will be added at the specified time.
  • In my case, I also need to reduce this instance in 1 hour.
+4
source

Source: https://habr.com/ru/post/1689472/


All Articles