ALIYUN::FC3::AsyncInvokeConfig

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"
        }
      }
    }
  }
}