Walid Elnozahy 4139098261
chore: update docs frontmatter (#12677)
* chore: update docs frontmatter

* fix: frontmatter to comments
2024-07-10 17:48:57 +03:00

1.2 KiB

AWS - Generate Event

Creates sample Lambda function payloads for different types of events.

serverless generate-event --type eventType

Options

  • --type or -t The type of the event to generate payload for. Required.
  • --body or -b The body for the message, request, or stream event.

Available event types

  • aws:alexaSkill
  • aws:alexaSmartHome
  • aws:apiGateway
  • aws:cloudWatch
  • aws:cloudWatchLog
  • aws:cognitoUserPool
  • aws:dynamo
  • aws:iot
  • aws:kinesis
  • aws:s3
  • aws:sns
  • aws:sqs
  • aws:websocket

Examples

Generate SQS event payload

serverless generate-event -t aws:sqs

Generate Kinesis event payload with body

serverless generate-event -t aws:kinesis -b '{"foo": "bar"}'

Generate SQS event and save it to a file

serverless generate-event -t aws:sqs > event.json