<filename>sdk/dotnet/Tencentcloud/Redis/Account.cs<gh_stars>0// *** 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.Redis
{
    /// <summary>
    /// Provides a resource to create a redis account
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var account = new Tencentcloud.Redis.Account("account", new Tencentcloud.Redis.AccountArgs
    ///         {
    ///             AccountName = "account_test",
    ///             AccountPassword = "test1234",
    ///             InstanceId = "crs-xxxxxx",
    ///             Privilege = "rw",
    ///             ReadonlyPolicies = 
    ///             {
    ///                 "master",
    ///             },
    ///             Remark = "master",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// redis account can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Redis/account:Account account crs-xxxxxx#account_test
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Redis/account:Account")]
    public partial class Account : Pulumi.CustomResource
    {
        /// <summary>
        /// The account name.
        /// </summary>
        [Output("accountName")]
        public Output<string> AccountName { get; private set; } = null!;

        /// <summary>
        /// 1: Length 8-30 digits, it is recommended to use a password of more than 12 digits; 2: Cannot start with `/`; 3: Include at least two items: a.Lowercase letters `a-z`; b.Uppercase letters `A-Z` c.Numbers `0-9`;  d.`()`~!@#$%^&amp;*-+=_|{}[]:;&lt;&gt;,.?/`.
        /// </summary>
        [Output("accountPassword")]
        public Output<string> AccountPassword { get; private set; } = null!;

        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// Read and write policy: Enter R and RW to indicate read-only, read-write, cannot be empty when modifying operations.
        /// </summary>
        [Output("privilege")]
        public Output<string> Privilege { get; private set; } = null!;

        /// <summary>
        /// Routing policy: Enter master or replication, which indicates the master node or slave node, cannot be empty when modifying operations.
        /// </summary>
        [Output("readonlyPolicies")]
        public Output<ImmutableArray<string>> ReadonlyPolicies { get; private set; } = null!;

        /// <summary>
        /// Remark.
        /// </summary>
        [Output("remark")]
        public Output<string?> Remark { get; private set; } = null!;


        /// <summary>
        /// Create a Account 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 Account(string name, AccountArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Redis/account:Account", name, args ?? new AccountArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class AccountArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The account name.
        /// </summary>
        [Input("accountName", required: true)]
        public Input<string> AccountName { get; set; } = null!;

        /// <summary>
        /// 1: Length 8-30 digits, it is recommended to use a password of more than 12 digits; 2: Cannot start with `/`; 3: Include at least two items: a.Lowercase letters `a-z`; b.Uppercase letters `A-Z` c.Numbers `0-9`;  d.`()`~!@#$%^&amp;*-+=_|{}[]:;&lt;&gt;,.?/`.
        /// </summary>
        [Input("accountPassword", required: true)]
        public Input<string> AccountPassword { get; set; } = null!;

        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// Read and write policy: Enter R and RW to indicate read-only, read-write, cannot be empty when modifying operations.
        /// </summary>
        [Input("privilege", required: true)]
        public Input<string> Privilege { get; set; } = null!;

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

        /// <summary>
        /// Routing policy: Enter master or replication, which indicates the master node or slave node, cannot be empty when modifying operations.
        /// </summary>
        public InputList<string> ReadonlyPolicies
        {
            get => _readonlyPolicies ?? (_readonlyPolicies = new InputList<string>());
            set => _readonlyPolicies = value;
        }

        /// <summary>
        /// Remark.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        public AccountArgs()
        {
        }
    }

    public sealed class AccountState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The account name.
        /// </summary>
        [Input("accountName")]
        public Input<string>? AccountName { get; set; }

        /// <summary>
        /// 1: Length 8-30 digits, it is recommended to use a password of more than 12 digits; 2: Cannot start with `/`; 3: Include at least two items: a.Lowercase letters `a-z`; b.Uppercase letters `A-Z` c.Numbers `0-9`;  d.`()`~!@#$%^&amp;*-+=_|{}[]:;&lt;&gt;,.?/`.
        /// </summary>
        [Input("accountPassword")]
        public Input<string>? AccountPassword { get; set; }

        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// Read and write policy: Enter R and RW to indicate read-only, read-write, cannot be empty when modifying operations.
        /// </summary>
        [Input("privilege")]
        public Input<string>? Privilege { get; set; }

        [Input("readonlyPolicies")]
        private InputList<string>? _readonlyPolicies;

        /// <summary>
        /// Routing policy: Enter master or replication, which indicates the master node or slave node, cannot be empty when modifying operations.
        /// </summary>
        public InputList<string> ReadonlyPolicies
        {
            get => _readonlyPolicies ?? (_readonlyPolicies = new InputList<string>());
            set => _readonlyPolicies = value;
        }

        /// <summary>
        /// Remark.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        public AccountState()
        {
        }
    }
}
