O recurso ALIYUN::FC3::AsyncInvokeConfig especifica a configuração de invocação assíncrona de uma função.
Sintaxe
{
"Type": "ALIYUN::FC3::AsyncInvokeConfig",
"Properties": {
"FunctionName": String,
"AsyncTask": Boolean,
"DestinationConfig": Map,
"MaxAsyncEventAgeInSeconds": Integer,
"MaxAsyncRetryAttempts": Integer
}
}
Propriedades
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualizável |
Descrição |
Restrições |
|
FunctionName |
String |
Sim |
Não |
Nome da função. |
Nenhuma |
|
AsyncTask |
Boolean |
Não |
Não |
Indica se as tarefas assíncronas estão ativadas. |
Nenhuma |
|
DestinationConfig |
Map |
Não |
Não |
Configuração do destino. |
Para obter mais informações, consulte Propriedades de DestinationConfig. |
|
MaxAsyncEventAgeInSeconds |
Integer |
Não |
Não |
Tempo de vida (TTL) máximo de um evento, em segundos. |
{'Range': {'Min': 1, 'Max': 604800}} |
|
MaxAsyncRetryAttempts |
Integer |
Não |
Não |
Número máximo de tentativas de nova execução para uma invocação assíncrona. |
Nenhuma |
Sintaxe de DestinationConfig
"DestinationConfig": {
"OnSuccess": Map,
"OnFailure": Map
}
Propriedades de DestinationConfig
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualizável |
Descrição |
Restrições |
|
OnSuccess |
Map |
Não |
Não |
Destino das invocações bem-sucedidas. |
Para obter mais informações, consulte Propriedade OnSuccess. |
|
OnFailure |
Map |
Não |
Não |
Destino das invocações com falha. |
Para obter mais informações, consulte Propriedade OnFailure. |
Sintaxe de OnSuccess
"OnSuccess": {
"Destination": String
}
Propriedade OnSuccess
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualizável |
Descrição |
Restrições |
|
Destination |
String |
Sim |
Não |
Descritor do recurso de destino da invocação assíncrona. |
Nenhuma |
Sintaxe de OnFailure
"OnFailure": {
"Destination": String
}
Propriedade OnFailure
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualizável |
Descrição |
Restrições |
|
Destination |
String |
Sim |
Não |
Descritor do recurso de destino da invocação assíncrona. |
Nenhuma |
Valor de retorno
Fn::GetAtt
Nenhum
Exemplos
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"
}
}
}
}
}