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

tencentcloud.TdmqNamespaceRoleAttachment

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 environment role.

    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 exampleTdmqRole = new tencentcloud.TdmqRole("exampleTdmqRole", {
        roleName: "tf_example",
        clusterId: exampleTdmqInstance.tdmqInstanceId,
        remark: "remark.",
    });
    const exampleTdmqNamespaceRoleAttachment = new tencentcloud.TdmqNamespaceRoleAttachment("exampleTdmqNamespaceRoleAttachment", {
        environId: exampleTdmqNamespace.environName,
        roleName: exampleTdmqRole.roleName,
        permissions: [
            "produce",
            "consume",
        ],
        clusterId: exampleTdmqInstance.tdmqInstanceId,
    });
    
    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_role = tencentcloud.TdmqRole("exampleTdmqRole",
        role_name="tf_example",
        cluster_id=example_tdmq_instance.tdmq_instance_id,
        remark="remark.")
    example_tdmq_namespace_role_attachment = tencentcloud.TdmqNamespaceRoleAttachment("exampleTdmqNamespaceRoleAttachment",
        environ_id=example_tdmq_namespace.environ_name,
        role_name=example_tdmq_role.role_name,
        permissions=[
            "produce",
            "consume",
        ],
        cluster_id=example_tdmq_instance.tdmq_instance_id)
    
    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
    		}
    		exampleTdmqRole, err := tencentcloud.NewTdmqRole(ctx, "exampleTdmqRole", &tencentcloud.TdmqRoleArgs{
    			RoleName:  pulumi.String("tf_example"),
    			ClusterId: exampleTdmqInstance.TdmqInstanceId,
    			Remark:    pulumi.String("remark."),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewTdmqNamespaceRoleAttachment(ctx, "exampleTdmqNamespaceRoleAttachment", &tencentcloud.TdmqNamespaceRoleAttachmentArgs{
    			EnvironId: exampleTdmqNamespace.EnvironName,
    			RoleName:  exampleTdmqRole.RoleName,
    			Permissions: pulumi.StringArray{
    				pulumi.String("produce"),
    				pulumi.String("consume"),
    			},
    			ClusterId: exampleTdmqInstance.TdmqInstanceId,
    		})
    		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 exampleTdmqRole = new Tencentcloud.TdmqRole("exampleTdmqRole", new()
        {
            RoleName = "tf_example",
            ClusterId = exampleTdmqInstance.TdmqInstanceId,
            Remark = "remark.",
        });
    
        var exampleTdmqNamespaceRoleAttachment = new Tencentcloud.TdmqNamespaceRoleAttachment("exampleTdmqNamespaceRoleAttachment", new()
        {
            EnvironId = exampleTdmqNamespace.EnvironName,
            RoleName = exampleTdmqRole.RoleName,
            Permissions = new[]
            {
                "produce",
                "consume",
            },
            ClusterId = exampleTdmqInstance.TdmqInstanceId,
        });
    
    });
    
    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.TdmqRole;
    import com.pulumi.tencentcloud.TdmqRoleArgs;
    import com.pulumi.tencentcloud.TdmqNamespaceRoleAttachment;
    import com.pulumi.tencentcloud.TdmqNamespaceRoleAttachmentArgs;
    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 exampleTdmqRole = new TdmqRole("exampleTdmqRole", TdmqRoleArgs.builder()
                .roleName("tf_example")
                .clusterId(exampleTdmqInstance.tdmqInstanceId())
                .remark("remark.")
                .build());
    
            var exampleTdmqNamespaceRoleAttachment = new TdmqNamespaceRoleAttachment("exampleTdmqNamespaceRoleAttachment", TdmqNamespaceRoleAttachmentArgs.builder()
                .environId(exampleTdmqNamespace.environName())
                .roleName(exampleTdmqRole.roleName())
                .permissions(            
                    "produce",
                    "consume")
                .clusterId(exampleTdmqInstance.tdmqInstanceId())
                .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.
      exampleTdmqRole:
        type: tencentcloud:TdmqRole
        properties:
          roleName: tf_example
          clusterId: ${exampleTdmqInstance.tdmqInstanceId}
          remark: remark.
      exampleTdmqNamespaceRoleAttachment:
        type: tencentcloud:TdmqNamespaceRoleAttachment
        properties:
          environId: ${exampleTdmqNamespace.environName}
          roleName: ${exampleTdmqRole.roleName}
          permissions:
            - produce
            - consume
          clusterId: ${exampleTdmqInstance.tdmqInstanceId}
    

    Create TdmqNamespaceRoleAttachment Resource

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

    Constructor syntax

    new TdmqNamespaceRoleAttachment(name: string, args: TdmqNamespaceRoleAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def TdmqNamespaceRoleAttachment(resource_name: str,
                                    args: TdmqNamespaceRoleAttachmentArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def TdmqNamespaceRoleAttachment(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    cluster_id: Optional[str] = None,
                                    environ_id: Optional[str] = None,
                                    permissions: Optional[Sequence[str]] = None,
                                    role_name: Optional[str] = None,
                                    tdmq_namespace_role_attachment_id: Optional[str] = None)
    func NewTdmqNamespaceRoleAttachment(ctx *Context, name string, args TdmqNamespaceRoleAttachmentArgs, opts ...ResourceOption) (*TdmqNamespaceRoleAttachment, error)
    public TdmqNamespaceRoleAttachment(string name, TdmqNamespaceRoleAttachmentArgs args, CustomResourceOptions? opts = null)
    public TdmqNamespaceRoleAttachment(String name, TdmqNamespaceRoleAttachmentArgs args)
    public TdmqNamespaceRoleAttachment(String name, TdmqNamespaceRoleAttachmentArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TdmqNamespaceRoleAttachment
    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 TdmqNamespaceRoleAttachmentArgs
    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 TdmqNamespaceRoleAttachmentArgs
    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 TdmqNamespaceRoleAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TdmqNamespaceRoleAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TdmqNamespaceRoleAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ClusterId string
    The id of tdmq cluster.
    EnvironId string
    The name of tdmq namespace.
    Permissions List<string>
    The permissions of tdmq role.
    RoleName string
    The name of tdmq role.
    TdmqNamespaceRoleAttachmentId string
    ID of the resource.
    ClusterId string
    The id of tdmq cluster.
    EnvironId string
    The name of tdmq namespace.
    Permissions []string
    The permissions of tdmq role.
    RoleName string
    The name of tdmq role.
    TdmqNamespaceRoleAttachmentId string
    ID of the resource.
    clusterId String
    The id of tdmq cluster.
    environId String
    The name of tdmq namespace.
    permissions List<String>
    The permissions of tdmq role.
    roleName String
    The name of tdmq role.
    tdmqNamespaceRoleAttachmentId String
    ID of the resource.
    clusterId string
    The id of tdmq cluster.
    environId string
    The name of tdmq namespace.
    permissions string[]
    The permissions of tdmq role.
    roleName string
    The name of tdmq role.
    tdmqNamespaceRoleAttachmentId string
    ID of the resource.
    cluster_id str
    The id of tdmq cluster.
    environ_id str
    The name of tdmq namespace.
    permissions Sequence[str]
    The permissions of tdmq role.
    role_name str
    The name of tdmq role.
    tdmq_namespace_role_attachment_id str
    ID of the resource.
    clusterId String
    The id of tdmq cluster.
    environId String
    The name of tdmq namespace.
    permissions List<String>
    The permissions of tdmq role.
    roleName String
    The name of tdmq role.
    tdmqNamespaceRoleAttachmentId String
    ID of the resource.

    Outputs

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

    Get an existing TdmqNamespaceRoleAttachment 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?: TdmqNamespaceRoleAttachmentState, opts?: CustomResourceOptions): TdmqNamespaceRoleAttachment
    @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,
            permissions: Optional[Sequence[str]] = None,
            role_name: Optional[str] = None,
            tdmq_namespace_role_attachment_id: Optional[str] = None) -> TdmqNamespaceRoleAttachment
    func GetTdmqNamespaceRoleAttachment(ctx *Context, name string, id IDInput, state *TdmqNamespaceRoleAttachmentState, opts ...ResourceOption) (*TdmqNamespaceRoleAttachment, error)
    public static TdmqNamespaceRoleAttachment Get(string name, Input<string> id, TdmqNamespaceRoleAttachmentState? state, CustomResourceOptions? opts = null)
    public static TdmqNamespaceRoleAttachment get(String name, Output<String> id, TdmqNamespaceRoleAttachmentState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TdmqNamespaceRoleAttachment    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 id of tdmq cluster.
    CreateTime string
    Creation time of resource.
    EnvironId string
    The name of tdmq namespace.
    Permissions List<string>
    The permissions of tdmq role.
    RoleName string
    The name of tdmq role.
    TdmqNamespaceRoleAttachmentId string
    ID of the resource.
    ClusterId string
    The id of tdmq cluster.
    CreateTime string
    Creation time of resource.
    EnvironId string
    The name of tdmq namespace.
    Permissions []string
    The permissions of tdmq role.
    RoleName string
    The name of tdmq role.
    TdmqNamespaceRoleAttachmentId string
    ID of the resource.
    clusterId String
    The id of tdmq cluster.
    createTime String
    Creation time of resource.
    environId String
    The name of tdmq namespace.
    permissions List<String>
    The permissions of tdmq role.
    roleName String
    The name of tdmq role.
    tdmqNamespaceRoleAttachmentId String
    ID of the resource.
    clusterId string
    The id of tdmq cluster.
    createTime string
    Creation time of resource.
    environId string
    The name of tdmq namespace.
    permissions string[]
    The permissions of tdmq role.
    roleName string
    The name of tdmq role.
    tdmqNamespaceRoleAttachmentId string
    ID of the resource.
    cluster_id str
    The id of tdmq cluster.
    create_time str
    Creation time of resource.
    environ_id str
    The name of tdmq namespace.
    permissions Sequence[str]
    The permissions of tdmq role.
    role_name str
    The name of tdmq role.
    tdmq_namespace_role_attachment_id str
    ID of the resource.
    clusterId String
    The id of tdmq cluster.
    createTime String
    Creation time of resource.
    environId String
    The name of tdmq namespace.
    permissions List<String>
    The permissions of tdmq role.
    roleName String
    The name of tdmq role.
    tdmqNamespaceRoleAttachmentId String
    ID of the resource.

    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