1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. ClsKafkaConsumer
Viewing docs for tencentcloud 1.82.90
published on Wednesday, Apr 29, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.82.90
published on Wednesday, Apr 29, 2026 by tencentcloudstack

    Provides a resource to create a CLS kafka consumer

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ClsKafkaConsumer("example", {
        fromTopicId: "c9b68233-948a-4eaf-a363-d0c2ced393ae",
        compression: 0,
        consumerContent: {
            enableTag: false,
            format: 1,
            jsonType: 1,
            metaFields: [
                "__SOURCE__",
                "__FILENAME__",
            ],
            tagTransaction: 2,
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ClsKafkaConsumer("example",
        from_topic_id="c9b68233-948a-4eaf-a363-d0c2ced393ae",
        compression=0,
        consumer_content={
            "enable_tag": False,
            "format": 1,
            "json_type": 1,
            "meta_fields": [
                "__SOURCE__",
                "__FILENAME__",
            ],
            "tag_transaction": 2,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewClsKafkaConsumer(ctx, "example", &tencentcloud.ClsKafkaConsumerArgs{
    			FromTopicId: pulumi.String("c9b68233-948a-4eaf-a363-d0c2ced393ae"),
    			Compression: pulumi.Float64(0),
    			ConsumerContent: &tencentcloud.ClsKafkaConsumerConsumerContentArgs{
    				EnableTag: pulumi.Bool(false),
    				Format:    pulumi.Float64(1),
    				JsonType:  pulumi.Float64(1),
    				MetaFields: pulumi.StringArray{
    					pulumi.String("__SOURCE__"),
    					pulumi.String("__FILENAME__"),
    				},
    				TagTransaction: pulumi.Float64(2),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.ClsKafkaConsumer("example", new()
        {
            FromTopicId = "c9b68233-948a-4eaf-a363-d0c2ced393ae",
            Compression = 0,
            ConsumerContent = new Tencentcloud.Inputs.ClsKafkaConsumerConsumerContentArgs
            {
                EnableTag = false,
                Format = 1,
                JsonType = 1,
                MetaFields = new[]
                {
                    "__SOURCE__",
                    "__FILENAME__",
                },
                TagTransaction = 2,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClsKafkaConsumer;
    import com.pulumi.tencentcloud.ClsKafkaConsumerArgs;
    import com.pulumi.tencentcloud.inputs.ClsKafkaConsumerConsumerContentArgs;
    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) {
            var example = new ClsKafkaConsumer("example", ClsKafkaConsumerArgs.builder()
                .fromTopicId("c9b68233-948a-4eaf-a363-d0c2ced393ae")
                .compression(0.0)
                .consumerContent(ClsKafkaConsumerConsumerContentArgs.builder()
                    .enableTag(false)
                    .format(1.0)
                    .jsonType(1.0)
                    .metaFields(                
                        "__SOURCE__",
                        "__FILENAME__")
                    .tagTransaction(2.0)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ClsKafkaConsumer
        properties:
          fromTopicId: c9b68233-948a-4eaf-a363-d0c2ced393ae
          compression: 0
          consumerContent:
            enableTag: false
            format: 1
            jsonType: 1
            metaFields:
              - __SOURCE__
              - __FILENAME__
            tagTransaction: 2
    

    Create ClsKafkaConsumer Resource

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

    Constructor syntax

    new ClsKafkaConsumer(name: string, args: ClsKafkaConsumerArgs, opts?: CustomResourceOptions);
    @overload
    def ClsKafkaConsumer(resource_name: str,
                         args: ClsKafkaConsumerArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClsKafkaConsumer(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         from_topic_id: Optional[str] = None,
                         cls_kafka_consumer_id: Optional[str] = None,
                         compression: Optional[float] = None,
                         consumer_content: Optional[ClsKafkaConsumerConsumerContentArgs] = None)
    func NewClsKafkaConsumer(ctx *Context, name string, args ClsKafkaConsumerArgs, opts ...ResourceOption) (*ClsKafkaConsumer, error)
    public ClsKafkaConsumer(string name, ClsKafkaConsumerArgs args, CustomResourceOptions? opts = null)
    public ClsKafkaConsumer(String name, ClsKafkaConsumerArgs args)
    public ClsKafkaConsumer(String name, ClsKafkaConsumerArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ClsKafkaConsumer
    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 ClsKafkaConsumerArgs
    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 ClsKafkaConsumerArgs
    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 ClsKafkaConsumerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClsKafkaConsumerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClsKafkaConsumerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ClsKafkaConsumer 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 ClsKafkaConsumer resource accepts the following input properties:

    FromTopicId string
    Log topic ID.
    ClsKafkaConsumerId string
    ID of the resource.
    Compression double
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    ConsumerContent ClsKafkaConsumerConsumerContent
    Kafka protocol consumption data format.
    FromTopicId string
    Log topic ID.
    ClsKafkaConsumerId string
    ID of the resource.
    Compression float64
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    ConsumerContent ClsKafkaConsumerConsumerContentArgs
    Kafka protocol consumption data format.
    fromTopicId String
    Log topic ID.
    clsKafkaConsumerId String
    ID of the resource.
    compression Double
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumerContent ClsKafkaConsumerConsumerContent
    Kafka protocol consumption data format.
    fromTopicId string
    Log topic ID.
    clsKafkaConsumerId string
    ID of the resource.
    compression number
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumerContent ClsKafkaConsumerConsumerContent
    Kafka protocol consumption data format.
    from_topic_id str
    Log topic ID.
    cls_kafka_consumer_id str
    ID of the resource.
    compression float
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumer_content ClsKafkaConsumerConsumerContentArgs
    Kafka protocol consumption data format.
    fromTopicId String
    Log topic ID.
    clsKafkaConsumerId String
    ID of the resource.
    compression Number
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumerContent Property Map
    Kafka protocol consumption data format.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    TopicId string
    Topic parameter used when KafkaConsumer consumes.
    Id string
    The provider-assigned unique ID for this managed resource.
    TopicId string
    Topic parameter used when KafkaConsumer consumes.
    id String
    The provider-assigned unique ID for this managed resource.
    topicId String
    Topic parameter used when KafkaConsumer consumes.
    id string
    The provider-assigned unique ID for this managed resource.
    topicId string
    Topic parameter used when KafkaConsumer consumes.
    id str
    The provider-assigned unique ID for this managed resource.
    topic_id str
    Topic parameter used when KafkaConsumer consumes.
    id String
    The provider-assigned unique ID for this managed resource.
    topicId String
    Topic parameter used when KafkaConsumer consumes.

    Look up Existing ClsKafkaConsumer Resource

    Get an existing ClsKafkaConsumer 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?: ClsKafkaConsumerState, opts?: CustomResourceOptions): ClsKafkaConsumer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cls_kafka_consumer_id: Optional[str] = None,
            compression: Optional[float] = None,
            consumer_content: Optional[ClsKafkaConsumerConsumerContentArgs] = None,
            from_topic_id: Optional[str] = None,
            topic_id: Optional[str] = None) -> ClsKafkaConsumer
    func GetClsKafkaConsumer(ctx *Context, name string, id IDInput, state *ClsKafkaConsumerState, opts ...ResourceOption) (*ClsKafkaConsumer, error)
    public static ClsKafkaConsumer Get(string name, Input<string> id, ClsKafkaConsumerState? state, CustomResourceOptions? opts = null)
    public static ClsKafkaConsumer get(String name, Output<String> id, ClsKafkaConsumerState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ClsKafkaConsumer    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:
    ClsKafkaConsumerId string
    ID of the resource.
    Compression double
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    ConsumerContent ClsKafkaConsumerConsumerContent
    Kafka protocol consumption data format.
    FromTopicId string
    Log topic ID.
    TopicId string
    Topic parameter used when KafkaConsumer consumes.
    ClsKafkaConsumerId string
    ID of the resource.
    Compression float64
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    ConsumerContent ClsKafkaConsumerConsumerContentArgs
    Kafka protocol consumption data format.
    FromTopicId string
    Log topic ID.
    TopicId string
    Topic parameter used when KafkaConsumer consumes.
    clsKafkaConsumerId String
    ID of the resource.
    compression Double
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumerContent ClsKafkaConsumerConsumerContent
    Kafka protocol consumption data format.
    fromTopicId String
    Log topic ID.
    topicId String
    Topic parameter used when KafkaConsumer consumes.
    clsKafkaConsumerId string
    ID of the resource.
    compression number
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumerContent ClsKafkaConsumerConsumerContent
    Kafka protocol consumption data format.
    fromTopicId string
    Log topic ID.
    topicId string
    Topic parameter used when KafkaConsumer consumes.
    cls_kafka_consumer_id str
    ID of the resource.
    compression float
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumer_content ClsKafkaConsumerConsumerContentArgs
    Kafka protocol consumption data format.
    from_topic_id str
    Log topic ID.
    topic_id str
    Topic parameter used when KafkaConsumer consumes.
    clsKafkaConsumerId String
    ID of the resource.
    compression Number
    Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
    consumerContent Property Map
    Kafka protocol consumption data format.
    fromTopicId String
    Log topic ID.
    topicId String
    Topic parameter used when KafkaConsumer consumes.

    Supporting Types

    ClsKafkaConsumerConsumerContent, ClsKafkaConsumerConsumerContentArgs

    EnableTag bool
    Whether to deliver TAG information.
    Format double
    Content format: 0-original content, 1-JSON.
    JsonType double
    Consumption data JSON format: 1-not escaped, 2-escaped.
    MetaFields List<string>
    Metadata field list.
    TagTransaction double
    Tag data processing method: 1-not flattened, 2-flattened.
    EnableTag bool
    Whether to deliver TAG information.
    Format float64
    Content format: 0-original content, 1-JSON.
    JsonType float64
    Consumption data JSON format: 1-not escaped, 2-escaped.
    MetaFields []string
    Metadata field list.
    TagTransaction float64
    Tag data processing method: 1-not flattened, 2-flattened.
    enableTag Boolean
    Whether to deliver TAG information.
    format Double
    Content format: 0-original content, 1-JSON.
    jsonType Double
    Consumption data JSON format: 1-not escaped, 2-escaped.
    metaFields List<String>
    Metadata field list.
    tagTransaction Double
    Tag data processing method: 1-not flattened, 2-flattened.
    enableTag boolean
    Whether to deliver TAG information.
    format number
    Content format: 0-original content, 1-JSON.
    jsonType number
    Consumption data JSON format: 1-not escaped, 2-escaped.
    metaFields string[]
    Metadata field list.
    tagTransaction number
    Tag data processing method: 1-not flattened, 2-flattened.
    enable_tag bool
    Whether to deliver TAG information.
    format float
    Content format: 0-original content, 1-JSON.
    json_type float
    Consumption data JSON format: 1-not escaped, 2-escaped.
    meta_fields Sequence[str]
    Metadata field list.
    tag_transaction float
    Tag data processing method: 1-not flattened, 2-flattened.
    enableTag Boolean
    Whether to deliver TAG information.
    format Number
    Content format: 0-original content, 1-JSON.
    jsonType Number
    Consumption data JSON format: 1-not escaped, 2-escaped.
    metaFields List<String>
    Metadata field list.
    tagTransaction Number
    Tag data processing method: 1-not flattened, 2-flattened.

    Import

    CLS kafka consumer can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/clsKafkaConsumer:ClsKafkaConsumer example c9b68233-948a-4eaf-a363-d0c2ced393ae
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    Viewing docs for tencentcloud 1.82.90
    published on Wednesday, Apr 29, 2026 by tencentcloudstack
      Try Pulumi Cloud free. Your team will thank you.