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.",
});
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.")
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
})
}
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.",
});
});
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());
}
}
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.
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 string
- The unique name of the resource.
- args TdmqTopicArgs
- 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 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 string
- The unique name of the resource.
- args TdmqTopicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TdmqTopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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:
- Cluster
Id string - The Dedicated Cluster Id.
- Environ
Id string - The name of tdmq namespace.
- Partitions double
- The partitions of topic.
- Topic
Name string - The name of topic to be created.
- Pulsar
Topic doubleType - 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.
- Tdmq
Topic stringId - ID of the resource.
- Topic
Type 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.
- Cluster
Id string - The Dedicated Cluster Id.
- Environ
Id string - The name of tdmq namespace.
- Partitions float64
- The partitions of topic.
- Topic
Name string - The name of topic to be created.
- Pulsar
Topic float64Type - 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.
- Tdmq
Topic stringId - ID of the resource.
- Topic
Type 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.
- cluster
Id String - The Dedicated Cluster Id.
- environ
Id String - The name of tdmq namespace.
- partitions Double
- The partitions of topic.
- topic
Name String - The name of topic to be created.
- pulsar
Topic DoubleType - 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.
- tdmq
Topic StringId - ID of the resource.
- topic
Type 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.
- cluster
Id string - The Dedicated Cluster Id.
- environ
Id string - The name of tdmq namespace.
- partitions number
- The partitions of topic.
- topic
Name string - The name of topic to be created.
- pulsar
Topic numberType - 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.
- tdmq
Topic stringId - ID of the resource.
- topic
Type 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.
- cluster_
id str - The Dedicated Cluster Id.
- environ_
id str - The name of tdmq namespace.
- partitions float
- The partitions of topic.
- topic_
name str - The name of topic to be created.
- pulsar_
topic_ floattype - 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_ strid - 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.
- cluster
Id String - The Dedicated Cluster Id.
- environ
Id String - The name of tdmq namespace.
- partitions Number
- The partitions of topic.
- topic
Name String - The name of topic to be created.
- pulsar
Topic NumberType - 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.
- tdmq
Topic StringId - ID of the resource.
- topic
Type 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the TdmqTopic resource produces the following output properties:
- Create
Time string - Creation time of resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - Creation time of resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - Creation time of resource.
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time 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.
- create
Time 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
- 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.
- Cluster
Id string - The Dedicated Cluster Id.
- Create
Time string - Creation time of resource.
- Environ
Id string - The name of tdmq namespace.
- Partitions double
- The partitions of topic.
- Pulsar
Topic doubleType - 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.
- Tdmq
Topic stringId - ID of the resource.
- Topic
Name string - The name of topic to be created.
- Topic
Type 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.
- Cluster
Id string - The Dedicated Cluster Id.
- Create
Time string - Creation time of resource.
- Environ
Id string - The name of tdmq namespace.
- Partitions float64
- The partitions of topic.
- Pulsar
Topic float64Type - 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.
- Tdmq
Topic stringId - ID of the resource.
- Topic
Name string - The name of topic to be created.
- Topic
Type 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.
- cluster
Id String - The Dedicated Cluster Id.
- create
Time String - Creation time of resource.
- environ
Id String - The name of tdmq namespace.
- partitions Double
- The partitions of topic.
- pulsar
Topic DoubleType - 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.
- tdmq
Topic StringId - ID of the resource.
- topic
Name String - The name of topic to be created.
- topic
Type 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.
- cluster
Id string - The Dedicated Cluster Id.
- create
Time string - Creation time of resource.
- environ
Id string - The name of tdmq namespace.
- partitions number
- The partitions of topic.
- pulsar
Topic numberType - 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.
- tdmq
Topic stringId - ID of the resource.
- topic
Name string - The name of topic to be created.
- topic
Type 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.
- 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_ floattype - 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_ strid - 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.
- cluster
Id String - The Dedicated Cluster Id.
- create
Time String - Creation time of resource.
- environ
Id String - The name of tdmq namespace.
- partitions Number
- The partitions of topic.
- pulsar
Topic NumberType - 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.
- tdmq
Topic StringId - ID of the resource.
- topic
Name String - The name of topic to be created.
- topic
Type 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.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.