Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default event payload for scheduled when "input" not specified in serverless.yml #879

Merged
merged 1 commit into from Feb 2, 2020
Merged

Provide default event payload for scheduled when "input" not specified in serverless.yml #879

merged 1 commit into from Feb 2, 2020

Conversation

coyoteecd
Copy link
Contributor

Fixes #878 by emulating the behavior of AWS Lambda as explained in the issue.
When serverless.yml has no input defined for the scheduled event payload, one is generated emulating the one you get from AWS.

The generated object looks like this:

{
      version: '0',
      id: 'random-event-id',
      account: 'random-account-id',
      region: 'xxx' // actual region from serverless.yml
      time: 'xxxx' // generated on every call via new Date().toISOString()
      'detail-type': 'Scheduled Event',
      detail: {},
      source: 'aws.events'
}

@dnalborczyk dnalborczyk merged commit 936d78c into dherault:master Feb 2, 2020
@dnalborczyk
Copy link
Collaborator

thank you @coyoteecd !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scheduled event undefined when "input" not specified in serverless.yml
2 participants