@events

Define SNS topics with Lambda handler functions.

Syntax

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

Events can use more verbose configuration to allow for custom source paths in your project. Provide a src for each event.

Example

These configuration examples show how to define events:

arc
@app
myapp

@events
hit-counter
likes
# verbose custom source:
custom-webhook
  src custom/source

json
{
  "app": "myapp",
  "events": [
    "hit-counter",
    "likes",
    {
      "custom-webhook": {
        "src": "custom/source"
      }
    }
  ]
}
yaml
---
app: "myapp"
events:
- hit-counter
- likes
# verbose custom source:
- "custom-webhook":
    src: "custom/source"
toml
app="myapp"
events=[
  "hit-counter",
  "likes"
]

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

[[events]]
[events."custom-webhook"]
src = "custom/source"

Which generates the following scaffolding:

/
├── custom
│   └── source/
├── src
│   └── events
│     ├── hit-counter/
│     └── likes/
├── app.arc
└── package.json