@scheduled

Define EventBridge schedule expressions with Lambda handler functions.

Syntax

  • Lower + upper case alphanumeric string
  • Maximum of 240 characters
  • Dashes, periods, and underscores are allowed
  • Must begin with a letter
  • Followed by a valid rate or cron expression (more info here)

Scheduled functions can use more verbose configuration to allow for custom source paths in your project. Provide a rate or cron and src for each event.

Example

These configuration examples show how to define scheduled functions:

arc
@app
myapp

@scheduled
daily-update-buddy rate(1 day)
friyay-only cron(0 15 ? * FRI *)
# verbose custom source:
annual-review
  rate 1 year
  src custom/source
json
{
  "app": "myapp",
  "scheduled": {
    "daily-update-buddy": "rate(1 day)",
    "friyay-only": "cron(0 15 ? * FRI *)" },
    "annual-review": {
      "rate": [1, "year"],
      "src": "whatever/schedueld/dir/you/want"
    }
}
yaml
---
app: myapp
scheduled:
  - daily-update-buddy: rate(1 day)
  - friyay-only: cron(0 15 ? * FRI *)
  # verbose custom source:
  - "annual-review":
      rate:
        - 1,
        - year
      src: "custom/source"

Which generates the following scaffolding:

/
├── custom
│   └── source/
├── src/
│   └── scheduled/
│       ├── daily-update-buddy/
│       └── friyay-only/
├── app.arc
└── package.json