All Products
Search
Document Center

CDN:AddFCTrigger

Last Updated:Aug 28, 2026

Adds an FC trigger to Alibaba Cloud CDN, linking a CDN event to a Function Compute function so the function runs automatically when the event fires.

Debugging

Debug

Call this API operation directly in OpenAPI Explorer. OpenAPI Explorer calculates the signature automatically and generates SDK sample code.

Authorization information

The following table describes the Resource Access Management (RAM) authorization required for this operation. Use the Action element in a RAM policy to grant a RAM user or RAM role permission to call this operation.

OperationAccess levelResource typeCondition keyAssociated operation
cdn:AddFCTriggercreate*All Resourcesnonenone

Column descriptions:

  • Operation: The value to use in the Action policy element.

  • Access level: read, write, or list.

  • Resource type: The resource on which you can authorize the RAM user or role. Required resource types are shown in bold. If permissions cannot be granted at the resource level, the column shows All Resources.

  • Condition key: The condition key defined by the cloud service.

  • Associated operation: Other operations the RAM user or role must be permitted to perform to complete this operation.

Request parameters

ParameterTypeRequiredDescriptionExample
TriggerARNstringYesThe ARN of the Function Compute trigger.acs:fc:cn-beijing:1234567890:services/FCTestService/functions/printEvent/triggers/testtrigger
EventMetaNamestringYesThe name of the event.LogFileCreated
EventMetaVersionstringYesThe version of the event.1.0.0
SourceARNstringYesThe ARN identifying the CDN resources and filters for event listening.acs:cdn:*:1234567890:domain/example.com
FunctionARNstringNoThe ARN of the Function Compute function.acs:fc:1223455566666:123:services/myservice/functions/myfunction
RoleARNstringYesThe ARN of the RAM role to assume when invoking the function.acs:ram::1234567890:role/aliyuncdneventnotificationrole
NotesstringYesThe remarks for the FC trigger.test

SourceARN format

SourceARN follows the format acs:cdn:{RegionID}:{AccountID}:{Filter}.

  • Filter format: {FilterName}/{FilterValue}. To specify multiple values for FilterValue, separate them with commas (,) and enclose them in braces ({}).

  • Example — single domain: Setting Filter to domain/example.com causes only example.com to trigger the function.

  • Example — multiple domains: Setting Filter to domain/{example.com,aliyundoc.com} causes both domains to trigger the function. The LogFileCreated event supports domain as the FilterName.

  • Multiple filters: Separate filters with forward slashes (/), which apply AND logic. Format: acs:cdn:{RegionID}:{AccountID}:{Filter1}/{Filter2}/{Filter3}...

Response parameters

ParameterTypeDescriptionExample
RequestIdstringThe request ID.EC046C5D-8CB4-4B6B-B7F8-B335E51EF90

Examples

Sample success response in JSON format:

{
  "RequestId": "EC046C5D-8CB4-4B6B-B7F8-B335E51EF90"
}

Error codes

HTTP status codeError codeError message
400NotFound.EventMetaEventMeta not found.
400Duplicated.FCTriggerFCTrigger has already existed.
400InvalidParameter.TriggerARNThe specified parameter TriggerARN is not valid.
400InvalidParameter.SourceARNThe specified parameter SourceARN is not valid.
400InvalidParameter.FunctionARNThe specified parameter FunctionARN is not valid.
400InvalidParameter.RoleARNThe specified parameter RoleARN is not valid.
403PermissionDenyNo permission to operate this FCTrigger.

For a full list of error codes, see Service error codes.

Change history

Change timeSummary of changesOperation
2024-12-18API description update. The error code has changed.View change details