ALIYUN::KAFKA::ConsumerGroup类型用于创建消费组。
语法
{
  "Type": "ALIYUN::KAFKA::ConsumerGroup",
  "Properties": {
    "InstanceId": String,
    "ConsumerId": String,
    "Tags": List,
    "Remark": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| InstanceId | String | 是 | 否 | Kafka 实例ID。 | 无 | 
| ConsumerId | String | 是 | 否 | Group名称。 | 取值: 
 | 
| Tags | List | 否 | 是 | 标签列表。 | 标签数量范围为1~20。更多信息,请参见Tags属性。 | 
| Remark | String | 否 | 否 | 备注。 | 无 | 
Tags语法
"Tags": [
  {
    "Value": String,
    "Key": String
  }
]Tags属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Value | String | 否 | 否 | 资源的标签值。 | 
 | 
| Key | String | 是 | 否 | 资源的标签键。 | 
 | 
返回值
Fn::GetAtt
- ConsumerId:Group ID。 
- Arn:阿里云资源名称。 
示例
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
                        {
  "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"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?