1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TdmqTopic
tencentcloud 1.81.187 published on Monday, Apr 28, 2025 by tencentcloudstack

tencentcloud.TdmqTopic

Explore with Pulumi AI

Provide a resource to create a TDMQ topic.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const exampleTdmqInstance = new tencentcloud.TdmqInstance("exampleTdmqInstance", {
    clusterName: "tf_example",
    remark: "remark.",
    tags: {
        createdBy: "terraform",
    },
});
const exampleTdmqNamespace = new tencentcloud.TdmqNamespace("exampleTdmqNamespace", {
    environName: "tf_example",
    msgTtl: 300,
    clusterId: exampleTdmqInstance.tdmqInstanceId,
    retentionPolicy: {
        timeInMinutes: 60,
        sizeInMb: 10,
    },
    remark: "remark.",
});
const exampleTdmqTopic = new tencentcloud.TdmqTopic("exampleTdmqTopic", {
    environId: exampleTdmqNamespace.environName,
    clusterId: exampleTdmqInstance.tdmqInstanceId,
    topicName: "tf-example-topic",
    partitions: 6,
    pulsarTopicType: 3,
    remark: "remark.",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

example_tdmq_instance = tencentcloud.TdmqInstance("exampleTdmqInstance",
    cluster_name="tf_example",
    remark="remark.",
    tags={
        "createdBy": "terraform",
    })
example_tdmq_namespace = tencentcloud.TdmqNamespace("exampleTdmqNamespace",
    environ_name="tf_example",
    msg_ttl=300,
    cluster_id=example_tdmq_instance.tdmq_instance_id,
    retention_policy={
        "time_in_minutes": 60,
        "size_in_mb": 10,
    },
    remark="remark.")
example_tdmq_topic = tencentcloud.TdmqTopic("exampleTdmqTopic",
    environ_id=example_tdmq_namespace.environ_name,
    cluster_id=example_tdmq_instance.tdmq_instance_id,
    topic_name="tf-example-topic",
    partitions=6,
    pulsar_topic_type=3,
    remark="remark.")
Copy
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 {
		exampleTdmqInstance, err := tencentcloud.NewTdmqInstance(ctx, "exampleTdmqInstance", &tencentcloud.TdmqInstanceArgs{
			ClusterName: pulumi.String("tf_example"),
			Remark:      pulumi.String("remark."),
			Tags: pulumi.StringMap{
				"createdBy": pulumi.String("terraform"),
			},
		})
		if err != nil {
			return err
		}
		exampleTdmqNamespace, err := tencentcloud.NewTdmqNamespace(ctx, "exampleTdmqNamespace", &tencentcloud.TdmqNamespaceArgs{
			EnvironName: pulumi.String("tf_example"),
			MsgTtl:      pulumi.Float64(300),
			ClusterId:   exampleTdmqInstance.TdmqInstanceId,
			RetentionPolicy: &tencentcloud.TdmqNamespaceRetentionPolicyArgs{
				TimeInMinutes: pulumi.Float64(60),
				SizeInMb:      pulumi.Float64(10),
			},
			Remark: pulumi.String("remark."),
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewTdmqTopic(ctx, "exampleTdmqTopic", &tencentcloud.TdmqTopicArgs{
			EnvironId:       exampleTdmqNamespace.EnvironName,
			ClusterId:       exampleTdmqInstance.TdmqInstanceId,
			TopicName:       pulumi.String("tf-example-topic"),
			Partitions:      pulumi.Float64(6),
			PulsarTopicType: pulumi.Float64(3),
			Remark:          pulumi.String("remark."),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var exampleTdmqInstance = new Tencentcloud.TdmqInstance("exampleTdmqInstance", new()
    {
        ClusterName = "tf_example",
        Remark = "remark.",
        Tags = 
        {
            { "createdBy", "terraform" },
        },
    });

    var exampleTdmqNamespace = new Tencentcloud.TdmqNamespace("exampleTdmqNamespace", new()
    {
        EnvironName = "tf_example",
        MsgTtl = 300,
        ClusterId = exampleTdmqInstance.TdmqInstanceId,
        RetentionPolicy = new Tencentcloud.Inputs.TdmqNamespaceRetentionPolicyArgs
        {
            TimeInMinutes = 60,
            SizeInMb = 10,
        },
        Remark = "remark.",
    });

    var exampleTdmqTopic = new Tencentcloud.TdmqTopic("exampleTdmqTopic", new()
    {
        EnvironId = exampleTdmqNamespace.EnvironName,
        ClusterId = exampleTdmqInstance.TdmqInstanceId,
        TopicName = "tf-example-topic",
        Partitions = 6,
        PulsarTopicType = 3,
        Remark = "remark.",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TdmqInstance;
import com.pulumi.tencentcloud.TdmqInstanceArgs;
import com.pulumi.tencentcloud.TdmqNamespace;
import com.pulumi.tencentcloud.TdmqNamespaceArgs;
import com.pulumi.tencentcloud.inputs.TdmqNamespaceRetentionPolicyArgs;
import com.pulumi.tencentcloud.TdmqTopic;
import com.pulumi.tencentcloud.TdmqTopicArgs;
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 exampleTdmqInstance = new TdmqInstance("exampleTdmqInstance", TdmqInstanceArgs.builder()
            .clusterName("tf_example")
            .remark("remark.")
            .tags(Map.of("createdBy", "terraform"))
            .build());

        var exampleTdmqNamespace = new TdmqNamespace("exampleTdmqNamespace", TdmqNamespaceArgs.builder()
            .environName("tf_example")
            .msgTtl(300)
            .clusterId(exampleTdmqInstance.tdmqInstanceId())
            .retentionPolicy(TdmqNamespaceRetentionPolicyArgs.builder()
                .timeInMinutes(60)
                .sizeInMb(10)
                .build())
            .remark("remark.")
            .build());

        var exampleTdmqTopic = new TdmqTopic("exampleTdmqTopic", TdmqTopicArgs.builder()
            .environId(exampleTdmqNamespace.environName())
            .clusterId(exampleTdmqInstance.tdmqInstanceId())
            .topicName("tf-example-topic")
            .partitions(6)
            .pulsarTopicType(3)
            .remark("remark.")
            .build());

    }
}
Copy
resources:
  exampleTdmqInstance:
    type: tencentcloud:TdmqInstance
    properties:
      clusterName: tf_example
      remark: remark.
      tags:
        createdBy: terraform
  exampleTdmqNamespace:
    type: tencentcloud:TdmqNamespace
    properties:
      environName: tf_example
      msgTtl: 300
      clusterId: ${exampleTdmqInstance.tdmqInstanceId}
      retentionPolicy:
        timeInMinutes: 60
        sizeInMb: 10
      remark: remark.
  exampleTdmqTopic:
    type: tencentcloud:TdmqTopic
    properties:
      environId: ${exampleTdmqNamespace.environName}
      clusterId: ${exampleTdmqInstance.tdmqInstanceId}
      topicName: tf-example-topic
      partitions: 6
      pulsarTopicType: 3
      remark: remark.
Copy

Create TdmqTopic Resource

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

Constructor syntax

new TdmqTopic(name: string, args: TdmqTopicArgs, opts?: CustomResourceOptions);
@overload
def TdmqTopic(resource_name: str,
              args: TdmqTopicArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def TdmqTopic(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              cluster_id: Optional[str] = None,
              environ_id: Optional[str] = None,
              partitions: Optional[float] = None,
              topic_name: Optional[str] = None,
              pulsar_topic_type: Optional[float] = None,
              remark: Optional[str] = None,
              tdmq_topic_id: Optional[str] = None,
              topic_type: Optional[float] = None)
func NewTdmqTopic(ctx *Context, name string, args TdmqTopicArgs, opts ...ResourceOption) (*TdmqTopic, error)
public TdmqTopic(string name, TdmqTopicArgs args, CustomResourceOptions? opts = null)
public TdmqTopic(String name, TdmqTopicArgs args)
public TdmqTopic(String name, TdmqTopicArgs args, CustomResourceOptions options)
type: tencentcloud:TdmqTopic
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

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

ClusterId This property is required. string
The Dedicated Cluster Id.
EnvironId This property is required. string
The name of tdmq namespace.
Partitions This property is required. double
The partitions of topic.
TopicName This property is required. string
The name of topic to be created.
PulsarTopicType double
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
Remark string
Description of the namespace.
TdmqTopicId string
ID of the resource.
TopicType double
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

ClusterId This property is required. string
The Dedicated Cluster Id.
EnvironId This property is required. string
The name of tdmq namespace.
Partitions This property is required. float64
The partitions of topic.
TopicName This property is required. string
The name of topic to be created.
PulsarTopicType float64
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
Remark string
Description of the namespace.
TdmqTopicId string
ID of the resource.
TopicType float64
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

clusterId This property is required. String
The Dedicated Cluster Id.
environId This property is required. String
The name of tdmq namespace.
partitions This property is required. Double
The partitions of topic.
topicName This property is required. String
The name of topic to be created.
pulsarTopicType Double
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark String
Description of the namespace.
tdmqTopicId String
ID of the resource.
topicType Double
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

clusterId This property is required. string
The Dedicated Cluster Id.
environId This property is required. string
The name of tdmq namespace.
partitions This property is required. number
The partitions of topic.
topicName This property is required. string
The name of topic to be created.
pulsarTopicType number
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark string
Description of the namespace.
tdmqTopicId string
ID of the resource.
topicType number
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

cluster_id This property is required. str
The Dedicated Cluster Id.
environ_id This property is required. str
The name of tdmq namespace.
partitions This property is required. float
The partitions of topic.
topic_name This property is required. str
The name of topic to be created.
pulsar_topic_type float
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark str
Description of the namespace.
tdmq_topic_id str
ID of the resource.
topic_type float
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

clusterId This property is required. String
The Dedicated Cluster Id.
environId This property is required. String
The name of tdmq namespace.
partitions This property is required. Number
The partitions of topic.
topicName This property is required. String
The name of topic to be created.
pulsarTopicType Number
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark String
Description of the namespace.
tdmqTopicId String
ID of the resource.
topicType Number
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

Outputs

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

CreateTime string
Creation time of resource.
Id string
The provider-assigned unique ID for this managed resource.
CreateTime string
Creation time of resource.
Id string
The provider-assigned unique ID for this managed resource.
createTime String
Creation time of resource.
id String
The provider-assigned unique ID for this managed resource.
createTime string
Creation time of resource.
id string
The provider-assigned unique ID for this managed resource.
create_time str
Creation time of resource.
id str
The provider-assigned unique ID for this managed resource.
createTime String
Creation time of resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TdmqTopic Resource

Get an existing TdmqTopic 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?: TdmqTopicState, opts?: CustomResourceOptions): TdmqTopic
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        create_time: Optional[str] = None,
        environ_id: Optional[str] = None,
        partitions: Optional[float] = None,
        pulsar_topic_type: Optional[float] = None,
        remark: Optional[str] = None,
        tdmq_topic_id: Optional[str] = None,
        topic_name: Optional[str] = None,
        topic_type: Optional[float] = None) -> TdmqTopic
func GetTdmqTopic(ctx *Context, name string, id IDInput, state *TdmqTopicState, opts ...ResourceOption) (*TdmqTopic, error)
public static TdmqTopic Get(string name, Input<string> id, TdmqTopicState? state, CustomResourceOptions? opts = null)
public static TdmqTopic get(String name, Output<String> id, TdmqTopicState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:TdmqTopic    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ClusterId string
The Dedicated Cluster Id.
CreateTime string
Creation time of resource.
EnvironId string
The name of tdmq namespace.
Partitions double
The partitions of topic.
PulsarTopicType double
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
Remark string
Description of the namespace.
TdmqTopicId string
ID of the resource.
TopicName string
The name of topic to be created.
TopicType double
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

ClusterId string
The Dedicated Cluster Id.
CreateTime string
Creation time of resource.
EnvironId string
The name of tdmq namespace.
Partitions float64
The partitions of topic.
PulsarTopicType float64
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
Remark string
Description of the namespace.
TdmqTopicId string
ID of the resource.
TopicName string
The name of topic to be created.
TopicType float64
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

clusterId String
The Dedicated Cluster Id.
createTime String
Creation time of resource.
environId String
The name of tdmq namespace.
partitions Double
The partitions of topic.
pulsarTopicType Double
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark String
Description of the namespace.
tdmqTopicId String
ID of the resource.
topicName String
The name of topic to be created.
topicType Double
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

clusterId string
The Dedicated Cluster Id.
createTime string
Creation time of resource.
environId string
The name of tdmq namespace.
partitions number
The partitions of topic.
pulsarTopicType number
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark string
Description of the namespace.
tdmqTopicId string
ID of the resource.
topicName string
The name of topic to be created.
topicType number
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

cluster_id str
The Dedicated Cluster Id.
create_time str
Creation time of resource.
environ_id str
The name of tdmq namespace.
partitions float
The partitions of topic.
pulsar_topic_type float
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark str
Description of the namespace.
tdmq_topic_id str
ID of the resource.
topic_name str
The name of topic to be created.
topic_type float
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

clusterId String
The Dedicated Cluster Id.
createTime String
Creation time of resource.
environId String
The name of tdmq namespace.
partitions Number
The partitions of topic.
pulsarTopicType Number
Pulsar Topic Type 0: Non-persistent non-partitioned 1: Non-persistent partitioned 2: Persistent non-partitioned 3: Persistent partitioned.
remark String
Description of the namespace.
tdmqTopicId String
ID of the resource.
topicName String
The name of topic to be created.
topicType Number
This input will be gradually discarded and can be switched to PulsarTopicType parameter 0: Normal message; 1: Global sequential messages; 2: Local sequential messages; 3: Retrying queue; 4: Dead letter queue. The type of topic.

Deprecated: Deprecated

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.