tencentcloud.TdmqNamespace
Explore with Pulumi AI
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:
- Cluster
Id string - The Dedicated Cluster Id.
- Environ
Name string - The name of namespace to be created.
- Msg
Ttl double - The expiration time of unconsumed message.
- Remark string
- Description of the namespace.
- Retention
Policy TdmqNamespace Retention Policy - 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 stringId - ID of the resource.
- Cluster
Id string - The Dedicated Cluster Id.
- Environ
Name string - The name of namespace to be created.
- Msg
Ttl float64 - The expiration time of unconsumed message.
- Remark string
- Description of the namespace.
- Retention
Policy TdmqNamespace Retention Policy Args - 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 stringId - ID of the resource.
- cluster
Id String - The Dedicated Cluster Id.
- environ
Name String - The name of namespace to be created.
- msg
Ttl Double - The expiration time of unconsumed message.
- remark String
- Description of the namespace.
- retention
Policy TdmqNamespace Retention Policy - 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 StringId - ID of the resource.
- cluster
Id string - The Dedicated Cluster Id.
- environ
Name string - The name of namespace to be created.
- msg
Ttl number - The expiration time of unconsumed message.
- remark string
- Description of the namespace.
- retention
Policy TdmqNamespace Retention Policy - 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 stringId - 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 TdmqNamespace Retention Policy Args - 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_ strid - ID of the resource.
- cluster
Id String - The Dedicated Cluster Id.
- environ
Name String - The name of namespace to be created.
- msg
Ttl Number - The expiration time of unconsumed message.
- remark String
- Description of the namespace.
- retention
Policy 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. - tdmq
Namespace StringId - 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.
- Cluster
Id string - The Dedicated Cluster Id.
- Environ
Name string - The name of namespace to be created.
- Msg
Ttl double - The expiration time of unconsumed message.
- Remark string
- Description of the namespace.
- Retention
Policy TdmqNamespace Retention Policy - 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 stringId - ID of the resource.
- Cluster
Id string - The Dedicated Cluster Id.
- Environ
Name string - The name of namespace to be created.
- Msg
Ttl float64 - The expiration time of unconsumed message.
- Remark string
- Description of the namespace.
- Retention
Policy TdmqNamespace Retention Policy Args - 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 stringId - ID of the resource.
- cluster
Id String - The Dedicated Cluster Id.
- environ
Name String - The name of namespace to be created.
- msg
Ttl Double - The expiration time of unconsumed message.
- remark String
- Description of the namespace.
- retention
Policy TdmqNamespace Retention Policy - 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 StringId - ID of the resource.
- cluster
Id string - The Dedicated Cluster Id.
- environ
Name string - The name of namespace to be created.
- msg
Ttl number - The expiration time of unconsumed message.
- remark string
- Description of the namespace.
- retention
Policy TdmqNamespace Retention Policy - 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 stringId - 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 TdmqNamespace Retention Policy Args - 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_ strid - ID of the resource.
- cluster
Id String - The Dedicated Cluster Id.
- environ
Name String - The name of namespace to be created.
- msg
Ttl Number - The expiration time of unconsumed message.
- remark String
- Description of the namespace.
- retention
Policy 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. - tdmq
Namespace StringId - ID of the resource.
Supporting Types
TdmqNamespaceRetentionPolicy, TdmqNamespaceRetentionPolicyArgs
- Size
In doubleMb - the size of message to retain.
- Time
In doubleMinutes - the time of message to retain.
- Size
In float64Mb - the size of message to retain.
- Time
In float64Minutes - the time of message to retain.
- size
In DoubleMb - the size of message to retain.
- time
In DoubleMinutes - the time of message to retain.
- size
In numberMb - the size of message to retain.
- time
In numberMinutes - the time of message to retain.
- size_
in_ floatmb - the size of message to retain.
- time_
in_ floatminutes - the time of message to retain.
- size
In NumberMb - the size of message to retain.
- time
In NumberMinutes - 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.