ALIYUN::SLS::ConsumerGroup类型用于在指定的Logstore上创建一个消费组。
语法
{
"Type": "ALIYUN::SLS::ConsumerGroup",
"Properties": {
"ConsumerGroup": String,
"Logstore": String,
"Order": Boolean,
"Project": String,
"Timeout": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ConsumerGroup | String | 是 | 否 | 消费组名称。 | 在 Project 下必须唯一。 |
Logstore | String | 是 | 否 | Logstore 名称。 | 无 |
Order | Boolean | 是 | 是 | 是否按顺序消费。 | 取值:
|
Project | String | 是 | 否 | Project 名称。 | 无 |
Timeout | Integer | 是 | 是 | 超时时间。 | 在超时时间段内没有收到心跳,消费者将被删除。单位:秒。 |
返回值
Fn::GetAtt
Project:Project 名称。
Logstore:Logstore 名称。
ConsumerGroup:消费组名称。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Order:
Type: Boolean
Description:
en: |-
Specifies whether to consume data in sequence. Valid values:
true
In a shard, data is consumed in ascending order based on the value of the **__tag__:__receive_time__** field.
If a shard is split, data in the original shard is consumed first. Then, data in the new shards is consumed at the same time.
If shards are merged, data in the original shards is consumed first. Then, data in the new shard is consumed.
false Data in all shards is consumed at the same time. If a new shard is generated after a shard is split or after shards are merged, data in the new shard is immediately consumed.
Required: true
Project:
Type: String
Description:
en: The name of the project.
Required: true
Logstore:
Type: String
Description:
en: The name of the Logstore.
Required: true
Timeout:
Type: Number
Description:
en: 'The timeout period. If the server does not receive heartbeats from a consumer within the timeout period, the server deletes the consumer. Unit: seconds.'
Required: true
MinValue: 1
MaxValue: 4294967295
ConsumerGroup:
Type: String
Description:
en: The name of the consumer group. The name must be unique in a project.
Required: true
Resources:
SLSConsumerGroup:
Type: ALIYUN::SLS::ConsumerGroup
Properties:
Order:
Ref: Order
Project:
Ref: Project
Logstore:
Ref: Logstore
Timeout:
Ref: Timeout
ConsumerGroup:
Ref: ConsumerGroup
Outputs:
Project:
Description: The name of the project to which the logstore belongs.
Value:
Fn::GetAtt:
- SLSConsumerGroup
- Project
Logstore:
Description: The name of the logstore to which this consumer group belongs.
Value:
Fn::GetAtt:
- SLSConsumerGroup
- Logstore
ConsumerGroup:
Description: The name of the consumer group.
Value:
Fn::GetAtt:
- SLSConsumerGroup
- ConsumerGroup
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"Order": {
"Type": "Boolean",
"Description": {
"en": "Specifies whether to consume data in sequence. Valid values:\ntrue\nIn a shard, data is consumed in ascending order based on the value of the **__tag__:__receive_time__** field.\nIf a shard is split, data in the original shard is consumed first. Then, data in the new shards is consumed at the same time.\nIf shards are merged, data in the original shards is consumed first. Then, data in the new shard is consumed.\nfalse Data in all shards is consumed at the same time. If a new shard is generated after a shard is split or after shards are merged, data in the new shard is immediately consumed."
},
"Required": true
},
"Project": {
"Type": "String",
"Description": {
"en": "The name of the project."
},
"Required": true
},
"Logstore": {
"Type": "String",
"Description": {
"en": "The name of the Logstore."
},
"Required": true
},
"Timeout": {
"Type": "Number",
"Description": {
"en": "The timeout period. If the server does not receive heartbeats from a consumer within the timeout period, the server deletes the consumer. Unit: seconds."
},
"Required": true,
"MinValue": 1,
"MaxValue": 4294967295
},
"ConsumerGroup": {
"Type": "String",
"Description": {
"en": "The name of the consumer group. The name must be unique in a project."
},
"Required": true
}
},
"Resources": {
"SLSConsumerGroup": {
"Type": "ALIYUN::SLS::ConsumerGroup",
"Properties": {
"Order": {
"Ref": "Order"
},
"Project": {
"Ref": "Project"
},
"Logstore": {
"Ref": "Logstore"
},
"Timeout": {
"Ref": "Timeout"
},
"ConsumerGroup": {
"Ref": "ConsumerGroup"
}
}
}
},
"Outputs": {
"Project": {
"Description": "The name of the project to which the logstore belongs.",
"Value": {
"Fn::GetAtt": [
"SLSConsumerGroup",
"Project"
]
}
},
"Logstore": {
"Description": "The name of the logstore to which this consumer group belongs.",
"Value": {
"Fn::GetAtt": [
"SLSConsumerGroup",
"Logstore"
]
}
},
"ConsumerGroup": {
"Description": "The name of the consumer group.",
"Value": {
"Fn::GetAtt": [
"SLSConsumerGroup",
"ConsumerGroup"
]
}
}
}
}