@scheduled

Define EventBridge schedule expressions with Lambda handler functions.

Syntax

  • Name

    • Lowercase alphanumeric string
    • Maximum of 20 characters
    • Dashes are allowed; underscores are not allowed
    • Must begin with a letter
  • Interval

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"
toml
app="myapp"

[scheduled]
daily-update-buddy="rate(1 day)"
friyay-only="cron(0 15 ? * FRI *)"

# TOML doesn't allow mixed types in an array.
# Theoretically a "table" entry with a custom source would look like:

[scheduled."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