All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::KAFKA::ConsumerGroup

Last Updated:Nov 23, 2023

ALIYUN::KAFKA::ConsumerGroup is used to create a consumer group.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

InstanceId

String

Yes

No

The ID of the ApsaraMQ for Kafka instance.

None.

ConsumerId

String

Yes

No

The name of the consumer group.

Valid values:

  • The name can contain only letters, digits, hyphens (-), and underscores (_) and must contain at least one letter or digit.

  • The name must be 3 to 128 characters in length. An overlength value is automatically truncated to 128 characters.

  • After a consumer group is created, you cannot change the name of the consumer group.

Tags

List

No

Yes

The tags.

You can specify 1 to 20 tags. For more information, see Tags properties.

Remark

String

No

No

The description of the consumer group.

None.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The tag value of the resource.

  • You can leave this property empty.

  • The tag value can be up to 128 characters in length and cannot start with acs: or aliyun. The tag value cannot contain http:// or https://.

Key

String

Yes

No

The tag key of the resource.

  • You cannot leave this property empty.

  • The tag key must be 1 to 128 characters in length and cannot start with acs: or aliyun. The tag key cannot contain http:// or https://.

Return values

Fn::GetAtt

ConsumerId: the ID of the consumer group.

Examples

  • YAML format

    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 format

    {
      "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"
            ]
          }
        }
      }
    }