1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TdmqRocketmqEnvironmentRole
tencentcloud 1.81.187 published on Monday, Apr 28, 2025 by tencentcloudstack

tencentcloud.TdmqRocketmqEnvironmentRole

Explore with Pulumi AI

Provides a resource to create a tdmqRocketmq environment_role

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const exampleTdmqRocketmqCluster = new tencentcloud.TdmqRocketmqCluster("exampleTdmqRocketmqCluster", {
    clusterName: "tf_example",
    remark: "remark.",
});
const exampleTdmqRocketmqRole = new tencentcloud.TdmqRocketmqRole("exampleTdmqRocketmqRole", {
    roleName: "tf_example_role",
    remark: "remark.",
    clusterId: exampleTdmqRocketmqCluster.clusterId,
});
const exampleTdmqRocketmqNamespace = new tencentcloud.TdmqRocketmqNamespace("exampleTdmqRocketmqNamespace", {
    clusterId: exampleTdmqRocketmqCluster.clusterId,
    namespaceName: "tf_example_namespace",
    remark: "remark.",
});
const exampleTdmqRocketmqEnvironmentRole = new tencentcloud.TdmqRocketmqEnvironmentRole("exampleTdmqRocketmqEnvironmentRole", {
    environmentName: exampleTdmqRocketmqNamespace.namespaceName,
    roleName: exampleTdmqRocketmqRole.roleName,
    permissions: [
        "produce",
        "consume",
    ],
    clusterId: exampleTdmqRocketmqCluster.clusterId,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

example_tdmq_rocketmq_cluster = tencentcloud.TdmqRocketmqCluster("exampleTdmqRocketmqCluster",
    cluster_name="tf_example",
    remark="remark.")
example_tdmq_rocketmq_role = tencentcloud.TdmqRocketmqRole("exampleTdmqRocketmqRole",
    role_name="tf_example_role",
    remark="remark.",
    cluster_id=example_tdmq_rocketmq_cluster.cluster_id)
example_tdmq_rocketmq_namespace = tencentcloud.TdmqRocketmqNamespace("exampleTdmqRocketmqNamespace",
    cluster_id=example_tdmq_rocketmq_cluster.cluster_id,
    namespace_name="tf_example_namespace",
    remark="remark.")
example_tdmq_rocketmq_environment_role = tencentcloud.TdmqRocketmqEnvironmentRole("exampleTdmqRocketmqEnvironmentRole",
    environment_name=example_tdmq_rocketmq_namespace.namespace_name,
    role_name=example_tdmq_rocketmq_role.role_name,
    permissions=[
        "produce",
        "consume",
    ],
    cluster_id=example_tdmq_rocketmq_cluster.cluster_id)
Copy
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 {
		exampleTdmqRocketmqCluster, err := tencentcloud.NewTdmqRocketmqCluster(ctx, "exampleTdmqRocketmqCluster", &tencentcloud.TdmqRocketmqClusterArgs{
			ClusterName: pulumi.String("tf_example"),
			Remark:      pulumi.String("remark."),
		})
		if err != nil {
			return err
		}
		exampleTdmqRocketmqRole, err := tencentcloud.NewTdmqRocketmqRole(ctx, "exampleTdmqRocketmqRole", &tencentcloud.TdmqRocketmqRoleArgs{
			RoleName:  pulumi.String("tf_example_role"),
			Remark:    pulumi.String("remark."),
			ClusterId: exampleTdmqRocketmqCluster.ClusterId,
		})
		if err != nil {
			return err
		}
		exampleTdmqRocketmqNamespace, err := tencentcloud.NewTdmqRocketmqNamespace(ctx, "exampleTdmqRocketmqNamespace", &tencentcloud.TdmqRocketmqNamespaceArgs{
			ClusterId:     exampleTdmqRocketmqCluster.ClusterId,
			NamespaceName: pulumi.String("tf_example_namespace"),
			Remark:        pulumi.String("remark."),
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewTdmqRocketmqEnvironmentRole(ctx, "exampleTdmqRocketmqEnvironmentRole", &tencentcloud.TdmqRocketmqEnvironmentRoleArgs{
			EnvironmentName: exampleTdmqRocketmqNamespace.NamespaceName,
			RoleName:        exampleTdmqRocketmqRole.RoleName,
			Permissions: pulumi.StringArray{
				pulumi.String("produce"),
				pulumi.String("consume"),
			},
			ClusterId: exampleTdmqRocketmqCluster.ClusterId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var exampleTdmqRocketmqCluster = new Tencentcloud.TdmqRocketmqCluster("exampleTdmqRocketmqCluster", new()
    {
        ClusterName = "tf_example",
        Remark = "remark.",
    });

    var exampleTdmqRocketmqRole = new Tencentcloud.TdmqRocketmqRole("exampleTdmqRocketmqRole", new()
    {
        RoleName = "tf_example_role",
        Remark = "remark.",
        ClusterId = exampleTdmqRocketmqCluster.ClusterId,
    });

    var exampleTdmqRocketmqNamespace = new Tencentcloud.TdmqRocketmqNamespace("exampleTdmqRocketmqNamespace", new()
    {
        ClusterId = exampleTdmqRocketmqCluster.ClusterId,
        NamespaceName = "tf_example_namespace",
        Remark = "remark.",
    });

    var exampleTdmqRocketmqEnvironmentRole = new Tencentcloud.TdmqRocketmqEnvironmentRole("exampleTdmqRocketmqEnvironmentRole", new()
    {
        EnvironmentName = exampleTdmqRocketmqNamespace.NamespaceName,
        RoleName = exampleTdmqRocketmqRole.RoleName,
        Permissions = new[]
        {
            "produce",
            "consume",
        },
        ClusterId = exampleTdmqRocketmqCluster.ClusterId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TdmqRocketmqCluster;
import com.pulumi.tencentcloud.TdmqRocketmqClusterArgs;
import com.pulumi.tencentcloud.TdmqRocketmqRole;
import com.pulumi.tencentcloud.TdmqRocketmqRoleArgs;
import com.pulumi.tencentcloud.TdmqRocketmqNamespace;
import com.pulumi.tencentcloud.TdmqRocketmqNamespaceArgs;
import com.pulumi.tencentcloud.TdmqRocketmqEnvironmentRole;
import com.pulumi.tencentcloud.TdmqRocketmqEnvironmentRoleArgs;
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 exampleTdmqRocketmqCluster = new TdmqRocketmqCluster("exampleTdmqRocketmqCluster", TdmqRocketmqClusterArgs.builder()
            .clusterName("tf_example")
            .remark("remark.")
            .build());

        var exampleTdmqRocketmqRole = new TdmqRocketmqRole("exampleTdmqRocketmqRole", TdmqRocketmqRoleArgs.builder()
            .roleName("tf_example_role")
            .remark("remark.")
            .clusterId(exampleTdmqRocketmqCluster.clusterId())
            .build());

        var exampleTdmqRocketmqNamespace = new TdmqRocketmqNamespace("exampleTdmqRocketmqNamespace", TdmqRocketmqNamespaceArgs.builder()
            .clusterId(exampleTdmqRocketmqCluster.clusterId())
            .namespaceName("tf_example_namespace")
            .remark("remark.")
            .build());

        var exampleTdmqRocketmqEnvironmentRole = new TdmqRocketmqEnvironmentRole("exampleTdmqRocketmqEnvironmentRole", TdmqRocketmqEnvironmentRoleArgs.builder()
            .environmentName(exampleTdmqRocketmqNamespace.namespaceName())
            .roleName(exampleTdmqRocketmqRole.roleName())
            .permissions(            
                "produce",
                "consume")
            .clusterId(exampleTdmqRocketmqCluster.clusterId())
            .build());

    }
}
Copy
resources:
  exampleTdmqRocketmqCluster:
    type: tencentcloud:TdmqRocketmqCluster
    properties:
      clusterName: tf_example
      remark: remark.
  exampleTdmqRocketmqRole:
    type: tencentcloud:TdmqRocketmqRole
    properties:
      roleName: tf_example_role
      remark: remark.
      clusterId: ${exampleTdmqRocketmqCluster.clusterId}
  exampleTdmqRocketmqNamespace:
    type: tencentcloud:TdmqRocketmqNamespace
    properties:
      clusterId: ${exampleTdmqRocketmqCluster.clusterId}
      namespaceName: tf_example_namespace
      remark: remark.
  exampleTdmqRocketmqEnvironmentRole:
    type: tencentcloud:TdmqRocketmqEnvironmentRole
    properties:
      environmentName: ${exampleTdmqRocketmqNamespace.namespaceName}
      roleName: ${exampleTdmqRocketmqRole.roleName}
      permissions:
        - produce
        - consume
      clusterId: ${exampleTdmqRocketmqCluster.clusterId}
Copy

Create TdmqRocketmqEnvironmentRole Resource

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

Constructor syntax

new TdmqRocketmqEnvironmentRole(name: string, args: TdmqRocketmqEnvironmentRoleArgs, opts?: CustomResourceOptions);
@overload
def TdmqRocketmqEnvironmentRole(resource_name: str,
                                args: TdmqRocketmqEnvironmentRoleArgs,
                                opts: Optional[ResourceOptions] = None)

@overload
def TdmqRocketmqEnvironmentRole(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                cluster_id: Optional[str] = None,
                                environment_name: Optional[str] = None,
                                permissions: Optional[Sequence[str]] = None,
                                role_name: Optional[str] = None,
                                tdmq_rocketmq_environment_role_id: Optional[str] = None)
func NewTdmqRocketmqEnvironmentRole(ctx *Context, name string, args TdmqRocketmqEnvironmentRoleArgs, opts ...ResourceOption) (*TdmqRocketmqEnvironmentRole, error)
public TdmqRocketmqEnvironmentRole(string name, TdmqRocketmqEnvironmentRoleArgs args, CustomResourceOptions? opts = null)
public TdmqRocketmqEnvironmentRole(String name, TdmqRocketmqEnvironmentRoleArgs args)
public TdmqRocketmqEnvironmentRole(String name, TdmqRocketmqEnvironmentRoleArgs args, CustomResourceOptions options)
type: tencentcloud:TdmqRocketmqEnvironmentRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TdmqRocketmqEnvironmentRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TdmqRocketmqEnvironmentRoleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TdmqRocketmqEnvironmentRoleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TdmqRocketmqEnvironmentRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TdmqRocketmqEnvironmentRoleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

ClusterId This property is required. string
Cluster ID (required).
EnvironmentName This property is required. string
Environment (namespace) name.
Permissions This property is required. List<string>
Permissions, which is a non-empty string array of produce and consume at the most.
RoleName This property is required. string
Role Name.
TdmqRocketmqEnvironmentRoleId string
ID of the resource.
ClusterId This property is required. string
Cluster ID (required).
EnvironmentName This property is required. string
Environment (namespace) name.
Permissions This property is required. []string
Permissions, which is a non-empty string array of produce and consume at the most.
RoleName This property is required. string
Role Name.
TdmqRocketmqEnvironmentRoleId string
ID of the resource.
clusterId This property is required. String
Cluster ID (required).
environmentName This property is required. String
Environment (namespace) name.
permissions This property is required. List<String>
Permissions, which is a non-empty string array of produce and consume at the most.
roleName This property is required. String
Role Name.
tdmqRocketmqEnvironmentRoleId String
ID of the resource.
clusterId This property is required. string
Cluster ID (required).
environmentName This property is required. string
Environment (namespace) name.
permissions This property is required. string[]
Permissions, which is a non-empty string array of produce and consume at the most.
roleName This property is required. string
Role Name.
tdmqRocketmqEnvironmentRoleId string
ID of the resource.
cluster_id This property is required. str
Cluster ID (required).
environment_name This property is required. str
Environment (namespace) name.
permissions This property is required. Sequence[str]
Permissions, which is a non-empty string array of produce and consume at the most.
role_name This property is required. str
Role Name.
tdmq_rocketmq_environment_role_id str
ID of the resource.
clusterId This property is required. String
Cluster ID (required).
environmentName This property is required. String
Environment (namespace) name.
permissions This property is required. List<String>
Permissions, which is a non-empty string array of produce and consume at the most.
roleName This property is required. String
Role Name.
tdmqRocketmqEnvironmentRoleId String
ID of the resource.

Outputs

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

Get an existing TdmqRocketmqEnvironmentRole 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?: TdmqRocketmqEnvironmentRoleState, opts?: CustomResourceOptions): TdmqRocketmqEnvironmentRole
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        environment_name: Optional[str] = None,
        permissions: Optional[Sequence[str]] = None,
        role_name: Optional[str] = None,
        tdmq_rocketmq_environment_role_id: Optional[str] = None) -> TdmqRocketmqEnvironmentRole
func GetTdmqRocketmqEnvironmentRole(ctx *Context, name string, id IDInput, state *TdmqRocketmqEnvironmentRoleState, opts ...ResourceOption) (*TdmqRocketmqEnvironmentRole, error)
public static TdmqRocketmqEnvironmentRole Get(string name, Input<string> id, TdmqRocketmqEnvironmentRoleState? state, CustomResourceOptions? opts = null)
public static TdmqRocketmqEnvironmentRole get(String name, Output<String> id, TdmqRocketmqEnvironmentRoleState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:TdmqRocketmqEnvironmentRole    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Cluster ID (required).
EnvironmentName string
Environment (namespace) name.
Permissions List<string>
Permissions, which is a non-empty string array of produce and consume at the most.
RoleName string
Role Name.
TdmqRocketmqEnvironmentRoleId string
ID of the resource.
ClusterId string
Cluster ID (required).
EnvironmentName string
Environment (namespace) name.
Permissions []string
Permissions, which is a non-empty string array of produce and consume at the most.
RoleName string
Role Name.
TdmqRocketmqEnvironmentRoleId string
ID of the resource.
clusterId String
Cluster ID (required).
environmentName String
Environment (namespace) name.
permissions List<String>
Permissions, which is a non-empty string array of produce and consume at the most.
roleName String
Role Name.
tdmqRocketmqEnvironmentRoleId String
ID of the resource.
clusterId string
Cluster ID (required).
environmentName string
Environment (namespace) name.
permissions string[]
Permissions, which is a non-empty string array of produce and consume at the most.
roleName string
Role Name.
tdmqRocketmqEnvironmentRoleId string
ID of the resource.
cluster_id str
Cluster ID (required).
environment_name str
Environment (namespace) name.
permissions Sequence[str]
Permissions, which is a non-empty string array of produce and consume at the most.
role_name str
Role Name.
tdmq_rocketmq_environment_role_id str
ID of the resource.
clusterId String
Cluster ID (required).
environmentName String
Environment (namespace) name.
permissions List<String>
Permissions, which is a non-empty string array of produce and consume at the most.
roleName String
Role Name.
tdmqRocketmqEnvironmentRoleId String
ID of the resource.

Import

tdmqRocketmq environment_role can be imported using the id, e.g.

$ pulumi import tencentcloud:index/tdmqRocketmqEnvironmentRole:TdmqRocketmqEnvironmentRole environment_role environmentRole_id
Copy

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.