tencentcloud.TdmqSubscription
Explore with Pulumi AI
Provides a resource to create a tdmq subscription
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", {
clusterId: exampleTdmqInstance.tdmqInstanceId,
environId: exampleTdmqNamespace.environName,
topicName: "tf-example-topic",
partitions: 1,
pulsarTopicType: 3,
remark: "remark.",
});
const exampleTdmqSubscription = new tencentcloud.TdmqSubscription("exampleTdmqSubscription", {
clusterId: exampleTdmqInstance.tdmqInstanceId,
environmentId: exampleTdmqNamespace.environName,
topicName: exampleTdmqTopic.topicName,
subscriptionName: "tf-example-subscription",
remark: "remark.",
autoCreatePolicyTopic: true,
autoDeletePolicyTopic: true,
});
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",
cluster_id=example_tdmq_instance.tdmq_instance_id,
environ_id=example_tdmq_namespace.environ_name,
topic_name="tf-example-topic",
partitions=1,
pulsar_topic_type=3,
remark="remark.")
example_tdmq_subscription = tencentcloud.TdmqSubscription("exampleTdmqSubscription",
cluster_id=example_tdmq_instance.tdmq_instance_id,
environment_id=example_tdmq_namespace.environ_name,
topic_name=example_tdmq_topic.topic_name,
subscription_name="tf-example-subscription",
remark="remark.",
auto_create_policy_topic=True,
auto_delete_policy_topic=True)
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
}
exampleTdmqTopic, err := tencentcloud.NewTdmqTopic(ctx, "exampleTdmqTopic", &tencentcloud.TdmqTopicArgs{
ClusterId: exampleTdmqInstance.TdmqInstanceId,
EnvironId: exampleTdmqNamespace.EnvironName,
TopicName: pulumi.String("tf-example-topic"),
Partitions: pulumi.Float64(1),
PulsarTopicType: pulumi.Float64(3),
Remark: pulumi.String("remark."),
})
if err != nil {
return err
}
_, err = tencentcloud.NewTdmqSubscription(ctx, "exampleTdmqSubscription", &tencentcloud.TdmqSubscriptionArgs{
ClusterId: exampleTdmqInstance.TdmqInstanceId,
EnvironmentId: exampleTdmqNamespace.EnvironName,
TopicName: exampleTdmqTopic.TopicName,
SubscriptionName: pulumi.String("tf-example-subscription"),
Remark: pulumi.String("remark."),
AutoCreatePolicyTopic: pulumi.Bool(true),
AutoDeletePolicyTopic: pulumi.Bool(true),
})
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()
{
ClusterId = exampleTdmqInstance.TdmqInstanceId,
EnvironId = exampleTdmqNamespace.EnvironName,
TopicName = "tf-example-topic",
Partitions = 1,
PulsarTopicType = 3,
Remark = "remark.",
});
var exampleTdmqSubscription = new Tencentcloud.TdmqSubscription("exampleTdmqSubscription", new()
{
ClusterId = exampleTdmqInstance.TdmqInstanceId,
EnvironmentId = exampleTdmqNamespace.EnvironName,
TopicName = exampleTdmqTopic.TopicName,
SubscriptionName = "tf-example-subscription",
Remark = "remark.",
AutoCreatePolicyTopic = true,
AutoDeletePolicyTopic = true,
});
});
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 com.pulumi.tencentcloud.TdmqSubscription;
import com.pulumi.tencentcloud.TdmqSubscriptionArgs;
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()
.clusterId(exampleTdmqInstance.tdmqInstanceId())
.environId(exampleTdmqNamespace.environName())
.topicName("tf-example-topic")
.partitions(1)
.pulsarTopicType(3)
.remark("remark.")
.build());
var exampleTdmqSubscription = new TdmqSubscription("exampleTdmqSubscription", TdmqSubscriptionArgs.builder()
.clusterId(exampleTdmqInstance.tdmqInstanceId())
.environmentId(exampleTdmqNamespace.environName())
.topicName(exampleTdmqTopic.topicName())
.subscriptionName("tf-example-subscription")
.remark("remark.")
.autoCreatePolicyTopic(true)
.autoDeletePolicyTopic(true)
.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:
clusterId: ${exampleTdmqInstance.tdmqInstanceId}
environId: ${exampleTdmqNamespace.environName}
topicName: tf-example-topic
partitions: 1
pulsarTopicType: 3
remark: remark.
exampleTdmqSubscription:
type: tencentcloud:TdmqSubscription
properties:
clusterId: ${exampleTdmqInstance.tdmqInstanceId}
environmentId: ${exampleTdmqNamespace.environName}
topicName: ${exampleTdmqTopic.topicName}
subscriptionName: tf-example-subscription
remark: remark.
autoCreatePolicyTopic: true
autoDeletePolicyTopic: true
Create TdmqSubscription Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TdmqSubscription(name: string, args: TdmqSubscriptionArgs, opts?: CustomResourceOptions);
@overload
def TdmqSubscription(resource_name: str,
args: TdmqSubscriptionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TdmqSubscription(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
environment_id: Optional[str] = None,
subscription_name: Optional[str] = None,
topic_name: Optional[str] = None,
auto_create_policy_topic: Optional[bool] = None,
auto_delete_policy_topic: Optional[bool] = None,
remark: Optional[str] = None,
tdmq_subscription_id: Optional[str] = None)
func NewTdmqSubscription(ctx *Context, name string, args TdmqSubscriptionArgs, opts ...ResourceOption) (*TdmqSubscription, error)
public TdmqSubscription(string name, TdmqSubscriptionArgs args, CustomResourceOptions? opts = null)
public TdmqSubscription(String name, TdmqSubscriptionArgs args)
public TdmqSubscription(String name, TdmqSubscriptionArgs args, CustomResourceOptions options)
type: tencentcloud:TdmqSubscription
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 TdmqSubscriptionArgs
- 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 TdmqSubscriptionArgs
- 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 TdmqSubscriptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TdmqSubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TdmqSubscriptionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TdmqSubscription 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 TdmqSubscription resource accepts the following input properties:
- Cluster
Id string - Pulsar cluster ID.
- Environment
Id string - Environment (namespace) name.
- Subscription
Name string - Subscriber name, which can contain up to 128 characters.
- Topic
Name string - Topic name.
- Auto
Create boolPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- Auto
Delete boolPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - Remark string
- Remarks (up to 128 characters).
- Tdmq
Subscription stringId - ID of the resource.
- Cluster
Id string - Pulsar cluster ID.
- Environment
Id string - Environment (namespace) name.
- Subscription
Name string - Subscriber name, which can contain up to 128 characters.
- Topic
Name string - Topic name.
- Auto
Create boolPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- Auto
Delete boolPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - Remark string
- Remarks (up to 128 characters).
- Tdmq
Subscription stringId - ID of the resource.
- cluster
Id String - Pulsar cluster ID.
- environment
Id String - Environment (namespace) name.
- subscription
Name String - Subscriber name, which can contain up to 128 characters.
- topic
Name String - Topic name.
- auto
Create BooleanPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto
Delete BooleanPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - remark String
- Remarks (up to 128 characters).
- tdmq
Subscription StringId - ID of the resource.
- cluster
Id string - Pulsar cluster ID.
- environment
Id string - Environment (namespace) name.
- subscription
Name string - Subscriber name, which can contain up to 128 characters.
- topic
Name string - Topic name.
- auto
Create booleanPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto
Delete booleanPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - remark string
- Remarks (up to 128 characters).
- tdmq
Subscription stringId - ID of the resource.
- cluster_
id str - Pulsar cluster ID.
- environment_
id str - Environment (namespace) name.
- subscription_
name str - Subscriber name, which can contain up to 128 characters.
- topic_
name str - Topic name.
- auto_
create_ boolpolicy_ topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto_
delete_ boolpolicy_ topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - remark str
- Remarks (up to 128 characters).
- tdmq_
subscription_ strid - ID of the resource.
- cluster
Id String - Pulsar cluster ID.
- environment
Id String - Environment (namespace) name.
- subscription
Name String - Subscriber name, which can contain up to 128 characters.
- topic
Name String - Topic name.
- auto
Create BooleanPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto
Delete BooleanPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - remark String
- Remarks (up to 128 characters).
- tdmq
Subscription StringId - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the TdmqSubscription 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 TdmqSubscription Resource
Get an existing TdmqSubscription 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?: TdmqSubscriptionState, opts?: CustomResourceOptions): TdmqSubscription
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_create_policy_topic: Optional[bool] = None,
auto_delete_policy_topic: Optional[bool] = None,
cluster_id: Optional[str] = None,
environment_id: Optional[str] = None,
remark: Optional[str] = None,
subscription_name: Optional[str] = None,
tdmq_subscription_id: Optional[str] = None,
topic_name: Optional[str] = None) -> TdmqSubscription
func GetTdmqSubscription(ctx *Context, name string, id IDInput, state *TdmqSubscriptionState, opts ...ResourceOption) (*TdmqSubscription, error)
public static TdmqSubscription Get(string name, Input<string> id, TdmqSubscriptionState? state, CustomResourceOptions? opts = null)
public static TdmqSubscription get(String name, Output<String> id, TdmqSubscriptionState state, CustomResourceOptions options)
resources: _: type: tencentcloud:TdmqSubscription 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.
- Auto
Create boolPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- Auto
Delete boolPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - Cluster
Id string - Pulsar cluster ID.
- Environment
Id string - Environment (namespace) name.
- Remark string
- Remarks (up to 128 characters).
- Subscription
Name string - Subscriber name, which can contain up to 128 characters.
- Tdmq
Subscription stringId - ID of the resource.
- Topic
Name string - Topic name.
- Auto
Create boolPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- Auto
Delete boolPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - Cluster
Id string - Pulsar cluster ID.
- Environment
Id string - Environment (namespace) name.
- Remark string
- Remarks (up to 128 characters).
- Subscription
Name string - Subscriber name, which can contain up to 128 characters.
- Tdmq
Subscription stringId - ID of the resource.
- Topic
Name string - Topic name.
- auto
Create BooleanPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto
Delete BooleanPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - cluster
Id String - Pulsar cluster ID.
- environment
Id String - Environment (namespace) name.
- remark String
- Remarks (up to 128 characters).
- subscription
Name String - Subscriber name, which can contain up to 128 characters.
- tdmq
Subscription StringId - ID of the resource.
- topic
Name String - Topic name.
- auto
Create booleanPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto
Delete booleanPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - cluster
Id string - Pulsar cluster ID.
- environment
Id string - Environment (namespace) name.
- remark string
- Remarks (up to 128 characters).
- subscription
Name string - Subscriber name, which can contain up to 128 characters.
- tdmq
Subscription stringId - ID of the resource.
- topic
Name string - Topic name.
- auto_
create_ boolpolicy_ topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto_
delete_ boolpolicy_ topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - cluster_
id str - Pulsar cluster ID.
- environment_
id str - Environment (namespace) name.
- remark str
- Remarks (up to 128 characters).
- subscription_
name str - Subscriber name, which can contain up to 128 characters.
- tdmq_
subscription_ strid - ID of the resource.
- topic_
name str - Topic name.
- auto
Create BooleanPolicy Topic - Whether to automatically create a dead letter topic and a retry letter topic. true: yes; false: no(default value).
- auto
Delete BooleanPolicy Topic - Whether to automatically delete a dead letter topic and a retry letter topic. Setting is only allowed when
auto_create_policy_topic
is true. Default is false. - cluster
Id String - Pulsar cluster ID.
- environment
Id String - Environment (namespace) name.
- remark String
- Remarks (up to 128 characters).
- subscription
Name String - Subscriber name, which can contain up to 128 characters.
- tdmq
Subscription StringId - ID of the resource.
- topic
Name String - Topic name.
Import
tdmq subscription can be imported using the id, e.g.
$ pulumi import tencentcloud:index/tdmqSubscription:TdmqSubscription example pulsar-q4k5898krpqj#tf_example#tf-example-topic#tf-example-subscription#true
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.