@events

Define SNS topics 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

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"

Running arc create generates the following handlers:

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