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

tencentcloud.TrocketRocketmqRole

Explore with Pulumi AI

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

    Provides a resource to create a trocket rocketmq_role

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const rocketmqInstance = new tencentcloud.TrocketRocketmqInstance("rocketmqInstance", {
        instanceType: "EXPERIMENT",
        skuCode: "experiment_500",
        remark: "test",
        vpcId: "vpc-xxxxx",
        subnetId: "subnet-xxxxx",
        tags: {
            tag_key: "rocketmq",
            tag_value: "5.x",
        },
    });
    const rocketmqRole = new tencentcloud.TrocketRocketmqRole("rocketmqRole", {
        instanceId: rocketmqInstance.trocketRocketmqInstanceId,
        role: "test_role",
        remark: "test for terraform",
        permWrite: false,
        permRead: true,
    });
    export const accessKey = rocketmqRole.accessKey;
    export const secretKey = rocketmqRole.secretKey;
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    rocketmq_instance = tencentcloud.TrocketRocketmqInstance("rocketmqInstance",
        instance_type="EXPERIMENT",
        sku_code="experiment_500",
        remark="test",
        vpc_id="vpc-xxxxx",
        subnet_id="subnet-xxxxx",
        tags={
            "tag_key": "rocketmq",
            "tag_value": "5.x",
        })
    rocketmq_role = tencentcloud.TrocketRocketmqRole("rocketmqRole",
        instance_id=rocketmq_instance.trocket_rocketmq_instance_id,
        role="test_role",
        remark="test for terraform",
        perm_write=False,
        perm_read=True)
    pulumi.export("accessKey", rocketmq_role.access_key)
    pulumi.export("secretKey", rocketmq_role.secret_key)
    
    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 {
    		rocketmqInstance, err := tencentcloud.NewTrocketRocketmqInstance(ctx, "rocketmqInstance", &tencentcloud.TrocketRocketmqInstanceArgs{
    			InstanceType: pulumi.String("EXPERIMENT"),
    			SkuCode:      pulumi.String("experiment_500"),
    			Remark:       pulumi.String("test"),
    			VpcId:        pulumi.String("vpc-xxxxx"),
    			SubnetId:     pulumi.String("subnet-xxxxx"),
    			Tags: pulumi.StringMap{
    				"tag_key":   pulumi.String("rocketmq"),
    				"tag_value": pulumi.String("5.x"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		rocketmqRole, err := tencentcloud.NewTrocketRocketmqRole(ctx, "rocketmqRole", &tencentcloud.TrocketRocketmqRoleArgs{
    			InstanceId: rocketmqInstance.TrocketRocketmqInstanceId,
    			Role:       pulumi.String("test_role"),
    			Remark:     pulumi.String("test for terraform"),
    			PermWrite:  pulumi.Bool(false),
    			PermRead:   pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("accessKey", rocketmqRole.AccessKey)
    		ctx.Export("secretKey", rocketmqRole.SecretKey)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var rocketmqInstance = new Tencentcloud.TrocketRocketmqInstance("rocketmqInstance", new()
        {
            InstanceType = "EXPERIMENT",
            SkuCode = "experiment_500",
            Remark = "test",
            VpcId = "vpc-xxxxx",
            SubnetId = "subnet-xxxxx",
            Tags = 
            {
                { "tag_key", "rocketmq" },
                { "tag_value", "5.x" },
            },
        });
    
        var rocketmqRole = new Tencentcloud.TrocketRocketmqRole("rocketmqRole", new()
        {
            InstanceId = rocketmqInstance.TrocketRocketmqInstanceId,
            Role = "test_role",
            Remark = "test for terraform",
            PermWrite = false,
            PermRead = true,
        });
    
        return new Dictionary<string, object?>
        {
            ["accessKey"] = rocketmqRole.AccessKey,
            ["secretKey"] = rocketmqRole.SecretKey,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TrocketRocketmqInstance;
    import com.pulumi.tencentcloud.TrocketRocketmqInstanceArgs;
    import com.pulumi.tencentcloud.TrocketRocketmqRole;
    import com.pulumi.tencentcloud.TrocketRocketmqRoleArgs;
    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 rocketmqInstance = new TrocketRocketmqInstance("rocketmqInstance", TrocketRocketmqInstanceArgs.builder()
                .instanceType("EXPERIMENT")
                .skuCode("experiment_500")
                .remark("test")
                .vpcId("vpc-xxxxx")
                .subnetId("subnet-xxxxx")
                .tags(Map.ofEntries(
                    Map.entry("tag_key", "rocketmq"),
                    Map.entry("tag_value", "5.x")
                ))
                .build());
    
            var rocketmqRole = new TrocketRocketmqRole("rocketmqRole", TrocketRocketmqRoleArgs.builder()
                .instanceId(rocketmqInstance.trocketRocketmqInstanceId())
                .role("test_role")
                .remark("test for terraform")
                .permWrite(false)
                .permRead(true)
                .build());
    
            ctx.export("accessKey", rocketmqRole.accessKey());
            ctx.export("secretKey", rocketmqRole.secretKey());
        }
    }
    
    resources:
      rocketmqInstance:
        type: tencentcloud:TrocketRocketmqInstance
        properties:
          instanceType: EXPERIMENT
          skuCode: experiment_500
          remark: test
          vpcId: vpc-xxxxx
          subnetId: subnet-xxxxx
          tags:
            tag_key: rocketmq
            tag_value: 5.x
      rocketmqRole:
        type: tencentcloud:TrocketRocketmqRole
        properties:
          instanceId: ${rocketmqInstance.trocketRocketmqInstanceId}
          role: test_role
          remark: test for terraform
          permWrite: false
          permRead: true
    outputs:
      accessKey: ${rocketmqRole.accessKey}
      secretKey: ${rocketmqRole.secretKey}
    

    Create TrocketRocketmqRole Resource

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

    Constructor syntax

    new TrocketRocketmqRole(name: string, args: TrocketRocketmqRoleArgs, opts?: CustomResourceOptions);
    @overload
    def TrocketRocketmqRole(resource_name: str,
                            args: TrocketRocketmqRoleArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def TrocketRocketmqRole(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            instance_id: Optional[str] = None,
                            perm_read: Optional[bool] = None,
                            perm_write: Optional[bool] = None,
                            remark: Optional[str] = None,
                            role: Optional[str] = None,
                            trocket_rocketmq_role_id: Optional[str] = None)
    func NewTrocketRocketmqRole(ctx *Context, name string, args TrocketRocketmqRoleArgs, opts ...ResourceOption) (*TrocketRocketmqRole, error)
    public TrocketRocketmqRole(string name, TrocketRocketmqRoleArgs args, CustomResourceOptions? opts = null)
    public TrocketRocketmqRole(String name, TrocketRocketmqRoleArgs args)
    public TrocketRocketmqRole(String name, TrocketRocketmqRoleArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TrocketRocketmqRole
    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 TrocketRocketmqRoleArgs
    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 TrocketRocketmqRoleArgs
    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 TrocketRocketmqRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TrocketRocketmqRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TrocketRocketmqRoleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceId string
    ID of instance.
    PermRead bool
    Whether to enable consumption permission.
    PermWrite bool
    Whether to enable production permission.
    Remark string
    remark.
    Role string
    Name of role.
    TrocketRocketmqRoleId string
    ID of the resource.
    InstanceId string
    ID of instance.
    PermRead bool
    Whether to enable consumption permission.
    PermWrite bool
    Whether to enable production permission.
    Remark string
    remark.
    Role string
    Name of role.
    TrocketRocketmqRoleId string
    ID of the resource.
    instanceId String
    ID of instance.
    permRead Boolean
    Whether to enable consumption permission.
    permWrite Boolean
    Whether to enable production permission.
    remark String
    remark.
    role String
    Name of role.
    trocketRocketmqRoleId String
    ID of the resource.
    instanceId string
    ID of instance.
    permRead boolean
    Whether to enable consumption permission.
    permWrite boolean
    Whether to enable production permission.
    remark string
    remark.
    role string
    Name of role.
    trocketRocketmqRoleId string
    ID of the resource.
    instance_id str
    ID of instance.
    perm_read bool
    Whether to enable consumption permission.
    perm_write bool
    Whether to enable production permission.
    remark str
    remark.
    role str
    Name of role.
    trocket_rocketmq_role_id str
    ID of the resource.
    instanceId String
    ID of instance.
    permRead Boolean
    Whether to enable consumption permission.
    permWrite Boolean
    Whether to enable production permission.
    remark String
    remark.
    role String
    Name of role.
    trocketRocketmqRoleId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TrocketRocketmqRole resource produces the following output properties:

    AccessKey string
    Access key.
    CreatedTime double
    Created time.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedTime double
    Modified time.
    SecretKey string
    Secret key.
    AccessKey string
    Access key.
    CreatedTime float64
    Created time.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedTime float64
    Modified time.
    SecretKey string
    Secret key.
    accessKey String
    Access key.
    createdTime Double
    Created time.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedTime Double
    Modified time.
    secretKey String
    Secret key.
    accessKey string
    Access key.
    createdTime number
    Created time.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedTime number
    Modified time.
    secretKey string
    Secret key.
    access_key str
    Access key.
    created_time float
    Created time.
    id str
    The provider-assigned unique ID for this managed resource.
    modified_time float
    Modified time.
    secret_key str
    Secret key.
    accessKey String
    Access key.
    createdTime Number
    Created time.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedTime Number
    Modified time.
    secretKey String
    Secret key.

    Look up Existing TrocketRocketmqRole Resource

    Get an existing TrocketRocketmqRole 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?: TrocketRocketmqRoleState, opts?: CustomResourceOptions): TrocketRocketmqRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_key: Optional[str] = None,
            created_time: Optional[float] = None,
            instance_id: Optional[str] = None,
            modified_time: Optional[float] = None,
            perm_read: Optional[bool] = None,
            perm_write: Optional[bool] = None,
            remark: Optional[str] = None,
            role: Optional[str] = None,
            secret_key: Optional[str] = None,
            trocket_rocketmq_role_id: Optional[str] = None) -> TrocketRocketmqRole
    func GetTrocketRocketmqRole(ctx *Context, name string, id IDInput, state *TrocketRocketmqRoleState, opts ...ResourceOption) (*TrocketRocketmqRole, error)
    public static TrocketRocketmqRole Get(string name, Input<string> id, TrocketRocketmqRoleState? state, CustomResourceOptions? opts = null)
    public static TrocketRocketmqRole get(String name, Output<String> id, TrocketRocketmqRoleState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TrocketRocketmqRole    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:
    AccessKey string
    Access key.
    CreatedTime double
    Created time.
    InstanceId string
    ID of instance.
    ModifiedTime double
    Modified time.
    PermRead bool
    Whether to enable consumption permission.
    PermWrite bool
    Whether to enable production permission.
    Remark string
    remark.
    Role string
    Name of role.
    SecretKey string
    Secret key.
    TrocketRocketmqRoleId string
    ID of the resource.
    AccessKey string
    Access key.
    CreatedTime float64
    Created time.
    InstanceId string
    ID of instance.
    ModifiedTime float64
    Modified time.
    PermRead bool
    Whether to enable consumption permission.
    PermWrite bool
    Whether to enable production permission.
    Remark string
    remark.
    Role string
    Name of role.
    SecretKey string
    Secret key.
    TrocketRocketmqRoleId string
    ID of the resource.
    accessKey String
    Access key.
    createdTime Double
    Created time.
    instanceId String
    ID of instance.
    modifiedTime Double
    Modified time.
    permRead Boolean
    Whether to enable consumption permission.
    permWrite Boolean
    Whether to enable production permission.
    remark String
    remark.
    role String
    Name of role.
    secretKey String
    Secret key.
    trocketRocketmqRoleId String
    ID of the resource.
    accessKey string
    Access key.
    createdTime number
    Created time.
    instanceId string
    ID of instance.
    modifiedTime number
    Modified time.
    permRead boolean
    Whether to enable consumption permission.
    permWrite boolean
    Whether to enable production permission.
    remark string
    remark.
    role string
    Name of role.
    secretKey string
    Secret key.
    trocketRocketmqRoleId string
    ID of the resource.
    access_key str
    Access key.
    created_time float
    Created time.
    instance_id str
    ID of instance.
    modified_time float
    Modified time.
    perm_read bool
    Whether to enable consumption permission.
    perm_write bool
    Whether to enable production permission.
    remark str
    remark.
    role str
    Name of role.
    secret_key str
    Secret key.
    trocket_rocketmq_role_id str
    ID of the resource.
    accessKey String
    Access key.
    createdTime Number
    Created time.
    instanceId String
    ID of instance.
    modifiedTime Number
    Modified time.
    permRead Boolean
    Whether to enable consumption permission.
    permWrite Boolean
    Whether to enable production permission.
    remark String
    remark.
    role String
    Name of role.
    secretKey String
    Secret key.
    trocketRocketmqRoleId String
    ID of the resource.

    Import

    trocket rocketmq_role can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/trocketRocketmqRole:TrocketRocketmqRole rocketmq_role instanceId#role
    

    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