
# 事件
简单地说，事件主要用于触发函数运行。
如果您选择华为云作为提供商，则服务中的events仅限于华为云API网关（APIG）和OBS，具体详情请参见[事件列表](https://support.huaweicloud.com/devg-functiongraph/functiongraph_02_0755.html)。
部署后，Framework将设置您的function应该侦听的相应事件配置。
#### 配置
事件属于每个函数，可以在serverless.yml的events属性中找到。
```
# 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
```
![](https://support.huaweicloud.com/devg-functiongraph/public_sys-resources/note_3.0-zh-cn.png)
目前，每个函数只支持一个事件定义。
#### 类型
Serverless Framework支持华为云函数工作流的obs和APIG事件，详细信息请参见[事件列表](https://support.huaweicloud.com/devg-functiongraph/functiongraph_02_0755.html)。
#### 部署
要部署或更新函数和事件，请运行：
```
serverless deploy
```
