Updated on 2023-11-22 GMT+08:00

Events

Simply put, events are the things that trigger your functions to run.

If you are using Huawei Cloud as your provider, events in the service are limited to the Huawei Cloud APIG and OBS. For details, see Event list.

Upon deployment, the Framework will set up the corresponding event configuration your function should listen to.

Configuration

Events belong to each function and can be found in the events attribute in serverless.yml.
# serverless.yml
functions:
  first: # Function name
    handler: index.http # Reference to file index.js & exported function 'http'
    events:
      - apigw:
          env_id: DEFAULT_ENVIRONMENT_RELEASE_ID
          env_name: RELEASE
          req_method: GET
          path: /test
          name: API_test

Currently, only one event definition per function is supported.

Types

The Serverless Framework supports OBS and APIG events of the FunctionGraph. For details, see Event list.

Deployment

To deploy or update your functions and events, run:
serverless deploy