<filename>sdk/dotnet/Zia/TrafficForwarding/TrafficForwardingVPNCredentials.cs// *** 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 zscaler.PulumiPackage.Zia.TrafficForwarding
{
    /// <summary>
    /// The **zia_traffic_forwarding_vpn_credentials** creates and manages VPN credentials that can be associated to locations. VPN is one way to route traffic from customer locations to the cloud. Site-to-site IPSec VPN credentials can be identified by the cloud through one of the following methods:
    /// 
    /// * Common Name (CN) of IPSec Certificate
    /// * VPN User FQDN - requires VPN_SITE_TO_SITE subscription
    /// * VPN IP Address - requires VPN_SITE_TO_SITE subscription
    /// * Extended Authentication (XAUTH) or hosted mobile UserID - requires VPN_MOBILE subscription
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zia = zscaler.PulumiPackage.Zia;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // ZIA Traffic Forwarding - VPN Credentials (UFQDN)
    ///     var example = new Zia.TrafficForwarding.TrafficForwardingVPNCredentials("example", new()
    ///     {
    ///         Comments = "Example",
    ///         Fqdn = "kenaa@example.com",
    ///         PreSharedKey = "newPassword123!",
    ///         Type = "UFQDN",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zia = zscaler.PulumiPackage.Zia;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var exampleTrafficForwardingStaticIP = new Zia.TrafficForwarding.TrafficForwardingStaticIP("exampleTrafficForwardingStaticIP", new()
    ///     {
    ///         IpAddress = "1.1.1.1",
    ///         RoutableIp = true,
    ///         Comment = "Example",
    ///         GeoOverride = true,
    ///         Latitude = -36.848461,
    ///         Longitude = 174.763336,
    ///     });
    /// 
    ///     // ZIA Traffic Forwarding - VPN Credentials (IP)
    ///     var exampleTrafficForwardingVPNCredentials = new Zia.TrafficForwarding.TrafficForwardingVPNCredentials("exampleTrafficForwardingVPNCredentials", new()
    ///     {
    ///         Type = "IP",
    ///         IpAddress = exampleTrafficForwardingStaticIP.IpAddress,
    ///         Comments = "Example",
    ///         PreSharedKey = "newPassword123!",
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             exampleTrafficForwardingStaticIP,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// &gt; **NOTE** For VPN Credentials of Type `IP` a static IP resource must be created first.
    /// 
    /// ## Import
    /// 
    /// Static IP resources can be imported by using `&lt;STATIC IP ID&gt;` or `&lt;IP ADDRESS&gt;`as the import ID.
    /// 
    /// ```sh
    ///  $ pulumi import zia:TrafficForwarding/trafficForwardingVPNCredentials:TrafficForwardingVPNCredentials example &lt;static_ip_id&gt;
    /// ```
    /// 
    ///  or
    /// 
    /// ```sh
    ///  $ pulumi import zia:TrafficForwarding/trafficForwardingVPNCredentials:TrafficForwardingVPNCredentials example &lt;ip_address&gt;
    /// ```
    /// </summary>
    [ZiaResourceType("zia:TrafficForwarding/trafficForwardingVPNCredentials:TrafficForwardingVPNCredentials")]
    public partial class TrafficForwardingVPNCredentials : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Additional information about this VPN credential.
        /// </summary>
        [Output("comments")]
        public Output<string?> Comments { get; private set; } = null!;

        /// <summary>
        /// Fully Qualified Domain Name. Applicable only to `UFQDN` or `XAUTH` (or `HOSTED_MOBILE_USERS`) auth type.
        /// </summary>
        [Output("fqdn")]
        public Output<string?> Fqdn { get; private set; } = null!;

        /// <summary>
        /// IP Address for the VON credentials. The parameter becomes required if `type = IP`
        /// </summary>
        [Output("ipAddress")]
        public Output<string?> IpAddress { get; private set; } = null!;

        /// <summary>
        /// Pre-shared key. This is a required field for UFQDN and IP auth type.
        /// </summary>
        [Output("preSharedKey")]
        public Output<string?> PreSharedKey { get; private set; } = null!;

        /// <summary>
        /// VPN authentication type (i.e., how the VPN credential is sent to the server). It is not modifiable after VpnCredential is created. The supported values are: `UFQDN` and `IP`
        /// </summary>
        [Output("type")]
        public Output<string?> Type { get; private set; } = null!;

        [Output("vpnCredentalId")]
        public Output<int> VpnCredentalId { get; private set; } = null!;


        /// <summary>
        /// Create a TrafficForwardingVPNCredentials 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 TrafficForwardingVPNCredentials(string name, TrafficForwardingVPNCredentialsArgs? args = null, CustomResourceOptions? options = null)
            : base("zia:TrafficForwarding/trafficForwardingVPNCredentials:TrafficForwardingVPNCredentials", name, args ?? new TrafficForwardingVPNCredentialsArgs(), MakeResourceOptions(options, ""))
        {
        }

        private TrafficForwardingVPNCredentials(string name, Input<string> id, TrafficForwardingVPNCredentialsState? state = null, CustomResourceOptions? options = null)
            : base("zia:TrafficForwarding/trafficForwardingVPNCredentials:TrafficForwardingVPNCredentials", 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/zscaler",
                AdditionalSecretOutputs =
                {
                    "preSharedKey",
                },
            };
            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 TrafficForwardingVPNCredentials 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 TrafficForwardingVPNCredentials Get(string name, Input<string> id, TrafficForwardingVPNCredentialsState? state = null, CustomResourceOptions? options = null)
        {
            return new TrafficForwardingVPNCredentials(name, id, state, options);
        }
    }

    public sealed class TrafficForwardingVPNCredentialsArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Additional information about this VPN credential.
        /// </summary>
        [Input("comments")]
        public Input<string>? Comments { get; set; }

        /// <summary>
        /// Fully Qualified Domain Name. Applicable only to `UFQDN` or `XAUTH` (or `HOSTED_MOBILE_USERS`) auth type.
        /// </summary>
        [Input("fqdn")]
        public Input<string>? Fqdn { get; set; }

        /// <summary>
        /// IP Address for the VON credentials. The parameter becomes required if `type = IP`
        /// </summary>
        [Input("ipAddress")]
        public Input<string>? IpAddress { get; set; }

        [Input("preSharedKey")]
        private Input<string>? _preSharedKey;

        /// <summary>
        /// Pre-shared key. This is a required field for UFQDN and IP auth type.
        /// </summary>
        public Input<string>? PreSharedKey
        {
            get => _preSharedKey;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _preSharedKey = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// VPN authentication type (i.e., how the VPN credential is sent to the server). It is not modifiable after VpnCredential is created. The supported values are: `UFQDN` and `IP`
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

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

    public sealed class TrafficForwardingVPNCredentialsState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Additional information about this VPN credential.
        /// </summary>
        [Input("comments")]
        public Input<string>? Comments { get; set; }

        /// <summary>
        /// Fully Qualified Domain Name. Applicable only to `UFQDN` or `XAUTH` (or `HOSTED_MOBILE_USERS`) auth type.
        /// </summary>
        [Input("fqdn")]
        public Input<string>? Fqdn { get; set; }

        /// <summary>
        /// IP Address for the VON credentials. The parameter becomes required if `type = IP`
        /// </summary>
        [Input("ipAddress")]
        public Input<string>? IpAddress { get; set; }

        [Input("preSharedKey")]
        private Input<string>? _preSharedKey;

        /// <summary>
        /// Pre-shared key. This is a required field for UFQDN and IP auth type.
        /// </summary>
        public Input<string>? PreSharedKey
        {
            get => _preSharedKey;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _preSharedKey = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// VPN authentication type (i.e., how the VPN credential is sent to the server). It is not modifiable after VpnCredential is created. The supported values are: `UFQDN` and `IP`
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        [Input("vpnCredentalId")]
        public Input<int>? VpnCredentalId { get; set; }

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