Triggers define when a function runs. When an event matches a trigger's rules, the event source invokes the associated function automatically.
One-way integrated triggers—such as the API Gateway trigger—are configured on the event source side and cannot be modified in the Function Compute console. This page does not cover one-way integrated trigger setup.
How it works
Two-way integrated triggers are created and managed in the Function Compute console. When an event occurs on the source service—such as a new object uploaded to OSS or a message published to a Kafka topic—the source service pushes the event to Function Compute, which invokes your function.
One-way integrated triggers work differently: the trigger configuration lives on the event source side (for example, API Gateway or Application Load Balancer), and they cannot be configured from the Function Compute console.
A function supports up to 10 triggers.
Prerequisites
Before you begin, ensure that you have:
Choose a trigger
The table below lists all supported triggers and their typical use cases to help you choose the right one.
Two-way integrated triggers
| Trigger | Typical use case |
|---|---|
| Time trigger | Run scheduled jobs (cron-based) |
| OSS trigger | Process files uploaded to Object Storage Service |
| SLS trigger | Analyze or forward Simple Log Service log data |
| CDN trigger | React to CDN events (refresh, push) |
| Tablestore trigger | Respond to Tablestore data changes |
| HTTP trigger | Expose a function as an HTTP endpoint |
| Simple Message Queue (formerly MNS) topic trigger | Consume Simple Message Queue topic messages |
| Simple Message Queue (formerly MNS) queue trigger | Consume Simple Message Queue messages |
| RocketMQ trigger | Consume ApsaraMQ for RocketMQ messages |
| RabbitMQ trigger | Consume ApsaraMQ for RabbitMQ messages |
| Kafka trigger | Consume ApsaraMQ for Kafka messages |
| DTS trigger | Respond to Data Transmission Service data migration or sync events |
| MQTT trigger | Process ApsaraMQ for MQTT IoT device messages |
| Self-managed Apache RocketMQ trigger | Consume messages from a self-managed Apache RocketMQ cluster |
One-way integrated triggers
| Trigger | Typical use case |
|---|---|
| API Gateway trigger | Invoke a function through API Gateway |
| Cloud-native API Gateway trigger | Invoke a function through the cloud-native API Gateway |
| ALB trigger | Invoke a function behind an Application Load Balancer (ALB) |
Cloud service event triggers
| Trigger | Typical use case |
|---|---|
| Cloud service event trigger | Respond to Alibaba Cloud service events |
Update a trigger
This procedure does not apply to Simple Message Queue (formerly MNS) topic triggers or Tablestore triggers.
Log on to the Function Compute console. In the left-side navigation pane, click Functions.
In the top navigation bar, select a region. On the Functions page, click the function you want to manage.
On the function details page, click the Trigger tab. In the trigger list, click Modify in the Actions column for the trigger you want to update.
In the Edit Trigger panel, update the trigger configuration as needed. Click OK.
To delete an unused trigger, follow the prompts on the Trigger tab.