// *** 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_gre_tunnel** resource allows the creation and management of GRE tunnel configuration in the Zscaler Internet Access (ZIA) portal.
    /// 
    /// &gt; **Note:** The provider automatically query the Zscaler cloud for the primary and secondary destination datacenter and virtual IP address (VIP) of the GRE tunnel. The parameter can be overriden if needed by setting the parameters: `primary_dest_vip` and `secondary_dest_vip`.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zia = zscaler.PulumiPackage.Zia;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // ZIA Traffic Forwarding - Static IP
    ///     var exampleTrafficForwardingStaticIP = new Zia.TrafficForwarding.TrafficForwardingStaticIP("exampleTrafficForwardingStaticIP", new()
    ///     {
    ///         IpAddress = "1.1.1.1",
    ///         RoutableIp = true,
    ///         Comment = "Example",
    ///         GeoOverride = true,
    ///         Latitude = 37.418171,
    ///         Longitude = -121.95314,
    ///     });
    /// 
    ///     // Creates a numbered GRE Tunnel
    ///     var exampleTrafficForwardingGRETunnel = new Zia.TrafficForwarding.TrafficForwardingGRETunnel("exampleTrafficForwardingGRETunnel", new()
    ///     {
    ///         SourceIp = exampleTrafficForwardingStaticIP.IpAddress,
    ///         Comment = "Example",
    ///         WithinCountry = true,
    ///         CountryCode = "US",
    ///         IpUnnumbered = false,
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             exampleTrafficForwardingStaticIP,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// &gt; **Note:** The provider will automatically query and set the Zscaler cloud for the next available `/29` internal IP range to be used in a numbered GRE tunnel.
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zia = zscaler.PulumiPackage.Zia;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // ZIA Traffic Forwarding - Static IP
    ///     var example = new Zia.TrafficForwarding.TrafficForwardingStaticIP("example", new()
    ///     {
    ///         IpAddress = "1.1.1.1",
    ///         RoutableIp = true,
    ///         Comment = "Example",
    ///         GeoOverride = true,
    ///         Latitude = 37.418171,
    ///         Longitude = -121.95314,
    ///     });
    /// 
    ///     // Creates an unnumbered GRE Tunnel
    ///     var telusHomeInternet01Gre01 = new Zia.TrafficForwarding.TrafficForwardingGRETunnel("telusHomeInternet01Gre01", new()
    ///     {
    ///         SourceIp = example.IpAddress,
    ///         Comment = "Example",
    ///         WithinCountry = true,
    ///         CountryCode = "CA",
    ///         IpUnnumbered = true,
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             example,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// </summary>
    [ZiaResourceType("zia:TrafficForwarding/trafficForwardingGRETunnel:TrafficForwardingGRETunnel")]
    public partial class TrafficForwardingGRETunnel : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Additional information about this GRE tunnel
        /// </summary>
        [Output("comment")]
        public Output<string?> Comment { get; private set; } = null!;

        /// <summary>
        /// When within_country is enabled, you must set this to the country code.
        /// </summary>
        [Output("countryCode")]
        public Output<string> CountryCode { get; private set; } = null!;

        /// <summary>
        /// The start of the internal IP address in /29 CIDR range. Automatically set by the provider if `ip_unnumbered` is set to `false`.
        /// </summary>
        [Output("internalIpRange")]
        public Output<string> InternalIpRange { get; private set; } = null!;

        /// <summary>
        /// This is required to support the automated SD-WAN provisioning of GRE tunnels, when set to true gre_tun_ip and gre_tun_id are set to null
        /// </summary>
        [Output("ipUnnumbered")]
        public Output<bool> IpUnnumbered { get; private set; } = null!;

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

        [Output("lastModifiedBies")]
        public Output<ImmutableArray<Outputs.TrafficForwardingGRETunnelLastModifiedBy>> LastModifiedBies { get; private set; } = null!;

        /// <summary>
        /// **` (Optional) The primary destination data center and virtual IP address (VIP) of the GRE tunnel.
        /// </summary>
        [Output("primaryDestVips")]
        public Output<ImmutableArray<Outputs.TrafficForwardingGRETunnelPrimaryDestVip>> PrimaryDestVips { get; private set; } = null!;

        /// <summary>
        /// The secondary destination data center and virtual IP address (VIP) of the GRE tunnel.
        /// </summary>
        [Output("secondaryDestVips")]
        public Output<ImmutableArray<Outputs.TrafficForwardingGRETunnelSecondaryDestVip>> SecondaryDestVips { get; private set; } = null!;

        /// <summary>
        /// The source IP address of the GRE tunnel. This is typically a static IP address in the organization or SD-WAN. This IP address must be provisioned within the Zscaler service using the /staticIP endpoint.
        /// </summary>
        [Output("sourceIp")]
        public Output<string> SourceIp { get; private set; } = null!;

        /// <summary>
        /// The ID of the GRE tunnel.
        /// </summary>
        [Output("tunnelId")]
        public Output<int> TunnelId { get; private set; } = null!;

        /// <summary>
        /// Restrict the data center virtual IP addresses (VIPs) only to those within the same country as the source IP address
        /// </summary>
        [Output("withinCountry")]
        public Output<bool> WithinCountry { get; private set; } = null!;


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

        private TrafficForwardingGRETunnel(string name, Input<string> id, TrafficForwardingGRETunnelState? state = null, CustomResourceOptions? options = null)
            : base("zia:TrafficForwarding/trafficForwardingGRETunnel:TrafficForwardingGRETunnel", 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",
            };
            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 TrafficForwardingGRETunnel 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 TrafficForwardingGRETunnel Get(string name, Input<string> id, TrafficForwardingGRETunnelState? state = null, CustomResourceOptions? options = null)
        {
            return new TrafficForwardingGRETunnel(name, id, state, options);
        }
    }

    public sealed class TrafficForwardingGRETunnelArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Additional information about this GRE tunnel
        /// </summary>
        [Input("comment")]
        public Input<string>? Comment { get; set; }

        /// <summary>
        /// When within_country is enabled, you must set this to the country code.
        /// </summary>
        [Input("countryCode")]
        public Input<string>? CountryCode { get; set; }

        /// <summary>
        /// The start of the internal IP address in /29 CIDR range. Automatically set by the provider if `ip_unnumbered` is set to `false`.
        /// </summary>
        [Input("internalIpRange")]
        public Input<string>? InternalIpRange { get; set; }

        /// <summary>
        /// This is required to support the automated SD-WAN provisioning of GRE tunnels, when set to true gre_tun_ip and gre_tun_id are set to null
        /// </summary>
        [Input("ipUnnumbered")]
        public Input<bool>? IpUnnumbered { get; set; }

        [Input("primaryDestVips")]
        private InputList<Inputs.TrafficForwardingGRETunnelPrimaryDestVipArgs>? _primaryDestVips;

        /// <summary>
        /// **` (Optional) The primary destination data center and virtual IP address (VIP) of the GRE tunnel.
        /// </summary>
        public InputList<Inputs.TrafficForwardingGRETunnelPrimaryDestVipArgs> PrimaryDestVips
        {
            get => _primaryDestVips ?? (_primaryDestVips = new InputList<Inputs.TrafficForwardingGRETunnelPrimaryDestVipArgs>());
            set => _primaryDestVips = value;
        }

        [Input("secondaryDestVips")]
        private InputList<Inputs.TrafficForwardingGRETunnelSecondaryDestVipArgs>? _secondaryDestVips;

        /// <summary>
        /// The secondary destination data center and virtual IP address (VIP) of the GRE tunnel.
        /// </summary>
        public InputList<Inputs.TrafficForwardingGRETunnelSecondaryDestVipArgs> SecondaryDestVips
        {
            get => _secondaryDestVips ?? (_secondaryDestVips = new InputList<Inputs.TrafficForwardingGRETunnelSecondaryDestVipArgs>());
            set => _secondaryDestVips = value;
        }

        /// <summary>
        /// The source IP address of the GRE tunnel. This is typically a static IP address in the organization or SD-WAN. This IP address must be provisioned within the Zscaler service using the /staticIP endpoint.
        /// </summary>
        [Input("sourceIp", required: true)]
        public Input<string> SourceIp { get; set; } = null!;

        /// <summary>
        /// Restrict the data center virtual IP addresses (VIPs) only to those within the same country as the source IP address
        /// </summary>
        [Input("withinCountry")]
        public Input<bool>? WithinCountry { get; set; }

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

    public sealed class TrafficForwardingGRETunnelState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Additional information about this GRE tunnel
        /// </summary>
        [Input("comment")]
        public Input<string>? Comment { get; set; }

        /// <summary>
        /// When within_country is enabled, you must set this to the country code.
        /// </summary>
        [Input("countryCode")]
        public Input<string>? CountryCode { get; set; }

        /// <summary>
        /// The start of the internal IP address in /29 CIDR range. Automatically set by the provider if `ip_unnumbered` is set to `false`.
        /// </summary>
        [Input("internalIpRange")]
        public Input<string>? InternalIpRange { get; set; }

        /// <summary>
        /// This is required to support the automated SD-WAN provisioning of GRE tunnels, when set to true gre_tun_ip and gre_tun_id are set to null
        /// </summary>
        [Input("ipUnnumbered")]
        public Input<bool>? IpUnnumbered { get; set; }

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

        [Input("lastModifiedBies")]
        private InputList<Inputs.TrafficForwardingGRETunnelLastModifiedByGetArgs>? _lastModifiedBies;
        public InputList<Inputs.TrafficForwardingGRETunnelLastModifiedByGetArgs> LastModifiedBies
        {
            get => _lastModifiedBies ?? (_lastModifiedBies = new InputList<Inputs.TrafficForwardingGRETunnelLastModifiedByGetArgs>());
            set => _lastModifiedBies = value;
        }

        [Input("primaryDestVips")]
        private InputList<Inputs.TrafficForwardingGRETunnelPrimaryDestVipGetArgs>? _primaryDestVips;

        /// <summary>
        /// **` (Optional) The primary destination data center and virtual IP address (VIP) of the GRE tunnel.
        /// </summary>
        public InputList<Inputs.TrafficForwardingGRETunnelPrimaryDestVipGetArgs> PrimaryDestVips
        {
            get => _primaryDestVips ?? (_primaryDestVips = new InputList<Inputs.TrafficForwardingGRETunnelPrimaryDestVipGetArgs>());
            set => _primaryDestVips = value;
        }

        [Input("secondaryDestVips")]
        private InputList<Inputs.TrafficForwardingGRETunnelSecondaryDestVipGetArgs>? _secondaryDestVips;

        /// <summary>
        /// The secondary destination data center and virtual IP address (VIP) of the GRE tunnel.
        /// </summary>
        public InputList<Inputs.TrafficForwardingGRETunnelSecondaryDestVipGetArgs> SecondaryDestVips
        {
            get => _secondaryDestVips ?? (_secondaryDestVips = new InputList<Inputs.TrafficForwardingGRETunnelSecondaryDestVipGetArgs>());
            set => _secondaryDestVips = value;
        }

        /// <summary>
        /// The source IP address of the GRE tunnel. This is typically a static IP address in the organization or SD-WAN. This IP address must be provisioned within the Zscaler service using the /staticIP endpoint.
        /// </summary>
        [Input("sourceIp")]
        public Input<string>? SourceIp { get; set; }

        /// <summary>
        /// The ID of the GRE tunnel.
        /// </summary>
        [Input("tunnelId")]
        public Input<int>? TunnelId { get; set; }

        /// <summary>
        /// Restrict the data center virtual IP addresses (VIPs) only to those within the same country as the source IP address
        /// </summary>
        [Input("withinCountry")]
        public Input<bool>? WithinCountry { get; set; }

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