// *** 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_vpn_user** resource creates and manages Aviatrix VPN users.
    /// 
    /// &gt; **NOTE:** As of R2.15, management of user/profile attachment can be set using `manage_user_attachment`. This argument must be to *true* in either **aviatrix_vpn_user** or **aviatrix_vpn_profile**. If attachment is managed in the **aviatrix_vpn_user** (set to *true*), it must be set to *false* in the **aviatrix_vpn_profile** resource and vice versa.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix VPN User
    ///     var testVpnUser = new Aviatrix.AviatrixVpnUser("testVpnUser", new()
    ///     {
    ///         GwName = "gw1",
    ///         UserEmail = "ychag@example.com",
    ///         UserName = "username1",
    ///         VpcId = "vpc-abcd1234",
    ///     });
    /// 
    /// });
    /// ```
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix VPN User under Geo VPN
    ///     var testVpnUser = new Aviatrix.AviatrixVpnUser("testVpnUser", new()
    ///     {
    ///         DnsName = "vpn.testuser.com",
    ///         UserEmail = "ychag@example.com",
    ///         UserName = "username1",
    ///     });
    /// 
    /// });
    /// ```
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix VPN User on GCP
    ///     // See note below about vpc_id formatting for GCP
    ///     var testVpnUser = new Aviatrix.AviatrixVpnUser("testVpnUser", new()
    ///     {
    ///         GwName = "gw1",
    ///         UserEmail = "ychag@example.com",
    ///         UserName = "username1",
    ///         VpcId = $"{aviatrix_vpc.Test_vpc.Vpc_id}~-~{aviatrix_account.Test_account.Gcloud_project_id}",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// **vpn_user** can be imported using the `user_name`, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import aviatrix:index/aviatrixVpnUser:AviatrixVpnUser test user_name
    /// ```
    /// </summary>
    [AviatrixResourceType("aviatrix:index/aviatrixVpnUser:AviatrixVpnUser")]
    public partial class AviatrixVpnUser : global::Pulumi.CustomResource
    {
        /// <summary>
        /// FQDN of a DNS based VPN service such as GeoVPN or UDP load balancer. Example: "vpn.testuser.com".
        /// </summary>
        [Output("dnsName")]
        public Output<string?> DnsName { get; private set; } = null!;

        /// <summary>
        /// If ELB is enabled, this will be the name of the ELB, else it will be the name of the Aviatrix VPN gateway. Used together with `vpc_id`. Example: "gw1".
        /// </summary>
        [Output("gwName")]
        public Output<string?> GwName { get; private set; } = null!;

        /// <summary>
        /// This parameter is a switch to determine whether or not to manage VPN user attachments to the VPN profile using this resource. If this is set to false, attachment must be managed using the **aviatrix_vpn_profile** resource. Valid values: true, false. Default value: false.
        /// </summary>
        [Output("manageUserAttachment")]
        public Output<bool?> ManageUserAttachment { get; private set; } = null!;

        /// <summary>
        /// List of VPN profiles for user to attach to. This should be set to null if `manage_user_attachment` is set to false.
        /// </summary>
        [Output("profiles")]
        public Output<ImmutableArray<string>> Profiles { get; private set; } = null!;

        /// <summary>
        /// This is the name of the SAML endpoint to which the user is to be associated. This is required if adding user to a SAML gateway/LB.
        /// </summary>
        [Output("samlEndpoint")]
        public Output<string?> SamlEndpoint { get; private set; } = null!;

        /// <summary>
        /// VPN user's email. Example: "kenaa@example.com".
        /// </summary>
        [Output("userEmail")]
        public Output<string?> UserEmail { get; private set; } = null!;

        /// <summary>
        /// VPN user name. Example: "user".
        /// </summary>
        [Output("userName")]
        public Output<string> UserName { get; private set; } = null!;

        /// <summary>
        /// VPC ID of Aviatrix VPN gateway. Used together with `gw_name`. Example: "vpc-abcd1234".
        /// </summary>
        [Output("vpcId")]
        public Output<string?> VpcId { get; private set; } = null!;


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

        private AviatrixVpnUser(string name, Input<string> id, AviatrixVpnUserState? state = null, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixVpnUser:AviatrixVpnUser", 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",
            };
            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 AviatrixVpnUser 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 AviatrixVpnUser Get(string name, Input<string> id, AviatrixVpnUserState? state = null, CustomResourceOptions? options = null)
        {
            return new AviatrixVpnUser(name, id, state, options);
        }
    }

    public sealed class AviatrixVpnUserArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// FQDN of a DNS based VPN service such as GeoVPN or UDP load balancer. Example: "vpn.testuser.com".
        /// </summary>
        [Input("dnsName")]
        public Input<string>? DnsName { get; set; }

        /// <summary>
        /// If ELB is enabled, this will be the name of the ELB, else it will be the name of the Aviatrix VPN gateway. Used together with `vpc_id`. Example: "gw1".
        /// </summary>
        [Input("gwName")]
        public Input<string>? GwName { get; set; }

        /// <summary>
        /// This parameter is a switch to determine whether or not to manage VPN user attachments to the VPN profile using this resource. If this is set to false, attachment must be managed using the **aviatrix_vpn_profile** resource. Valid values: true, false. Default value: false.
        /// </summary>
        [Input("manageUserAttachment")]
        public Input<bool>? ManageUserAttachment { get; set; }

        [Input("profiles")]
        private InputList<string>? _profiles;

        /// <summary>
        /// List of VPN profiles for user to attach to. This should be set to null if `manage_user_attachment` is set to false.
        /// </summary>
        public InputList<string> Profiles
        {
            get => _profiles ?? (_profiles = new InputList<string>());
            set => _profiles = value;
        }

        /// <summary>
        /// This is the name of the SAML endpoint to which the user is to be associated. This is required if adding user to a SAML gateway/LB.
        /// </summary>
        [Input("samlEndpoint")]
        public Input<string>? SamlEndpoint { get; set; }

        /// <summary>
        /// VPN user's email. Example: "kenaa@example.com".
        /// </summary>
        [Input("userEmail")]
        public Input<string>? UserEmail { get; set; }

        /// <summary>
        /// VPN user name. Example: "user".
        /// </summary>
        [Input("userName", required: true)]
        public Input<string> UserName { get; set; } = null!;

        /// <summary>
        /// VPC ID of Aviatrix VPN gateway. Used together with `gw_name`. Example: "vpc-abcd1234".
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

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

    public sealed class AviatrixVpnUserState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// FQDN of a DNS based VPN service such as GeoVPN or UDP load balancer. Example: "vpn.testuser.com".
        /// </summary>
        [Input("dnsName")]
        public Input<string>? DnsName { get; set; }

        /// <summary>
        /// If ELB is enabled, this will be the name of the ELB, else it will be the name of the Aviatrix VPN gateway. Used together with `vpc_id`. Example: "gw1".
        /// </summary>
        [Input("gwName")]
        public Input<string>? GwName { get; set; }

        /// <summary>
        /// This parameter is a switch to determine whether or not to manage VPN user attachments to the VPN profile using this resource. If this is set to false, attachment must be managed using the **aviatrix_vpn_profile** resource. Valid values: true, false. Default value: false.
        /// </summary>
        [Input("manageUserAttachment")]
        public Input<bool>? ManageUserAttachment { get; set; }

        [Input("profiles")]
        private InputList<string>? _profiles;

        /// <summary>
        /// List of VPN profiles for user to attach to. This should be set to null if `manage_user_attachment` is set to false.
        /// </summary>
        public InputList<string> Profiles
        {
            get => _profiles ?? (_profiles = new InputList<string>());
            set => _profiles = value;
        }

        /// <summary>
        /// This is the name of the SAML endpoint to which the user is to be associated. This is required if adding user to a SAML gateway/LB.
        /// </summary>
        [Input("samlEndpoint")]
        public Input<string>? SamlEndpoint { get; set; }

        /// <summary>
        /// VPN user's email. Example: "kenaa@example.com".
        /// </summary>
        [Input("userEmail")]
        public Input<string>? UserEmail { get; set; }

        /// <summary>
        /// VPN user name. Example: "user".
        /// </summary>
        [Input("userName")]
        public Input<string>? UserName { get; set; }

        /// <summary>
        /// VPC ID of Aviatrix VPN gateway. Used together with `gw_name`. Example: "vpc-abcd1234".
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

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