ALIYUN::EventBridge::Rule is used to create an event rule for an event bus.
Syntax
{
"Type": "ALIYUN::EventBridge::Rule",
"Properties": {
"Status": String,
"EventBusName": String,
"FilterPattern": Map,
"Description": String,
"Targets": List,
"RuleName": String
}
}Properties
Property | Type | Required | Editable | Description | Constraint |
EventBusName | String | Yes | No | The name of the event bus. | For more information, refer to Limits. |
FilterPattern | Map | Yes | Yes | The event pattern. | The property value must be in the JSON format. Valid values:
Note You can have up to 5 event patterns. |
Targets | List | Yes | Yes | The event targets to which events are delivered. | For more information, refer to Targets properties. |
RuleName | String | Yes | No | The name of the event rule. | For more information, refer to Limits. |
Status | String | No | Yes | The status of the rule. | Valid values:
|
Description | String | No | Yes | The description of the rule. | None |
Targets syntax
"Targets": [
{
"PushRetryStrategy": String,
"Type": String,
"Endpoint": String,
"Id": String,
"ParamList": List,
"DeadLetterQueue": Map,
"ConcurrentConfig": Map,
"ErrorsTolerance": String
}
]Targets properties
Property | Type | Required | Editable | Description | Constraint |
Endpoint | String | Yes | No | The endpoint of the event target. | None |
Id | String | Yes | No | The custom ID of the target. | None |
ParamList | List | Yes | No | The parameters to be passed by events. | For more information, refer to ParamList properties. |
Type | String | Yes | No | The type of the target. | None |
PushRetryStrategy | String | No | No | The retry policy for pushing events. | Valid values:
|
DeadLetterQueue | Map | No | No | The dead-letter queue. | Events that are not processed or exceed the maximum number of retry attempts will be written to a dead-letter queue. The following queue types support the dead-letter queue feature: Alibaba Cloud RocketMQ, Simple Message Queue, ApsaraMQ for Kafka and EventBridge. For more information, refer to DeadLetterQueue properties. |
ConcurrentConfig | Map | No | No | The concurrency configuration. | For more information, refer to ConcurrentConfig properties. |
ErrorsTolerance | String | No | No | The error tolerance policy. | Valid values:
|
DeadLetterQueue syntax
"DeadLetterQueue":
{
"Arn": String
}DeadLetterQueue properties
Property | Type | Required | Editable | Description | Constraint |
Arn | String | Yes | No | The Alibaba Cloud Resource Name (ARN) of the dead-letter queue. | Events that are not processed or exceed the maximum retry attempts will be written to a dead-letter queue. The following queue types support the ARN feature: Alibaba Cloud RocketMQ and Simple Message Queue. |
ConcurrentConfig syntax
"ConcurrentConfig":
{
"Concurrency": Integer
}ConcurrentConfig properties
Property | Type | Required | Allow Updates | Description | Constraint |
Concurrency | Integer | Yes | No | The number of concurrent connections. | None |
ParamList syntax
"ParamList": [
{
"Form": String,
"Value": String,
"ResourceKey": String,
"Template": String
}
]ParamList properties
Property | Type | Required | Editable | Description | Constraint |
Form | String | Yes | No | The form of the event transformation. | For more information, refer to Event target parameters. |
ResourceKey | String | Yes | No | The resource key of the event transformation. | For more information, refer to Event target parameters. |
Value | String | Yes | No | The value of the event transformation. | None |
Template | String | No | No | Template style. | None |
Response parameters
Fn::GetAtt
EventBusName: the name of the event bus.
RuleARN: the Alibaba Cloud Resource Name (ARN) of the event rule. The ARN can be used for authorization.
RuleName: the name of the event rule.
Example
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"
]
}
}
}
}