// *** 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;

namespace Pulumi.Aviatrix
{
    /// <summary>
    /// The **aviatrix_account_user** resource allows the creation and management of Aviatrix user accounts.
    /// 
    /// &gt; **NOTE:** With the release of Controller 5.4 (compatible with Aviatrix provider R2.13), Role-Based Access Control (RBAC) is now integrated into the Accounts workflow. Any **aviatrix_account_user** created in 5.3 by default will have admin privileges (attached to the 'admin' RBAC permission group). In 5.4, any new account users created will no longer have the option to specify an `account_name`, but rather have the option to attach the user to specific RBAC groups through the **aviatrix_rbac_group_user_attachment** resource for more granular security control. Account users created in 5.4 will have minimal access (read_only) unless otherwise specified in the RBAC group permissions that the users are attached to.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix User Account
    ///     var testAccountuser = new Aviatrix.AviatrixAccountUser("testAccountuser", new()
    ///     {
    ///         Email = "dycjh@example.com",
    ///         Password = "passwordforuser1-1234",
    ///         Username = "username1",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// **account_user** can be imported using the `username` (when doing import, need to leave `password` argument blank), e.g.
    /// 
    /// ```sh
    ///  $ pulumi import aviatrix:index/aviatrixAccountUser:AviatrixAccountUser test username
    /// ```
    /// </summary>
    [AviatrixResourceType("aviatrix:index/aviatrixAccountUser:AviatrixAccountUser")]
    public partial class AviatrixAccountUser : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Email of address of account user to be created.
        /// </summary>
        [Output("email")]
        public Output<string> Email { get; private set; } = null!;

        /// <summary>
        /// Login password for the account user to be created. If password is changed, current account will be destroyed and a new account will be created.
        /// </summary>
        [Output("password")]
        public Output<string> Password { get; private set; } = null!;

        /// <summary>
        /// Name of account user to be created. It can only include alphanumeric characters(lower case only), hyphens, dots or underscores. 1 to 80 in length. No spaces are allowed.
        /// </summary>
        [Output("username")]
        public Output<string> Username { get; private set; } = null!;


        /// <summary>
        /// Create a AviatrixAccountUser 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 AviatrixAccountUser(string name, AviatrixAccountUserArgs args, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixAccountUser:AviatrixAccountUser", name, args ?? new AviatrixAccountUserArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AviatrixAccountUser(string name, Input<string> id, AviatrixAccountUserState? state = null, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixAccountUser:AviatrixAccountUser", 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/astipkovits",
                AdditionalSecretOutputs =
                {
                    "password",
                },
            };
            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 AviatrixAccountUser 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 AviatrixAccountUser Get(string name, Input<string> id, AviatrixAccountUserState? state = null, CustomResourceOptions? options = null)
        {
            return new AviatrixAccountUser(name, id, state, options);
        }
    }

    public sealed class AviatrixAccountUserArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Email of address of account user to be created.
        /// </summary>
        [Input("email", required: true)]
        public Input<string> Email { get; set; } = null!;

        [Input("password", required: true)]
        private Input<string>? _password;

        /// <summary>
        /// Login password for the account user to be created. If password is changed, current account will be destroyed and a new account will be created.
        /// </summary>
        public Input<string>? Password
        {
            get => _password;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Name of account user to be created. It can only include alphanumeric characters(lower case only), hyphens, dots or underscores. 1 to 80 in length. No spaces are allowed.
        /// </summary>
        [Input("username", required: true)]
        public Input<string> Username { get; set; } = null!;

        public AviatrixAccountUserArgs()
        {
        }
        public static new AviatrixAccountUserArgs Empty => new AviatrixAccountUserArgs();
    }

    public sealed class AviatrixAccountUserState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Email of address of account user to be created.
        /// </summary>
        [Input("email")]
        public Input<string>? Email { get; set; }

        [Input("password")]
        private Input<string>? _password;

        /// <summary>
        /// Login password for the account user to be created. If password is changed, current account will be destroyed and a new account will be created.
        /// </summary>
        public Input<string>? Password
        {
            get => _password;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Name of account user to be created. It can only include alphanumeric characters(lower case only), hyphens, dots or underscores. 1 to 80 in length. No spaces are allowed.
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

        public AviatrixAccountUserState()
        {
        }
        public static new AviatrixAccountUserState Empty => new AviatrixAccountUserState();
    }
}
