Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::SLS::ConsumerGroup

Última atualização: Jun 27, 2026

Cria um grupo de consumidores para um Logstore especificado.

Sintaxe

{
  "Type": "ALIYUN::SLS::ConsumerGroup",
  "Properties": {
    "ConsumerGroup": String,
    "Logstore": String,
    "Order": Boolean,
    "Project": String,
    "Timeout": Integer
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

ConsumerGroup

String

Sim

Não

Nome do grupo de consumidores.

Deve ser único no projeto.

Logstore

String

Sim

Não

Nome do Logstore.

Nenhuma.

Order

Boolean

Sim

Sim

Define se o consumo de dados ocorre em sequência.

Valores válidos:

  • true: consome dados em sequência.

    • Em um shard, o consumo segue a ordem crescente do campo reservado __tag__:__receive_time__.

    • Na divisão de um shard, os dados do shard original são consumidos antes dos novos shards.

    • Na mesclagem de shards, os dados dos shards originais são consumidos antes do novo shard.

  • false: não consome dados em sequência. O consumo ocorre simultaneamente em todos os shards. Novos shards gerados por divisões ou mesclagens são consumidos imediatamente.

Project

String

Sim

Não

Nome do projeto.

Nenhuma.

Timeout

Integer

Sim

Sim

Tempo limite.

Se o Simple Log Service (SLS) não receber heartbeats de um consumidor nesse período, o consumidor será excluído. Unidade: segundos.

Valores de retorno

Fn::GetAtt

  • Project: nome do projeto.

  • Logstore: nome do Logstore.

  • ConsumerGroup: nome do grupo de consumidores.

Exemplos

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