// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Tdmq
{
    /// <summary>
    /// Provides a resource to create a tdmqRocketmq environment_role
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var cluster = new Tencentcloud.Tdmq.RocketmqCluster("cluster", new Tencentcloud.Tdmq.RocketmqClusterArgs
    ///         {
    ///             ClusterName = "test_rocketmq",
    ///             Remark = "test recket mq",
    ///         });
    ///         var role = new Tencentcloud.Tdmq.RocketmqRole("role", new Tencentcloud.Tdmq.RocketmqRoleArgs
    ///         {
    ///             RoleName = "test_rocketmq_role",
    ///             Remark = "test rocketmq role",
    ///             ClusterId = cluster.ClusterId,
    ///         });
    ///         var @namespace = new Tencentcloud.Tdmq.RocketmqNamespace("namespace", new Tencentcloud.Tdmq.RocketmqNamespaceArgs
    ///         {
    ///             ClusterId = cluster.ClusterId,
    ///             NamespaceName = "test_namespace",
    ///             Ttl = 65000,
    ///             RetentionTime = 65000,
    ///             Remark = "test namespace",
    ///         });
    ///         var environmentRole = new Tencentcloud.Tdmq.RocketmqEnvironmentRole("environmentRole", new Tencentcloud.Tdmq.RocketmqEnvironmentRoleArgs
    ///         {
    ///             EnvironmentName = @namespace.NamespaceName,
    ///             RoleName = role.RoleName,
    ///             Permissions = 
    ///             {
    ///                 "produce",
    ///                 "consume",
    ///             },
    ///             ClusterId = cluster.ClusterId,
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// tdmqRocketmq environment_role can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Tdmq/rocketmqEnvironmentRole:RocketmqEnvironmentRole environment_role environmentRole_id
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Tdmq/rocketmqEnvironmentRole:RocketmqEnvironmentRole")]
    public partial class RocketmqEnvironmentRole : Pulumi.CustomResource
    {
        /// <summary>
        /// Cluster ID (required).
        /// </summary>
        [Output("clusterId")]
        public Output<string> ClusterId { get; private set; } = null!;

        /// <summary>
        /// Environment (namespace) name.
        /// </summary>
        [Output("environmentName")]
        public Output<string> EnvironmentName { get; private set; } = null!;

        /// <summary>
        /// Permissions, which is a non-empty string array of `produce` and `consume` at the most.
        /// </summary>
        [Output("permissions")]
        public Output<ImmutableArray<string>> Permissions { get; private set; } = null!;

        /// <summary>
        /// Role Name.
        /// </summary>
        [Output("roleName")]
        public Output<string> RoleName { get; private set; } = null!;


        /// <summary>
        /// Create a RocketmqEnvironmentRole resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public RocketmqEnvironmentRole(string name, RocketmqEnvironmentRoleArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Tdmq/rocketmqEnvironmentRole:RocketmqEnvironmentRole", name, args ?? new RocketmqEnvironmentRoleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private RocketmqEnvironmentRole(string name, Input<string> id, RocketmqEnvironmentRoleState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Tdmq/rocketmqEnvironmentRole:RocketmqEnvironmentRole", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing RocketmqEnvironmentRole resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static RocketmqEnvironmentRole Get(string name, Input<string> id, RocketmqEnvironmentRoleState? state = null, CustomResourceOptions? options = null)
        {
            return new RocketmqEnvironmentRole(name, id, state, options);
        }
    }

    public sealed class RocketmqEnvironmentRoleArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Cluster ID (required).
        /// </summary>
        [Input("clusterId", required: true)]
        public Input<string> ClusterId { get; set; } = null!;

        /// <summary>
        /// Environment (namespace) name.
        /// </summary>
        [Input("environmentName", required: true)]
        public Input<string> EnvironmentName { get; set; } = null!;

        [Input("permissions", required: true)]
        private InputList<string>? _permissions;

        /// <summary>
        /// Permissions, which is a non-empty string array of `produce` and `consume` at the most.
        /// </summary>
        public InputList<string> Permissions
        {
            get => _permissions ?? (_permissions = new InputList<string>());
            set => _permissions = value;
        }

        /// <summary>
        /// Role Name.
        /// </summary>
        [Input("roleName", required: true)]
        public Input<string> RoleName { get; set; } = null!;

        public RocketmqEnvironmentRoleArgs()
        {
        }
    }

    public sealed class RocketmqEnvironmentRoleState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Cluster ID (required).
        /// </summary>
        [Input("clusterId")]
        public Input<string>? ClusterId { get; set; }

        /// <summary>
        /// Environment (namespace) name.
        /// </summary>
        [Input("environmentName")]
        public Input<string>? EnvironmentName { get; set; }

        [Input("permissions")]
        private InputList<string>? _permissions;

        /// <summary>
        /// Permissions, which is a non-empty string array of `produce` and `consume` at the most.
        /// </summary>
        public InputList<string> Permissions
        {
            get => _permissions ?? (_permissions = new InputList<string>());
            set => _permissions = value;
        }

        /// <summary>
        /// Role Name.
        /// </summary>
        [Input("roleName")]
        public Input<string>? RoleName { get; set; }

        public RocketmqEnvironmentRoleState()
        {
        }
    }
}
