I have a EventBridge rule with the cron pattern cron(0/15 * ? * * *)
, which trigger an ECS task every 15 mins.
Is it possible to pass the trigger time to ECS task definition as a parameter? E.g., if the event is triggered on 2021-12-23T22:15:00Z
.
[
{
...
"entryPoint": ["some_command", "--cron-time", "2021-12-23T22:15:00Z"],
...
}
]
One solution in my mind is that I can create 672 (4 per hour * 24 hours * 7 days) of EventBridge rule/ECS task definition pairs, but it seems less than ideal.
Another solution will probably be a single rule that triggers a Lambda as a middle function to construct the parameter. However, I will prefer to have a no-code solution.
Thank you so much for your attention.