ALIYUN::FC3::Trigger类型用于创建函数计算 FC 3.0触发器。
语法
{
"Type": "ALIYUN::FC3::Trigger",
"Properties": {
"FunctionName": String,
"TriggerType": String,
"TriggerName": String,
"TriggerConfig": Map,
"Description": String,
"InvocationRole": String,
"Qualifier": String,
"SourceArn": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
FunctionName | String | 是 | 否 | 函数名称。 | 无 |
TriggerType | String | 是 | 否 | 触发器的类型。 | 无 |
TriggerName | String | 是 | 否 | 触发器的名称。 | 要求只能包含字母、数字、下划线(_)和短划线(-)。不能以数字、短划线(-)开头,长度限制为 1~128 个字符。 |
TriggerConfig | Map | 是 | 是 | 触发器配置。 | 无 |
Description | String | 否 | 是 | 触发器描述。 | 无 |
InvocationRole | String | 否 | 是 | 事件源(如 OSS)调用函数所需的角色。 | 无 |
Qualifier | String | 否 | 是 | 函数的版本或别名。 | 无 |
SourceArn | String | 否 | 否 | 触发器事件源的 Aliyun Resource Name。 | 无 |
返回值
Fn::GetAtt
FunctionName:函数名称。
UrlIntranet:私网连接地址。
TriggerName:触发器的名称。
TriggerId:触发器ID。
UrlInternet:公网连接地址。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TriggerType:
Type: String
Description:
en: Type of the trigger.
Required: true
FunctionName:
Type: String
Description:
en: The name of the function.
Required: true
TriggerName:
Type: String
Description:
en: Name of the trigger.
Required: true
TriggerConfig:
Type: Json
Description:
en: Trigger config.
Required: true
Resources:
Trigger:
Type: ALIYUN::FC3::Trigger
Properties:
TriggerType:
Ref: TriggerType
FunctionName:
Ref: FunctionName
TriggerName:
Ref: TriggerName
TriggerConfig:
Ref: TriggerConfig
Outputs:
FunctionName:
Description: Function name.
Value:
Fn::GetAtt:
- Trigger
- FunctionName
UrlIntranet:
Description: The private endpoint. In a VPC, you can access HTTP triggers by using HTTP or HTTPS.
Value:
Fn::GetAtt:
- Trigger
- UrlIntranet
TriggerName:
Description: Trigger name.
Value:
Fn::GetAtt:
- Trigger
- TriggerName
TriggerId:
Description: The trigger ID.
Value:
Fn::GetAtt:
- Trigger
- TriggerId
UrlInternet:
Description: The public domain address. You can access HTTP triggers over the Internet by using HTTP or HTTPS.
Value:
Fn::GetAtt:
- Trigger
- UrlInternet
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TriggerType": {
"Type": "String",
"Description": {
"en": "Type of the trigger."
},
"Required": true
},
"FunctionName": {
"Type": "String",
"Description": {
"en": "The name of the function."
},
"Required": true
},
"TriggerName": {
"Type": "String",
"Description": {
"en": "Name of the trigger."
},
"Required": true
},
"TriggerConfig": {
"Type": "Json",
"Description": {
"en": "Trigger config."
},
"Required": true
}
},
"Resources": {
"Trigger": {
"Type": "ALIYUN::FC3::Trigger",
"Properties": {
"TriggerType": {
"Ref": "TriggerType"
},
"FunctionName": {
"Ref": "FunctionName"
},
"TriggerName": {
"Ref": "TriggerName"
},
"TriggerConfig": {
"Ref": "TriggerConfig"
}
}
}
},
"Outputs": {
"FunctionName": {
"Description": "Function name.",
"Value": {
"Fn::GetAtt": [
"Trigger",
"FunctionName"
]
}
},
"UrlIntranet": {
"Description": "The private endpoint. In a VPC, you can access HTTP triggers by using HTTP or HTTPS.",
"Value": {
"Fn::GetAtt": [
"Trigger",
"UrlIntranet"
]
}
},
"TriggerName": {
"Description": "Trigger name.",
"Value": {
"Fn::GetAtt": [
"Trigger",
"TriggerName"
]
}
},
"TriggerId": {
"Description": "The trigger ID.",
"Value": {
"Fn::GetAtt": [
"Trigger",
"TriggerId"
]
}
},
"UrlInternet": {
"Description": "The public domain address. You can access HTTP triggers over the Internet by using HTTP or HTTPS.",
"Value": {
"Fn::GetAtt": [
"Trigger",
"UrlInternet"
]
}
}
}
}
文档内容是否对您有帮助?