Trigger Management

更新时间:
复制 MD 格式

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

TriggerTypical use case
Time triggerRun scheduled jobs (cron-based)
OSS triggerProcess files uploaded to Object Storage Service
SLS triggerAnalyze or forward Simple Log Service log data
CDN triggerReact to CDN events (refresh, push)
Tablestore triggerRespond to Tablestore data changes
HTTP triggerExpose a function as an HTTP endpoint
Simple Message Queue (formerly MNS) topic triggerConsume Simple Message Queue topic messages
Simple Message Queue (formerly MNS) queue triggerConsume Simple Message Queue messages
RocketMQ triggerConsume ApsaraMQ for RocketMQ messages
RabbitMQ triggerConsume ApsaraMQ for RabbitMQ messages
Kafka triggerConsume ApsaraMQ for Kafka messages
DTS triggerRespond to Data Transmission Service data migration or sync events
MQTT triggerProcess ApsaraMQ for MQTT IoT device messages
Self-managed Apache RocketMQ triggerConsume messages from a self-managed Apache RocketMQ cluster

One-way integrated triggers

TriggerTypical use case
API Gateway triggerInvoke a function through API Gateway
Cloud-native API Gateway triggerInvoke a function through the cloud-native API Gateway
ALB triggerInvoke a function behind an Application Load Balancer (ALB)

Cloud service event triggers

TriggerTypical use case
Cloud service event triggerRespond to Alibaba Cloud service events

Update a trigger

This procedure does not apply to Simple Message Queue (formerly MNS) topic triggers or Tablestore triggers.
  1. Log on to the Function Compute console. In the left-side navigation pane, click Functions.

  2. In the top navigation bar, select a region. On the Functions page, click the function you want to manage.

  3. 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.

  4. 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.