LoginSignup
11
7

More than 3 years have passed since last update.

Amazon ECS の「タスクのスケジューリング」利用時の注意点

Last updated at Posted at 2019-06-26

概要

cron式はUTC

参照:タスクのスケジューリング (cron)

  • 例えば、cron式で cron(0 10 * * ? *) と設定した場合、毎日 10:00 (UTC) に実行する。
  • 日本時間で毎日 10:00 に実行させるには、cron式で cron(0 1 * * ? *) と設定する(JST=UTC+9)。

スケジュールされた期間に対して同じルールを複数回トリガーする可能性がある

参照:1 つのイベントに応じてルールが複数回トリガーされました

  • タスクの起動タイプ(ECS/Fargate)によらず、上記挙動が発生する可能性がある。これは、CloudWatch Events の仕様なので、どうしようもない(実際にAWSサポートに確認済)。
  • この挙動が発生した場合、複数回トリガーがするということは、複数回タスクが実行されコンテナが作られるということ。
    なので、タスク内の処理は重複実行に対応した形で実装しておく必要がある。
11
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
7