1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ClsCkafkaConsumer
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ClsCkafkaConsumer

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a cls ckafka_consumer

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const ckafkaConsumer = new tencentcloud.ClsCkafkaConsumer("ckafkaConsumer", {
        ckafka: {
            instanceId: "ckafka-qzoeaqx8",
            instanceName: "ckafka-instance",
            topicId: "topic-c6tm4kpm",
            topicName: "name",
            vip: "172.16.112.23",
            vport: "9092",
        },
        compression: 1,
        content: {
            enableTag: true,
            metaFields: [
                "__FILENAME__",
                "__HOSTNAME__",
                "__PKGID__",
                "__SOURCE__",
                "__TIMESTAMP__",
            ],
            tagJsonNotTiled: true,
            timestampAccuracy: 2,
        },
        needContent: true,
        topicId: "7e34a3a7-635e-4da8-9005-88106c1fde69",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    ckafka_consumer = tencentcloud.ClsCkafkaConsumer("ckafkaConsumer",
        ckafka={
            "instance_id": "ckafka-qzoeaqx8",
            "instance_name": "ckafka-instance",
            "topic_id": "topic-c6tm4kpm",
            "topic_name": "name",
            "vip": "172.16.112.23",
            "vport": "9092",
        },
        compression=1,
        content={
            "enable_tag": True,
            "meta_fields": [
                "__FILENAME__",
                "__HOSTNAME__",
                "__PKGID__",
                "__SOURCE__",
                "__TIMESTAMP__",
            ],
            "tag_json_not_tiled": True,
            "timestamp_accuracy": 2,
        },
        need_content=True,
        topic_id="7e34a3a7-635e-4da8-9005-88106c1fde69")
    
    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.NewClsCkafkaConsumer(ctx, "ckafkaConsumer", &tencentcloud.ClsCkafkaConsumerArgs{
    			Ckafka: &tencentcloud.ClsCkafkaConsumerCkafkaArgs{
    				InstanceId:   pulumi.String("ckafka-qzoeaqx8"),
    				InstanceName: pulumi.String("ckafka-instance"),
    				TopicId:      pulumi.String("topic-c6tm4kpm"),
    				TopicName:    pulumi.String("name"),
    				Vip:          pulumi.String("172.16.112.23"),
    				Vport:        pulumi.String("9092"),
    			},
    			Compression: pulumi.Float64(1),
    			Content: &tencentcloud.ClsCkafkaConsumerContentArgs{
    				EnableTag: pulumi.Bool(true),
    				MetaFields: pulumi.StringArray{
    					pulumi.String("__FILENAME__"),
    					pulumi.String("__HOSTNAME__"),
    					pulumi.String("__PKGID__"),
    					pulumi.String("__SOURCE__"),
    					pulumi.String("__TIMESTAMP__"),
    				},
    				TagJsonNotTiled:   pulumi.Bool(true),
    				TimestampAccuracy: pulumi.Float64(2),
    			},
    			NeedContent: pulumi.Bool(true),
    			TopicId:     pulumi.String("7e34a3a7-635e-4da8-9005-88106c1fde69"),
    		})
    		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 ckafkaConsumer = new Tencentcloud.ClsCkafkaConsumer("ckafkaConsumer", new()
        {
            Ckafka = new Tencentcloud.Inputs.ClsCkafkaConsumerCkafkaArgs
            {
                InstanceId = "ckafka-qzoeaqx8",
                InstanceName = "ckafka-instance",
                TopicId = "topic-c6tm4kpm",
                TopicName = "name",
                Vip = "172.16.112.23",
                Vport = "9092",
            },
            Compression = 1,
            Content = new Tencentcloud.Inputs.ClsCkafkaConsumerContentArgs
            {
                EnableTag = true,
                MetaFields = new[]
                {
                    "__FILENAME__",
                    "__HOSTNAME__",
                    "__PKGID__",
                    "__SOURCE__",
                    "__TIMESTAMP__",
                },
                TagJsonNotTiled = true,
                TimestampAccuracy = 2,
            },
            NeedContent = true,
            TopicId = "7e34a3a7-635e-4da8-9005-88106c1fde69",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClsCkafkaConsumer;
    import com.pulumi.tencentcloud.ClsCkafkaConsumerArgs;
    import com.pulumi.tencentcloud.inputs.ClsCkafkaConsumerCkafkaArgs;
    import com.pulumi.tencentcloud.inputs.ClsCkafkaConsumerContentArgs;
    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 ckafkaConsumer = new ClsCkafkaConsumer("ckafkaConsumer", ClsCkafkaConsumerArgs.builder()
                .ckafka(ClsCkafkaConsumerCkafkaArgs.builder()
                    .instanceId("ckafka-qzoeaqx8")
                    .instanceName("ckafka-instance")
                    .topicId("topic-c6tm4kpm")
                    .topicName("name")
                    .vip("172.16.112.23")
                    .vport("9092")
                    .build())
                .compression(1)
                .content(ClsCkafkaConsumerContentArgs.builder()
                    .enableTag(true)
                    .metaFields(                
                        "__FILENAME__",
                        "__HOSTNAME__",
                        "__PKGID__",
                        "__SOURCE__",
                        "__TIMESTAMP__")
                    .tagJsonNotTiled(true)
                    .timestampAccuracy(2)
                    .build())
                .needContent(true)
                .topicId("7e34a3a7-635e-4da8-9005-88106c1fde69")
                .build());
    
        }
    }
    
    resources:
      ckafkaConsumer:
        type: tencentcloud:ClsCkafkaConsumer
        properties:
          ckafka:
            instanceId: ckafka-qzoeaqx8
            instanceName: ckafka-instance
            topicId: topic-c6tm4kpm
            topicName: name
            vip: 172.16.112.23
            vport: '9092'
          compression: 1
          content:
            enableTag: true
            metaFields:
              - __FILENAME__
              - __HOSTNAME__
              - __PKGID__
              - __SOURCE__
              - __TIMESTAMP__
            tagJsonNotTiled: true
            timestampAccuracy: 2
          needContent: true
          topicId: 7e34a3a7-635e-4da8-9005-88106c1fde69
    

    Create ClsCkafkaConsumer Resource

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

    Constructor syntax

    new ClsCkafkaConsumer(name: string, args: ClsCkafkaConsumerArgs, opts?: CustomResourceOptions);
    @overload
    def ClsCkafkaConsumer(resource_name: str,
                          args: ClsCkafkaConsumerArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClsCkafkaConsumer(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          topic_id: Optional[str] = None,
                          ckafka: Optional[ClsCkafkaConsumerCkafkaArgs] = None,
                          cls_ckafka_consumer_id: Optional[str] = None,
                          compression: Optional[float] = None,
                          content: Optional[ClsCkafkaConsumerContentArgs] = None,
                          need_content: Optional[bool] = None)
    func NewClsCkafkaConsumer(ctx *Context, name string, args ClsCkafkaConsumerArgs, opts ...ResourceOption) (*ClsCkafkaConsumer, error)
    public ClsCkafkaConsumer(string name, ClsCkafkaConsumerArgs args, CustomResourceOptions? opts = null)
    public ClsCkafkaConsumer(String name, ClsCkafkaConsumerArgs args)
    public ClsCkafkaConsumer(String name, ClsCkafkaConsumerArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ClsCkafkaConsumer
    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 ClsCkafkaConsumerArgs
    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 ClsCkafkaConsumerArgs
    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 ClsCkafkaConsumerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClsCkafkaConsumerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClsCkafkaConsumerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    TopicId string
    topic id.
    Ckafka ClsCkafkaConsumerCkafka
    ckafka info.
    ClsCkafkaConsumerId string
    ID of the resource.
    Compression double
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    Content ClsCkafkaConsumerContent
    metadata information.
    NeedContent bool
    whether to deliver the metadata information of the log.
    TopicId string
    topic id.
    Ckafka ClsCkafkaConsumerCkafkaArgs
    ckafka info.
    ClsCkafkaConsumerId string
    ID of the resource.
    Compression float64
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    Content ClsCkafkaConsumerContentArgs
    metadata information.
    NeedContent bool
    whether to deliver the metadata information of the log.
    topicId String
    topic id.
    ckafka ClsCkafkaConsumerCkafka
    ckafka info.
    clsCkafkaConsumerId String
    ID of the resource.
    compression Double
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content ClsCkafkaConsumerContent
    metadata information.
    needContent Boolean
    whether to deliver the metadata information of the log.
    topicId string
    topic id.
    ckafka ClsCkafkaConsumerCkafka
    ckafka info.
    clsCkafkaConsumerId string
    ID of the resource.
    compression number
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content ClsCkafkaConsumerContent
    metadata information.
    needContent boolean
    whether to deliver the metadata information of the log.
    topic_id str
    topic id.
    ckafka ClsCkafkaConsumerCkafkaArgs
    ckafka info.
    cls_ckafka_consumer_id str
    ID of the resource.
    compression float
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content ClsCkafkaConsumerContentArgs
    metadata information.
    need_content bool
    whether to deliver the metadata information of the log.
    topicId String
    topic id.
    ckafka Property Map
    ckafka info.
    clsCkafkaConsumerId String
    ID of the resource.
    compression Number
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content Property Map
    metadata information.
    needContent Boolean
    whether to deliver the metadata information of the log.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ClsCkafkaConsumer Resource

    Get an existing ClsCkafkaConsumer 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?: ClsCkafkaConsumerState, opts?: CustomResourceOptions): ClsCkafkaConsumer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ckafka: Optional[ClsCkafkaConsumerCkafkaArgs] = None,
            cls_ckafka_consumer_id: Optional[str] = None,
            compression: Optional[float] = None,
            content: Optional[ClsCkafkaConsumerContentArgs] = None,
            need_content: Optional[bool] = None,
            topic_id: Optional[str] = None) -> ClsCkafkaConsumer
    func GetClsCkafkaConsumer(ctx *Context, name string, id IDInput, state *ClsCkafkaConsumerState, opts ...ResourceOption) (*ClsCkafkaConsumer, error)
    public static ClsCkafkaConsumer Get(string name, Input<string> id, ClsCkafkaConsumerState? state, CustomResourceOptions? opts = null)
    public static ClsCkafkaConsumer get(String name, Output<String> id, ClsCkafkaConsumerState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ClsCkafkaConsumer    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:
    Ckafka ClsCkafkaConsumerCkafka
    ckafka info.
    ClsCkafkaConsumerId string
    ID of the resource.
    Compression double
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    Content ClsCkafkaConsumerContent
    metadata information.
    NeedContent bool
    whether to deliver the metadata information of the log.
    TopicId string
    topic id.
    Ckafka ClsCkafkaConsumerCkafkaArgs
    ckafka info.
    ClsCkafkaConsumerId string
    ID of the resource.
    Compression float64
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    Content ClsCkafkaConsumerContentArgs
    metadata information.
    NeedContent bool
    whether to deliver the metadata information of the log.
    TopicId string
    topic id.
    ckafka ClsCkafkaConsumerCkafka
    ckafka info.
    clsCkafkaConsumerId String
    ID of the resource.
    compression Double
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content ClsCkafkaConsumerContent
    metadata information.
    needContent Boolean
    whether to deliver the metadata information of the log.
    topicId String
    topic id.
    ckafka ClsCkafkaConsumerCkafka
    ckafka info.
    clsCkafkaConsumerId string
    ID of the resource.
    compression number
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content ClsCkafkaConsumerContent
    metadata information.
    needContent boolean
    whether to deliver the metadata information of the log.
    topicId string
    topic id.
    ckafka ClsCkafkaConsumerCkafkaArgs
    ckafka info.
    cls_ckafka_consumer_id str
    ID of the resource.
    compression float
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content ClsCkafkaConsumerContentArgs
    metadata information.
    need_content bool
    whether to deliver the metadata information of the log.
    topic_id str
    topic id.
    ckafka Property Map
    ckafka info.
    clsCkafkaConsumerId String
    ID of the resource.
    compression Number
    compression method. 0 for NONE, 2 for SNAPPY, 3 for LZ4.
    content Property Map
    metadata information.
    needContent Boolean
    whether to deliver the metadata information of the log.
    topicId String
    topic id.

    Supporting Types

    ClsCkafkaConsumerCkafka, ClsCkafkaConsumerCkafkaArgs

    InstanceId string
    instance id.
    InstanceName string
    instance name.
    TopicId string
    topic id of ckafka.
    TopicName string
    topic name of ckafka.
    Vip string
    vip.
    Vport string
    vport.
    InstanceId string
    instance id.
    InstanceName string
    instance name.
    TopicId string
    topic id of ckafka.
    TopicName string
    topic name of ckafka.
    Vip string
    vip.
    Vport string
    vport.
    instanceId String
    instance id.
    instanceName String
    instance name.
    topicId String
    topic id of ckafka.
    topicName String
    topic name of ckafka.
    vip String
    vip.
    vport String
    vport.
    instanceId string
    instance id.
    instanceName string
    instance name.
    topicId string
    topic id of ckafka.
    topicName string
    topic name of ckafka.
    vip string
    vip.
    vport string
    vport.
    instance_id str
    instance id.
    instance_name str
    instance name.
    topic_id str
    topic id of ckafka.
    topic_name str
    topic name of ckafka.
    vip str
    vip.
    vport str
    vport.
    instanceId String
    instance id.
    instanceName String
    instance name.
    topicId String
    topic id of ckafka.
    topicName String
    topic name of ckafka.
    vip String
    vip.
    vport String
    vport.

    ClsCkafkaConsumerContent, ClsCkafkaConsumerContentArgs

    EnableTag bool
    whether to deliver the TAG info.
    MetaFields List<string>
    metadata info list.
    TagJsonNotTiled bool
    whether to tiling tag json.
    TimestampAccuracy double
    delivery timestamp precision,1 for second, 2 for millisecond.
    EnableTag bool
    whether to deliver the TAG info.
    MetaFields []string
    metadata info list.
    TagJsonNotTiled bool
    whether to tiling tag json.
    TimestampAccuracy float64
    delivery timestamp precision,1 for second, 2 for millisecond.
    enableTag Boolean
    whether to deliver the TAG info.
    metaFields List<String>
    metadata info list.
    tagJsonNotTiled Boolean
    whether to tiling tag json.
    timestampAccuracy Double
    delivery timestamp precision,1 for second, 2 for millisecond.
    enableTag boolean
    whether to deliver the TAG info.
    metaFields string[]
    metadata info list.
    tagJsonNotTiled boolean
    whether to tiling tag json.
    timestampAccuracy number
    delivery timestamp precision,1 for second, 2 for millisecond.
    enable_tag bool
    whether to deliver the TAG info.
    meta_fields Sequence[str]
    metadata info list.
    tag_json_not_tiled bool
    whether to tiling tag json.
    timestamp_accuracy float
    delivery timestamp precision,1 for second, 2 for millisecond.
    enableTag Boolean
    whether to deliver the TAG info.
    metaFields List<String>
    metadata info list.
    tagJsonNotTiled Boolean
    whether to tiling tag json.
    timestampAccuracy Number
    delivery timestamp precision,1 for second, 2 for millisecond.

    Import

    cls ckafka_consumer can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/clsCkafkaConsumer:ClsCkafkaConsumer ckafka_consumer topic_id
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack