文档

ALIYUN::KAFKA::ConsumerGroup

更新时间:

ALIYUN::KAFKA::ConsumerGroup类型用于创建消费组。

语法

{
  "Type": "ALIYUN::KAFKA::ConsumerGroup",
  "Properties": {
    "InstanceId": String,
    "ConsumerId": String,
    "Tags": List,
    "Remark": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InstanceId

String

Kafka 实例ID。

ConsumerId

String

Group名称。

取值:

  • 只能包含字母、数字、短划线(-)、下划线(_),且至少包含一个英文或数字。

  • 长度限制在3~128字符,多于128字符将被自动截取。

  • Group名称一旦创建后,将不能修改。

Tags

List

标签列表。

标签数量范围为1~20。更多信息,请参见Tags属性

Remark

String

备注。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Value

String

资源的标签值。

  • 可以为空。

  • 最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

Key

String

资源的标签键。

  • 不允许为空。

  • 最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

返回值

Fn::GetAtt

ConsumerId:Group ID

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ConsumerId:
        Description:
          en: 'Group name. Value:
            Can only contain letters, numbers, dashes (-), underscores (_), and at least
            one English or number.
            The length is limited to 3 to 128 characters, and more than 128 characters
            will be automatically intercepted.
            Once the group name is created, it cannot be modified.'
        Type: String
      InstanceId:
        Description:
          en: Kafka instance id.
        Type: String
      Remark:
        Description:
          en: Remark description.
        Type: String
    Resources:
      ConsumerGroup:
        Properties:
          ConsumerId:
            Ref: ConsumerId
          InstanceId:
            Ref: InstanceId
          Remark:
            Ref: Remark
        Type: ALIYUN::KAFKA::ConsumerGroup
    Outputs:
      ConsumerId:
        Description: Consumer group ID
        Value:
          Fn::GetAtt:
          - ConsumerGroup
          - ConsumerId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "InstanceId": {
          "Type": "String",
          "Description": {
            "en": "Kafka instance id."
          }
        },
        "ConsumerId": {
          "Type": "String",
          "Description": {
            "en": "Group name. Value:\nCan only contain letters, numbers, dashes (-), underscores (_), and at least one English or number.\nThe length is limited to 3 to 128 characters, and more than 128 characters will be automatically intercepted.\nOnce the group name is created, it cannot be modified."
          }
        },
        "Remark": {
          "Type": "String",
          "Description": {
            "en": "Remark description."
          }
        }
      },
      "Resources": {
        "ConsumerGroup": {
          "Type": "ALIYUN::KAFKA::ConsumerGroup",
          "Properties": {
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "ConsumerId": {
              "Ref": "ConsumerId"
            },
            "Remark": {
              "Ref": "Remark"
            }
          }
        }
      },
      "Outputs": {
        "ConsumerId": {
          "Description": "Consumer group ID",
          "Value": {
            "Fn::GetAtt": [
              "ConsumerGroup",
              "ConsumerId"
            ]
          }
        }
      }
    }
                            
  • 本页导读 (1)
文档反馈