// *** 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.Mongodb
{
    /// <summary>
    /// Provides a resource to create a mongodb instance_account
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var instanceAccount = new Tencentcloud.Mongodb.InstanceAccount("instanceAccount", new Tencentcloud.Mongodb.InstanceAccountArgs
    ///         {
    ///             AuthRoles = 
    ///             {
    ///                 new Tencentcloud.Mongodb.Inputs.InstanceAccountAuthRoleArgs
    ///                 {
    ///                     Mask = 0,
    ///                     Namespace = "*",
    ///                 },
    ///             },
    ///             InstanceId = "cmgo-lxaz2c9b",
    ///             MongoUserPassword = "xxxxxxxxx",
    ///             Password = "xxxxxxxx",
    ///             UserDesc = "test account",
    ///             UserName = "test_account",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Mongodb/instanceAccount:InstanceAccount")]
    public partial class InstanceAccount : Pulumi.CustomResource
    {
        /// <summary>
        /// The read and write permission information of the account.
        /// </summary>
        [Output("authRoles")]
        public Output<ImmutableArray<Outputs.InstanceAccountAuthRole>> AuthRoles { get; private set; } = null!;

        /// <summary>
        /// Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
        /// </summary>
        [Output("mongoUserPassword")]
        public Output<string> MongoUserPassword { get; private set; } = null!;

        /// <summary>
        /// New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
        /// </summary>
        [Output("password")]
        public Output<string> Password { get; private set; } = null!;

        /// <summary>
        /// Account remarks.
        /// </summary>
        [Output("userDesc")]
        public Output<string?> UserDesc { get; private set; } = null!;

        /// <summary>
        /// The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
        /// </summary>
        [Output("userName")]
        public Output<string> UserName { get; private set; } = null!;


        /// <summary>
        /// Create a InstanceAccount 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 InstanceAccount(string name, InstanceAccountArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Mongodb/instanceAccount:InstanceAccount", name, args ?? new InstanceAccountArgs(), MakeResourceOptions(options, ""))
        {
        }

        private InstanceAccount(string name, Input<string> id, InstanceAccountState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Mongodb/instanceAccount:InstanceAccount", 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 InstanceAccount 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 InstanceAccount Get(string name, Input<string> id, InstanceAccountState? state = null, CustomResourceOptions? options = null)
        {
            return new InstanceAccount(name, id, state, options);
        }
    }

    public sealed class InstanceAccountArgs : Pulumi.ResourceArgs
    {
        [Input("authRoles")]
        private InputList<Inputs.InstanceAccountAuthRoleArgs>? _authRoles;

        /// <summary>
        /// The read and write permission information of the account.
        /// </summary>
        public InputList<Inputs.InstanceAccountAuthRoleArgs> AuthRoles
        {
            get => _authRoles ?? (_authRoles = new InputList<Inputs.InstanceAccountAuthRoleArgs>());
            set => _authRoles = value;
        }

        /// <summary>
        /// Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
        /// </summary>
        [Input("mongoUserPassword", required: true)]
        public Input<string> MongoUserPassword { get; set; } = null!;

        /// <summary>
        /// New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
        /// </summary>
        [Input("password", required: true)]
        public Input<string> Password { get; set; } = null!;

        /// <summary>
        /// Account remarks.
        /// </summary>
        [Input("userDesc")]
        public Input<string>? UserDesc { get; set; }

        /// <summary>
        /// The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
        /// </summary>
        [Input("userName", required: true)]
        public Input<string> UserName { get; set; } = null!;

        public InstanceAccountArgs()
        {
        }
    }

    public sealed class InstanceAccountState : Pulumi.ResourceArgs
    {
        [Input("authRoles")]
        private InputList<Inputs.InstanceAccountAuthRoleGetArgs>? _authRoles;

        /// <summary>
        /// The read and write permission information of the account.
        /// </summary>
        public InputList<Inputs.InstanceAccountAuthRoleGetArgs> AuthRoles
        {
            get => _authRoles ?? (_authRoles = new InputList<Inputs.InstanceAccountAuthRoleGetArgs>());
            set => _authRoles = value;
        }

        /// <summary>
        /// Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
        /// </summary>
        [Input("mongoUserPassword")]
        public Input<string>? MongoUserPassword { get; set; }

        /// <summary>
        /// New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// Account remarks.
        /// </summary>
        [Input("userDesc")]
        public Input<string>? UserDesc { get; set; }

        /// <summary>
        /// The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
        /// </summary>
        [Input("userName")]
        public Input<string>? UserName { get; set; }

        public InstanceAccountState()
        {
        }
    }
}
