1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. alikafka
  5. ConsumerGroup
Alibaba Cloud v3.95.0 published on Thursday, Feb 12, 2026 by Pulumi
alicloud logo
Alibaba Cloud v3.95.0 published on Thursday, Feb 12, 2026 by Pulumi

    Provides a Ali Kafka Consumer Group resource.

    Group in kafka.

    For information about Ali Kafka Consumer Group and how to use it, see What is Consumer Group.

    NOTE: Available since v1.56.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.actiontrail.getInstances({});
    const defaultConsumerGroup = new alicloud.alikafka.ConsumerGroup("default", {
        instanceId: _default.then(_default => _default.instances?.[0]?.id),
        consumerId: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.actiontrail.get_instances()
    default_consumer_group = alicloud.alikafka.ConsumerGroup("default",
        instance_id=default.instances[0].id,
        consumer_id=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/actiontrail"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/alikafka"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := actiontrail.GetInstances(ctx, &actiontrail.GetInstancesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = alikafka.NewConsumerGroup(ctx, "default", &alikafka.ConsumerGroupArgs{
    			InstanceId: pulumi.String(_default.Instances[0].Id),
    			ConsumerId: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.ActionTrail.GetInstances.Invoke();
    
        var defaultConsumerGroup = new AliCloud.Alikafka.ConsumerGroup("default", new()
        {
            InstanceId = @default.Apply(@default => @default.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id)),
            ConsumerId = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.actiontrail.ActiontrailFunctions;
    import com.pulumi.alicloud.actiontrail.inputs.GetInstancesArgs;
    import com.pulumi.alicloud.alikafka.ConsumerGroup;
    import com.pulumi.alicloud.alikafka.ConsumerGroupArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = ActiontrailFunctions.getInstances(GetInstancesArgs.builder()
                .build());
    
            var defaultConsumerGroup = new ConsumerGroup("defaultConsumerGroup", ConsumerGroupArgs.builder()
                .instanceId(default_.instances()[0].id())
                .consumerId(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultConsumerGroup:
        type: alicloud:alikafka:ConsumerGroup
        name: default
        properties:
          instanceId: ${default.instances[0].id}
          consumerId: ${name}
    variables:
      default:
        fn::invoke:
          function: alicloud:actiontrail:getInstances
          arguments: {}
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create ConsumerGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ConsumerGroup(name: string, args: ConsumerGroupArgs, opts?: CustomResourceOptions);
    @overload
    def ConsumerGroup(resource_name: str,
                      args: ConsumerGroupArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConsumerGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      consumer_id: Optional[str] = None,
                      instance_id: Optional[str] = None,
                      description: Optional[str] = None,
                      remark: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None)
    func NewConsumerGroup(ctx *Context, name string, args ConsumerGroupArgs, opts ...ResourceOption) (*ConsumerGroup, error)
    public ConsumerGroup(string name, ConsumerGroupArgs args, CustomResourceOptions? opts = null)
    public ConsumerGroup(String name, ConsumerGroupArgs args)
    public ConsumerGroup(String name, ConsumerGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:alikafka:ConsumerGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ConsumerGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ConsumerGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ConsumerGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConsumerGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConsumerGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var consumerGroupResource = new AliCloud.Alikafka.ConsumerGroup("consumerGroupResource", new()
    {
        ConsumerId = "string",
        InstanceId = "string",
        Remark = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := alikafka.NewConsumerGroup(ctx, "consumerGroupResource", &alikafka.ConsumerGroupArgs{
    	ConsumerId: pulumi.String("string"),
    	InstanceId: pulumi.String("string"),
    	Remark:     pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var consumerGroupResource = new com.pulumi.alicloud.alikafka.ConsumerGroup("consumerGroupResource", com.pulumi.alicloud.alikafka.ConsumerGroupArgs.builder()
        .consumerId("string")
        .instanceId("string")
        .remark("string")
        .tags(Map.of("string", "string"))
        .build());
    
    consumer_group_resource = alicloud.alikafka.ConsumerGroup("consumerGroupResource",
        consumer_id="string",
        instance_id="string",
        remark="string",
        tags={
            "string": "string",
        })
    
    const consumerGroupResource = new alicloud.alikafka.ConsumerGroup("consumerGroupResource", {
        consumerId: "string",
        instanceId: "string",
        remark: "string",
        tags: {
            string: "string",
        },
    });
    
    type: alicloud:alikafka:ConsumerGroup
    properties:
        consumerId: string
        instanceId: string
        remark: string
        tags:
            string: string
    

    ConsumerGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ConsumerGroup resource accepts the following input properties:

    ConsumerId string
    ID of the consumer group.
    InstanceId string
    ID of the ALIKAFKA Instance that owns the groups.
    Description string
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Remark string
    The remark of the resource.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ConsumerId string
    ID of the consumer group.
    InstanceId string
    ID of the ALIKAFKA Instance that owns the groups.
    Description string
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Remark string
    The remark of the resource.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    consumerId String
    ID of the consumer group.
    instanceId String
    ID of the ALIKAFKA Instance that owns the groups.
    description String
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    remark String
    The remark of the resource.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    consumerId string
    ID of the consumer group.
    instanceId string
    ID of the ALIKAFKA Instance that owns the groups.
    description string
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    remark string
    The remark of the resource.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    consumer_id str
    ID of the consumer group.
    instance_id str
    ID of the ALIKAFKA Instance that owns the groups.
    description str
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    remark str
    The remark of the resource.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    consumerId String
    ID of the consumer group.
    instanceId String
    ID of the ALIKAFKA Instance that owns the groups.
    description String
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    remark String
    The remark of the resource.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ConsumerGroup resource produces the following output properties:

    CreateTime int
    (Available since v1.268.0) The timestamp of when the group was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    (Available since v1.268.0) The region ID.
    CreateTime int
    (Available since v1.268.0) The timestamp of when the group was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    (Available since v1.268.0) The region ID.
    createTime Integer
    (Available since v1.268.0) The timestamp of when the group was created.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    (Available since v1.268.0) The region ID.
    createTime number
    (Available since v1.268.0) The timestamp of when the group was created.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    (Available since v1.268.0) The region ID.
    create_time int
    (Available since v1.268.0) The timestamp of when the group was created.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    (Available since v1.268.0) The region ID.
    createTime Number
    (Available since v1.268.0) The timestamp of when the group was created.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    (Available since v1.268.0) The region ID.

    Look up Existing ConsumerGroup Resource

    Get an existing ConsumerGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ConsumerGroupState, opts?: CustomResourceOptions): ConsumerGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            consumer_id: Optional[str] = None,
            create_time: Optional[int] = None,
            description: Optional[str] = None,
            instance_id: Optional[str] = None,
            region_id: Optional[str] = None,
            remark: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> ConsumerGroup
    func GetConsumerGroup(ctx *Context, name string, id IDInput, state *ConsumerGroupState, opts ...ResourceOption) (*ConsumerGroup, error)
    public static ConsumerGroup Get(string name, Input<string> id, ConsumerGroupState? state, CustomResourceOptions? opts = null)
    public static ConsumerGroup get(String name, Output<String> id, ConsumerGroupState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:alikafka:ConsumerGroup    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ConsumerId string
    ID of the consumer group.
    CreateTime int
    (Available since v1.268.0) The timestamp of when the group was created.
    Description string
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    InstanceId string
    ID of the ALIKAFKA Instance that owns the groups.
    RegionId string
    (Available since v1.268.0) The region ID.
    Remark string
    The remark of the resource.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ConsumerId string
    ID of the consumer group.
    CreateTime int
    (Available since v1.268.0) The timestamp of when the group was created.
    Description string
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    InstanceId string
    ID of the ALIKAFKA Instance that owns the groups.
    RegionId string
    (Available since v1.268.0) The region ID.
    Remark string
    The remark of the resource.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    consumerId String
    ID of the consumer group.
    createTime Integer
    (Available since v1.268.0) The timestamp of when the group was created.
    description String
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    instanceId String
    ID of the ALIKAFKA Instance that owns the groups.
    regionId String
    (Available since v1.268.0) The region ID.
    remark String
    The remark of the resource.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    consumerId string
    ID of the consumer group.
    createTime number
    (Available since v1.268.0) The timestamp of when the group was created.
    description string
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    instanceId string
    ID of the ALIKAFKA Instance that owns the groups.
    regionId string
    (Available since v1.268.0) The region ID.
    remark string
    The remark of the resource.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    consumer_id str
    ID of the consumer group.
    create_time int
    (Available since v1.268.0) The timestamp of when the group was created.
    description str
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    instance_id str
    ID of the ALIKAFKA Instance that owns the groups.
    region_id str
    (Available since v1.268.0) The region ID.
    remark str
    The remark of the resource.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    consumerId String
    ID of the consumer group.
    createTime Number
    (Available since v1.268.0) The timestamp of when the group was created.
    description String
    Field description has been deprecated from provider version 1.268.0. New field remark instead.

    Deprecated: Field description has been deprecated from provider version 1.268.0. New field remark instead.

    instanceId String
    ID of the ALIKAFKA Instance that owns the groups.
    regionId String
    (Available since v1.268.0) The region ID.
    remark String
    The remark of the resource.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Import

    AliKafka Consumer Group can be imported using the id, e.g.

    $ pulumi import alicloud:alikafka/consumerGroup:ConsumerGroup example <instance_id>:<consumer_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.95.0 published on Thursday, Feb 12, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate