published on Wednesday, Apr 15, 2026 by tencentcloudstack
published on Wednesday, Apr 15, 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:
- From
Topic stringId - Log topic ID.
- Cls
Kafka stringConsumer Id - ID of the resource.
- Compression double
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- Consumer
Content ClsKafka Consumer Consumer Content - Kafka protocol consumption data format.
- From
Topic stringId - Log topic ID.
- Cls
Kafka stringConsumer Id - ID of the resource.
- Compression float64
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- Consumer
Content ClsKafka Consumer Consumer Content Args - Kafka protocol consumption data format.
- from
Topic StringId - Log topic ID.
- cls
Kafka StringConsumer Id - ID of the resource.
- compression Double
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer
Content ClsKafka Consumer Consumer Content - Kafka protocol consumption data format.
- from
Topic stringId - Log topic ID.
- cls
Kafka stringConsumer Id - ID of the resource.
- compression number
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer
Content ClsKafka Consumer Consumer Content - Kafka protocol consumption data format.
- from_
topic_ strid - Log topic ID.
- cls_
kafka_ strconsumer_ id - ID of the resource.
- compression float
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer_
content ClsKafka Consumer Consumer Content Args - Kafka protocol consumption data format.
- from
Topic StringId - Log topic ID.
- cls
Kafka StringConsumer Id - ID of the resource.
- compression Number
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer
Content 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:
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) -> ClsKafkaConsumerfunc 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.
- Cls
Kafka stringConsumer Id - ID of the resource.
- Compression double
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- Consumer
Content ClsKafka Consumer Consumer Content - Kafka protocol consumption data format.
- From
Topic stringId - Log topic ID.
- Topic
Id string - Topic parameter used when KafkaConsumer consumes.
- Cls
Kafka stringConsumer Id - ID of the resource.
- Compression float64
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- Consumer
Content ClsKafka Consumer Consumer Content Args - Kafka protocol consumption data format.
- From
Topic stringId - Log topic ID.
- Topic
Id string - Topic parameter used when KafkaConsumer consumes.
- cls
Kafka StringConsumer Id - ID of the resource.
- compression Double
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer
Content ClsKafka Consumer Consumer Content - Kafka protocol consumption data format.
- from
Topic StringId - Log topic ID.
- topic
Id String - Topic parameter used when KafkaConsumer consumes.
- cls
Kafka stringConsumer Id - ID of the resource.
- compression number
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer
Content ClsKafka Consumer Consumer Content - Kafka protocol consumption data format.
- from
Topic stringId - Log topic ID.
- topic
Id string - Topic parameter used when KafkaConsumer consumes.
- cls_
kafka_ strconsumer_ id - ID of the resource.
- compression float
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer_
content ClsKafka Consumer Consumer Content Args - Kafka protocol consumption data format.
- from_
topic_ strid - Log topic ID.
- topic_
id str - Topic parameter used when KafkaConsumer consumes.
- cls
Kafka StringConsumer Id - ID of the resource.
- compression Number
- Compression method: 0-NONE, 2-SNAPPY, 3-LZ4.
- consumer
Content Property Map - Kafka protocol consumption data format.
- from
Topic StringId - Log topic ID.
- topic
Id String - Topic parameter used when KafkaConsumer consumes.
Supporting Types
ClsKafkaConsumerConsumerContent, ClsKafkaConsumerConsumerContentArgs
- Enable
Tag bool - Whether to deliver TAG information.
- Format double
- Content format: 0-original content, 1-JSON.
- Json
Type double - Consumption data JSON format: 1-not escaped, 2-escaped.
- Meta
Fields List<string> - Metadata field list.
- Tag
Transaction double - Tag data processing method: 1-not flattened, 2-flattened.
- Enable
Tag bool - Whether to deliver TAG information.
- Format float64
- Content format: 0-original content, 1-JSON.
- Json
Type float64 - Consumption data JSON format: 1-not escaped, 2-escaped.
- Meta
Fields []string - Metadata field list.
- Tag
Transaction float64 - Tag data processing method: 1-not flattened, 2-flattened.
- enable
Tag Boolean - Whether to deliver TAG information.
- format Double
- Content format: 0-original content, 1-JSON.
- json
Type Double - Consumption data JSON format: 1-not escaped, 2-escaped.
- meta
Fields List<String> - Metadata field list.
- tag
Transaction Double - Tag data processing method: 1-not flattened, 2-flattened.
- enable
Tag boolean - Whether to deliver TAG information.
- format number
- Content format: 0-original content, 1-JSON.
- json
Type number - Consumption data JSON format: 1-not escaped, 2-escaped.
- meta
Fields string[] - Metadata field list.
- tag
Transaction 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.
- enable
Tag Boolean - Whether to deliver TAG information.
- format Number
- Content format: 0-original content, 1-JSON.
- json
Type Number - Consumption data JSON format: 1-not escaped, 2-escaped.
- meta
Fields List<String> - Metadata field list.
- tag
Transaction 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
tencentcloudTerraform Provider.
published on Wednesday, Apr 15, 2026 by tencentcloudstack
