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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ