Run a task every hour - using containers

0

I am looking to use containers to run a task every hour using containers. Imagine the task takes 20 minutes, so it's not suitable for lambda, and it's not suitable for EC2, since 40 minutes out of every hour the instance would be idle.

I have created a container that runs one simple task, (writes a row into a database) then stops. I created a docker container, pushed this to ECR, then created an ECS task that appears to run the task constantly (starting / restarting). I set the number of tasks to 0 for the cluster to stop this behaviour.

I then created a schedule using AWS event bridge, and set it to run the task every hour, but it's not running at all.

Can anyone suggest something that I should look at to achieve the desired scheduled task?

1개 답변
2

I found the solution myself : I was using a ECS service, rather than an ECS scheduled task, which then solved the problem.

Here's the full answer: https://blog.dotnetframework.org/2022/11/29/running-a-scheduled-task-on-aws-a-workaround-for-the-15-minute-lambda-limit/

profile picture
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠