create cron
Point EventBridge at a utopia function on a schedule.
bash
awsutopia create cron <schedule> --fn <name> --name <rule-name> [--dry-run] [--json]What you'll get
An EventBridge rule named utopia-{project}-{env}-cron-{name} targeting your function, with utopia tags.
bash
awsutopia create fn cleanup --src ./cleanup
awsutopia create cron "0 * * * *" --fn cleanup --name hourly| Arg / flag | Notes |
|---|---|
<schedule> | 5-field cron (0 * * * *) or raw rate(…) / cron(…) |
--fn | Short function name (must already exist as a utopia fn) |
--name | Short rule name |
5-field cron is converted to EventBridge's 6-field form for you. Bad schedule → exit 2 (INVALID_SCHEDULE).
Next
destroy cron when the schedule is done. logs on the function to see invocations.