aws-lambdaserverless-frameworkamazon-cloudwatch-events

Serverless Framework - unrecognized property 'params'


I am trying to create a scheduled lambda function using the Serverless framework and to send it different parameters from different events.

here is my serverless configuration:

functions:
  profile:
    timeout: 10
    handler: profile.profile
    events:
      - schedule:
          rate: rate(1 minute)
          params:
            hello: world

The issue is that when I run sls deploy, I get the following error:

Serverless:   at 'functions.profile.events[0]': unrecognized property 'params'

This is basically copied from the documentation here, so should work...

Am I missing something?


Solution

  • The documentation you're referencing is for Apache Open Whisk.

    If you're using AWS, you'll need to use input as shown in the aws documentation

    functions:
      aggregate:
        handler: statistics.handler
        events:
          - schedule:
              rate: rate(10 minutes)
              enabled: false
              input:
                key1: value1
                key2: value2
                stageParams:
                  stage: dev