O recurso ALIYUN::EventBridge::Rule cria uma regra de evento para um barramento de eventos especificado.
Sintaxe
{
"Type": "ALIYUN::EventBridge::Rule",
"Properties": {
"Status": String,
"EventBusName": String,
"FilterPattern": Map,
"Description": String,
"Targets": List,
"RuleName": String
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
EventBusName |
String |
Sim |
Não |
Nome do barramento de eventos. |
Para mais informações, consulte Limites. |
|
FilterPattern |
Map |
Sim |
Sim |
Padrão de evento. |
Deve estar no formato JSON. Valores válidos:
Nota
É possível definir até 5 padrões de evento. |
|
Targets |
List |
Sim |
Sim |
Destinos de entrega de eventos. |
Para mais informações, consulte Propriedades de Targets. |
|
RuleName |
String |
Sim |
Não |
Nome da regra de evento. |
Para mais informações, consulte Limites. |
|
Status |
String |
Não |
Sim |
Status da regra. |
Valores válidos:
|
|
Description |
String |
Não |
Sim |
Descrição da regra. |
Nenhuma |
Sintaxe de Targets
"Targets": [
{
"PushRetryStrategy": String,
"Type": String,
"Endpoint": String,
"Id": String,
"ParamList": List,
"DeadLetterQueue": Map,
"ConcurrentConfig": Map,
"ErrorsTolerance": String
}
]
Propriedades de Targets
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
Endpoint |
String |
Sim |
Não |
Endpoint do destino do evento. |
Nenhuma |
|
Id |
String |
Sim |
Não |
ID personalizado do destino. |
Nenhuma |
|
ParamList |
List |
Sim |
Não |
Parâmetros transmitidos com os eventos. |
Para mais informações, consulte Propriedades de ParamList. |
|
Type |
String |
Sim |
Não |
Tipo do destino. |
Nenhuma |
|
PushRetryStrategy |
String |
Não |
Não |
Política de nova tentativa de entrega de eventos. |
Valores válidos:
|
|
DeadLetterQueue |
Map |
Não |
Não |
Configuração da fila de mensagens mortas. |
Eventos não processados ou que excedem o limite máximo de novas tentativas são gravados na fila de mensagens mortas. Tipos de fila suportados: Alibaba Cloud RocketMQ, Simple Message Queue, ApsaraMQ for Kafka e EventBridge. Para mais informações, consulte Propriedades de DeadLetterQueue. |
|
ConcurrentConfig |
Map |
Não |
Não |
Configuração de concorrência. |
Para mais informações, consulte Propriedades de ConcurrentConfig. |
|
ErrorsTolerance |
String |
Não |
Não |
Política de tolerância a erros. |
Valores válidos:
|
Sintaxe de DeadLetterQueue
"DeadLetterQueue":
{
"Arn": String
}
Propriedades de DeadLetterQueue
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
Arn |
String |
Sim |
Não |
Alibaba Cloud Resource Name (ARN) da fila de mensagens mortas. |
Eventos não processados ou que excedem o limite máximo de novas tentativas são gravados na fila de mensagens mortas. Tipos de fila suportados: Alibaba Cloud RocketMQ e Simple Message Queue. |
Sintaxe de ConcurrentConfig
"ConcurrentConfig":
{
"Concurrency": Integer
}
Propriedades de ConcurrentConfig
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
Concurrency |
Integer |
Sim |
Não |
Número de conexões simultâneas. |
Nenhuma |
Sintaxe de ParamList
"ParamList": [
{
"Form": String,
"Value": String,
"ResourceKey": String,
"Template": String
}
]
Propriedades de ParamList
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
Form |
String |
Sim |
Não |
Formato da transformação de evento. |
Para mais informações, consulte Parâmetros do destino do evento. |
|
ResourceKey |
String |
Sim |
Não |
Chave de recurso da transformação de evento. |
Para mais informações, consulte Parâmetros do destino do evento. |
|
Value |
String |
Sim |
Não |
Valor da transformação de evento. |
Nenhuma |
|
Template |
String |
Não |
Não |
Estilo do modelo. |
Nenhuma |
Parâmetros de resposta
Fn::GetAtt
EventBusName: nome do barramento de eventos.
RuleARN: ARN da regra de evento, utilizado para autorização.
RuleName: nome da regra de evento.
Exemplo
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
EventBusName:
Type: String
Description: The name of the event bus.
Targets:
Type: Json
Description: The event target to which events are delivered.
MinLength: 1
MaxLength: 5
RuleName:
Type: String
Description: The name of the event rule.
FilterPattern:
Required: true
Type: Json
Description:
en: The event pattern, in the JSON format.
Label:
zh-cn: event pattern
en: FilterPattern
Resources:
Rule:
Type: ALIYUN::EventBridge::Rule
Properties:
FilterPattern:
Ref: FilterPattern
EventBusName:
Ref: EventBusName
Targets:
Ref: Targets
RuleName:
Ref: RuleName
Outputs:
EventBusName:
Description: The name of the event bus.
Value:
Fn::GetAtt:
- Rule
- EventBusName
RuleARN:
Description: The Alibaba Cloud Resource Name (ARN) of the event rule. The ARN is used for authorization.
Value:
Fn::GetAtt:
- Rule
- RuleARN
RuleName:
Description: The name of the event rule.
Value:
Fn::GetAtt:
- Rule
- RuleName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"EventBusName": {
"Type": "String",
"Description": "The name of the event bus."
},
"Targets": {
"Type": "Json",
"Description": "The event target to which events are delivered.",
"MinLength": 1,
"MaxLength": 5
},
"RuleName": {
"Type": "String",
"Description": "The name of the event rule."
},
"FilterPattern": {
"Required": true,
"Type": "Json",
"Description": {
"en": "The event pattern, in the JSON format."
},
"Label": {
"zh-cn": "event pattern",
"en": "FilterPattern"
}
}
},
"Resources": {
"Rule": {
"Type": "ALIYUN::EventBridge::Rule",
"Properties": {
"FilterPattern": {
"Ref": "FilterPattern"
},
"EventBusName": {
"Ref": "EventBusName"
},
"Targets": {
"Ref": "Targets"
},
"RuleName": {
"Ref": "RuleName"
}
}
}
},
"Outputs": {
"EventBusName": {
"Description": "The name of the event bus.",
"Value": {
"Fn::GetAtt": [
"Rule",
"EventBusName"
]
}
},
"RuleARN": {
"Description": "The Alibaba Cloud Resource Name (ARN) of the event rule. The ARN is used for authorization.",
"Value": {
"Fn::GetAtt": [
"Rule",
"RuleARN"
]
}
},
"RuleName": {
"Description": "The name of the event rule.",
"Value": {
"Fn::GetAtt": [
"Rule",
"RuleName"
]
}
}
}
}