ALIYUN::FC3::AsyncInvokeConfig类型用于设置函数异步配置。
语法
{
"Type": "ALIYUN::FC3::AsyncInvokeConfig",
"Properties": {
"FunctionName": String,
"AsyncTask": Boolean,
"DestinationConfig": Map,
"MaxAsyncEventAgeInSeconds": Integer,
"MaxAsyncRetryAttempts": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
FunctionName | String | 是 | 否 | 函数名称。 | 无 |
AsyncTask | Boolean | 否 | 否 | 是否开启异步任务。 | 无 |
DestinationConfig | Map | 否 | 否 | 目标配置。 | 更多信息,请参考DestinationConfig属性。 |
MaxAsyncEventAgeInSeconds | Integer | 否 | 否 | 事件最大存活时间。 | {'Range': {'Min': 1, 'Max': 604800}} |
MaxAsyncRetryAttempts | Integer | 否 | 否 | 异步调用重试次数。 | 无 |
DestinationConfig语法
"DestinationConfig": {
"OnSuccess": Map,
"OnFailure": Map
}
DestinationConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
OnSuccess | Map | 否 | 否 | 成功的回调目标结构体。 | 更多信息,请参考OnSuccess属性。 |
OnFailure | Map | 否 | 否 | 失败的回调目标结构体。 | 更多信息,请参考OnFailure属性。 |
OnSuccess语法
"OnSuccess": {
"Destination": String
}
OnSuccess属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Destination | String | 是 | 否 | 异步调用目标资源描述符。 | 无 |
OnFailure语法
"OnFailure": {
"Destination": String
}
OnFailure属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Destination | String | 是 | 否 | 异步调用目标资源描述符。 | 无 |
返回值
Fn::GetAtt
无
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
FunctionName:
Type: String
Description:
en: Function name.
Required: true
DestinationConfig:
AssociationPropertyMetadata:
Parameters:
OnSuccess:
AssociationPropertyMetadata:
Parameters:
Destination:
Type: String
Description:
en: Asynchronous invocation target resource descriptor.
Required: true
MaxLength: 512
Type: Json
Description:
en: Successful callback target structure.
Required: false
OnFailure:
AssociationPropertyMetadata:
Parameters:
Destination:
Type: String
Description:
en: Asynchronous invocation target resource descriptor.
Required: true
MaxLength: 512
Type: Json
Description:
en: Failed callback target structure.
Required: false
Type: Json
Description:
en: Configuration structure of asynchronous invocation target (optional).
Required: false
Resources:
AsyncInvokeConfig:
Type: ALIYUN::FC3::AsyncInvokeConfig
Properties:
FunctionName:
Ref: FunctionName
DestinationConfig:
Ref: DestinationConfig
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"FunctionName": {
"Type": "String",
"Description": {
"en": "Function name."
},
"Required": true
},
"DestinationConfig": {
"AssociationPropertyMetadata": {
"Parameters": {
"OnSuccess": {
"AssociationPropertyMetadata": {
"Parameters": {
"Destination": {
"Type": "String",
"Description": {
"en": "Asynchronous invocation target resource descriptor."
},
"Required": true,
"MaxLength": 512
}
}
},
"Type": "Json",
"Description": {
"en": "Successful callback target structure."
},
"Required": false
},
"OnFailure": {
"AssociationPropertyMetadata": {
"Parameters": {
"Destination": {
"Type": "String",
"Description": {
"en": "Asynchronous invocation target resource descriptor."
},
"Required": true,
"MaxLength": 512
}
}
},
"Type": "Json",
"Description": {
"en": "Failed callback target structure."
},
"Required": false
}
}
},
"Type": "Json",
"Description": {
"en": "Configuration structure of asynchronous invocation target (optional)."
},
"Required": false
}
},
"Resources": {
"AsyncInvokeConfig": {
"Type": "ALIYUN::FC3::AsyncInvokeConfig",
"Properties": {
"FunctionName": {
"Ref": "FunctionName"
},
"DestinationConfig": {
"Ref": "DestinationConfig"
}
}
}
}
}
该文章对您有帮助吗?