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

tencentcloud.TdmqNamespace

Explore with Pulumi AI

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

    Provide a resource to create a TDMQ namespace.

    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.",
    });
    
    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.")
    
    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
    		}
    		_, 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
    		}
    		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.",
        });
    
    });
    
    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 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());
    
        }
    }
    
    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.
    

    Create TdmqNamespace Resource

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

    Constructor syntax

    new TdmqNamespace(name: string, args: TdmqNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def TdmqNamespace(resource_name: str,
                      args: TdmqNamespaceArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def TdmqNamespace(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      cluster_id: Optional[str] = None,
                      environ_name: Optional[str] = None,
                      msg_ttl: Optional[float] = None,
                      remark: Optional[str] = None,
                      retention_policy: Optional[TdmqNamespaceRetentionPolicyArgs] = None,
                      tdmq_namespace_id: Optional[str] = None)
    func NewTdmqNamespace(ctx *Context, name string, args TdmqNamespaceArgs, opts ...ResourceOption) (*TdmqNamespace, error)
    public TdmqNamespace(string name, TdmqNamespaceArgs args, CustomResourceOptions? opts = null)
    public TdmqNamespace(String name, TdmqNamespaceArgs args)
    public TdmqNamespace(String name, TdmqNamespaceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TdmqNamespace
    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 TdmqNamespaceArgs
    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 TdmqNamespaceArgs
    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 TdmqNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TdmqNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TdmqNamespaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ClusterId string
    The Dedicated Cluster Id.
    EnvironName string
    The name of namespace to be created.
    MsgTtl double
    The expiration time of unconsumed message.
    Remark string
    Description of the namespace.
    RetentionPolicy TdmqNamespaceRetentionPolicy
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    TdmqNamespaceId string
    ID of the resource.
    ClusterId string
    The Dedicated Cluster Id.
    EnvironName string
    The name of namespace to be created.
    MsgTtl float64
    The expiration time of unconsumed message.
    Remark string
    Description of the namespace.
    RetentionPolicy TdmqNamespaceRetentionPolicyArgs
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    TdmqNamespaceId string
    ID of the resource.
    clusterId String
    The Dedicated Cluster Id.
    environName String
    The name of namespace to be created.
    msgTtl Double
    The expiration time of unconsumed message.
    remark String
    Description of the namespace.
    retentionPolicy TdmqNamespaceRetentionPolicy
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmqNamespaceId String
    ID of the resource.
    clusterId string
    The Dedicated Cluster Id.
    environName string
    The name of namespace to be created.
    msgTtl number
    The expiration time of unconsumed message.
    remark string
    Description of the namespace.
    retentionPolicy TdmqNamespaceRetentionPolicy
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmqNamespaceId string
    ID of the resource.
    cluster_id str
    The Dedicated Cluster Id.
    environ_name str
    The name of namespace to be created.
    msg_ttl float
    The expiration time of unconsumed message.
    remark str
    Description of the namespace.
    retention_policy TdmqNamespaceRetentionPolicyArgs
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmq_namespace_id str
    ID of the resource.
    clusterId String
    The Dedicated Cluster Id.
    environName String
    The name of namespace to be created.
    msgTtl Number
    The expiration time of unconsumed message.
    remark String
    Description of the namespace.
    retentionPolicy Property Map
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmqNamespaceId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TdmqNamespace 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 TdmqNamespace Resource

    Get an existing TdmqNamespace 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?: TdmqNamespaceState, opts?: CustomResourceOptions): TdmqNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            environ_name: Optional[str] = None,
            msg_ttl: Optional[float] = None,
            remark: Optional[str] = None,
            retention_policy: Optional[TdmqNamespaceRetentionPolicyArgs] = None,
            tdmq_namespace_id: Optional[str] = None) -> TdmqNamespace
    func GetTdmqNamespace(ctx *Context, name string, id IDInput, state *TdmqNamespaceState, opts ...ResourceOption) (*TdmqNamespace, error)
    public static TdmqNamespace Get(string name, Input<string> id, TdmqNamespaceState? state, CustomResourceOptions? opts = null)
    public static TdmqNamespace get(String name, Output<String> id, TdmqNamespaceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TdmqNamespace    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:
    ClusterId string
    The Dedicated Cluster Id.
    EnvironName string
    The name of namespace to be created.
    MsgTtl double
    The expiration time of unconsumed message.
    Remark string
    Description of the namespace.
    RetentionPolicy TdmqNamespaceRetentionPolicy
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    TdmqNamespaceId string
    ID of the resource.
    ClusterId string
    The Dedicated Cluster Id.
    EnvironName string
    The name of namespace to be created.
    MsgTtl float64
    The expiration time of unconsumed message.
    Remark string
    Description of the namespace.
    RetentionPolicy TdmqNamespaceRetentionPolicyArgs
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    TdmqNamespaceId string
    ID of the resource.
    clusterId String
    The Dedicated Cluster Id.
    environName String
    The name of namespace to be created.
    msgTtl Double
    The expiration time of unconsumed message.
    remark String
    Description of the namespace.
    retentionPolicy TdmqNamespaceRetentionPolicy
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmqNamespaceId String
    ID of the resource.
    clusterId string
    The Dedicated Cluster Id.
    environName string
    The name of namespace to be created.
    msgTtl number
    The expiration time of unconsumed message.
    remark string
    Description of the namespace.
    retentionPolicy TdmqNamespaceRetentionPolicy
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmqNamespaceId string
    ID of the resource.
    cluster_id str
    The Dedicated Cluster Id.
    environ_name str
    The name of namespace to be created.
    msg_ttl float
    The expiration time of unconsumed message.
    remark str
    Description of the namespace.
    retention_policy TdmqNamespaceRetentionPolicyArgs
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmq_namespace_id str
    ID of the resource.
    clusterId String
    The Dedicated Cluster Id.
    environName String
    The name of namespace to be created.
    msgTtl Number
    The expiration time of unconsumed message.
    remark String
    Description of the namespace.
    retentionPolicy Property Map
    The Policy of message to retain. Format like: {time_in_minutes: Int, size_in_mb: Int}. time_in_minutes: the time of message to retain; size_in_mb: the size of message to retain.
    tdmqNamespaceId String
    ID of the resource.

    Supporting Types

    TdmqNamespaceRetentionPolicy, TdmqNamespaceRetentionPolicyArgs

    SizeInMb double
    the size of message to retain.
    TimeInMinutes double
    the time of message to retain.
    SizeInMb float64
    the size of message to retain.
    TimeInMinutes float64
    the time of message to retain.
    sizeInMb Double
    the size of message to retain.
    timeInMinutes Double
    the time of message to retain.
    sizeInMb number
    the size of message to retain.
    timeInMinutes number
    the time of message to retain.
    size_in_mb float
    the size of message to retain.
    time_in_minutes float
    the time of message to retain.
    sizeInMb Number
    the size of message to retain.
    timeInMinutes Number
    the time of message to retain.

    Import

    Tdmq namespace can be imported, e.g.

    $ pulumi import tencentcloud:index/tdmqNamespace:TdmqNamespace example tf_example#pulsar-78bwjaj8epxv
    

    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