https://pulumi.com logo
Title
w

white-secretary-18260

03/29/2021, 7:26 PM
Is there a way to set up and configure schedule
Fargate Task Definitions
in an
ECS cluster
with an
Event Rule
with
cron
? If so what’s a good example?
m

millions-furniture-75402

03/29/2021, 7:52 PM
With Lambda it looks something like:
// CloudWatch cron trigger
const syncLambdaSchedule = "cron(0 0 * * ? *)";
const syncLambdaRuleHandler: aws.cloudwatch.EventRuleEventHandler = syncLambda;
aws.cloudwatch.onSchedule(`${appName}-event`, syncLambdaSchedule, syncLambdaRuleHandler);
w

white-secretary-18260

03/29/2021, 8:01 PM
Thanks, I will play around with this.
m

microscopic-dress-1605

04/01/2021, 3:25 PM
It’s called scheduled ECS tasks. You can set that up using CloudWatch scheduled events. They support cron expressions and rate expressions. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduled_tasks.html