// *** 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.Zpa.ServerGroup
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zpa = zscaler.PulumiPackage.Zpa;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create a App Connector Group
    ///     var exampleConnectorGroup = new Zpa.AppConnectorGroup.ConnectorGroup("exampleConnectorGroup", new()
    ///     {
    ///         Description = "Example",
    ///         Enabled = true,
    ///         CityCountry = "San Jose, CA",
    ///         CountryCode = "US",
    ///         Latitude = "37.338",
    ///         Longitude = "-121.8863",
    ///         Location = "San Jose, CA, US",
    ///         UpgradeDay = "SUNDAY",
    ///         UpgradeTimeInSecs = "66600",
    ///         OverrideVersionProfile = true,
    ///         VersionProfileId = "0",
    ///         DnsQueryType = "IPV4",
    ///     });
    /// 
    ///     // Create a Server Group resource with Dynamic Discovery Enabled
    ///     var exampleServerGroup = new Zpa.ServerGroup.ServerGroup("exampleServerGroup", new()
    ///     {
    ///         Description = "Example",
    ///         Enabled = true,
    ///         DynamicDiscovery = true,
    ///         AppConnectorGroups = new[]
    ///         {
    ///             new Zpa.ServerGroup.Inputs.ServerGroupAppConnectorGroupArgs
    ///             {
    ///                 Ids = new[]
    ///                 {
    ///                     exampleConnectorGroup.Id,
    ///                 },
    ///             },
    ///         },
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             exampleConnectorGroup,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zpa = zscaler.PulumiPackage.Zpa;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an application server
    ///     var exampleApplicationServer = new Zpa.ApplicationServer.ApplicationServer("exampleApplicationServer", new()
    ///     {
    ///         Description = "Example",
    ///         Address = "server.example.com",
    ///         Enabled = true,
    ///     });
    /// 
    ///     // Create a App Connector Group
    ///     var exampleConnectorGroup = new Zpa.AppConnectorGroup.ConnectorGroup("exampleConnectorGroup", new()
    ///     {
    ///         Description = "Example",
    ///         Enabled = true,
    ///         CityCountry = "San Jose, CA",
    ///         CountryCode = "US",
    ///         Latitude = "37.338",
    ///         Longitude = "-121.8863",
    ///         Location = "San Jose, CA, US",
    ///         UpgradeDay = "SUNDAY",
    ///         UpgradeTimeInSecs = "66600",
    ///         OverrideVersionProfile = true,
    ///         VersionProfileId = "0",
    ///         DnsQueryType = "IPV4",
    ///     });
    /// 
    ///     // ZPA Server Group resource with Dynamic Discovery Disabled
    ///     var exampleServerGroup = new Zpa.ServerGroup.ServerGroup("exampleServerGroup", new()
    ///     {
    ///         Description = "Example",
    ///         Enabled = true,
    ///         DynamicDiscovery = false,
    ///         Servers = new[]
    ///         {
    ///             new Zpa.ServerGroup.Inputs.ServerGroupServerArgs
    ///             {
    ///                 Ids = new[]
    ///                 {
    ///                     exampleApplicationServer.Id,
    ///                 },
    ///             },
    ///         },
    ///         AppConnectorGroups = new[]
    ///         {
    ///             new Zpa.ServerGroup.Inputs.ServerGroupAppConnectorGroupArgs
    ///             {
    ///                 Ids = new[]
    ///                 {
    ///                     exampleConnectorGroup.Id,
    ///                 },
    ///             },
    ///         },
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             exampleConnectorGroup,
    ///             zpa_application_server.Server,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// ### Required
    /// 
    /// * `name` - (Required) This field defines the name of the server group.
    /// * `app_connector_groups` - (Required)
    ///   * `id` - (Required) The ID of this resource.
    /// 
    /// ## Import
    /// 
    /// Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZPA configurations into Terraform-compliant HashiCorp Configuration Language. [Visit](https://github.com/zscaler/zscaler-terraformer) Server Groups can be imported; use `&lt;SERVER GROUP ID&gt;` or `&lt;SERVER GROUP NAME&gt;` as the import ID. For example
    /// 
    /// ```sh
    ///  $ pulumi import zpa:ServerGroup/serverGroup:ServerGroup example &lt;server_group_id&gt;
    /// ```
    /// 
    ///  or
    /// 
    /// ```sh
    ///  $ pulumi import zpa:ServerGroup/serverGroup:ServerGroup example &lt;server_group_name&gt;
    /// ```
    /// </summary>
    [ZpaResourceType("zpa:ServerGroup/serverGroup:ServerGroup")]
    public partial class ServerGroup : global::Pulumi.CustomResource
    {
        /// <summary>
        /// List of app-connector IDs.
        /// </summary>
        [Output("appConnectorGroups")]
        public Output<ImmutableArray<Outputs.ServerGroupAppConnectorGroup>> AppConnectorGroups { get; private set; } = null!;

        /// <summary>
        /// This field is a json array of app-connector-id only.
        /// </summary>
        [Output("applications")]
        public Output<ImmutableArray<Outputs.ServerGroupApplication>> Applications { get; private set; } = null!;

        [Output("configSpace")]
        public Output<string?> ConfigSpace { get; private set; } = null!;

        /// <summary>
        /// (Optional) This field is the description of the server group.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// (Optional) This field controls dynamic discovery of the servers.
        /// </summary>
        [Output("dynamicDiscovery")]
        public Output<bool?> DynamicDiscovery { get; private set; } = null!;

        /// <summary>
        /// (Optional) This field defines if the server group is enabled or disabled.
        /// </summary>
        [Output("enabled")]
        public Output<bool?> Enabled { get; private set; } = null!;

        [Output("ipAnchored")]
        public Output<bool?> IpAnchored { get; private set; } = null!;

        /// <summary>
        /// This field defines the name of the server group.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// (Block List) This field is a list of servers that are applicable only when dynamic discovery is disabled. Server name is required only in cases where the new servers need to be created in this API.
        /// </summary>
        [Output("servers")]
        public Output<ImmutableArray<Outputs.ServerGroupServer>> Servers { get; private set; } = null!;


        /// <summary>
        /// Create a ServerGroup 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 ServerGroup(string name, ServerGroupArgs? args = null, CustomResourceOptions? options = null)
            : base("zpa:ServerGroup/serverGroup:ServerGroup", name, args ?? new ServerGroupArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ServerGroup(string name, Input<string> id, ServerGroupState? state = null, CustomResourceOptions? options = null)
            : base("zpa:ServerGroup/serverGroup:ServerGroup", 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 ServerGroup 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 ServerGroup Get(string name, Input<string> id, ServerGroupState? state = null, CustomResourceOptions? options = null)
        {
            return new ServerGroup(name, id, state, options);
        }
    }

    public sealed class ServerGroupArgs : global::Pulumi.ResourceArgs
    {
        [Input("appConnectorGroups")]
        private InputList<Inputs.ServerGroupAppConnectorGroupArgs>? _appConnectorGroups;

        /// <summary>
        /// List of app-connector IDs.
        /// </summary>
        public InputList<Inputs.ServerGroupAppConnectorGroupArgs> AppConnectorGroups
        {
            get => _appConnectorGroups ?? (_appConnectorGroups = new InputList<Inputs.ServerGroupAppConnectorGroupArgs>());
            set => _appConnectorGroups = value;
        }

        [Input("applications")]
        private InputList<Inputs.ServerGroupApplicationArgs>? _applications;

        /// <summary>
        /// This field is a json array of app-connector-id only.
        /// </summary>
        public InputList<Inputs.ServerGroupApplicationArgs> Applications
        {
            get => _applications ?? (_applications = new InputList<Inputs.ServerGroupApplicationArgs>());
            set => _applications = value;
        }

        [Input("configSpace")]
        public Input<string>? ConfigSpace { get; set; }

        /// <summary>
        /// (Optional) This field is the description of the server group.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// (Optional) This field controls dynamic discovery of the servers.
        /// </summary>
        [Input("dynamicDiscovery")]
        public Input<bool>? DynamicDiscovery { get; set; }

        /// <summary>
        /// (Optional) This field defines if the server group is enabled or disabled.
        /// </summary>
        [Input("enabled")]
        public Input<bool>? Enabled { get; set; }

        [Input("ipAnchored")]
        public Input<bool>? IpAnchored { get; set; }

        /// <summary>
        /// This field defines the name of the server group.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("servers")]
        private InputList<Inputs.ServerGroupServerArgs>? _servers;

        /// <summary>
        /// (Block List) This field is a list of servers that are applicable only when dynamic discovery is disabled. Server name is required only in cases where the new servers need to be created in this API.
        /// </summary>
        public InputList<Inputs.ServerGroupServerArgs> Servers
        {
            get => _servers ?? (_servers = new InputList<Inputs.ServerGroupServerArgs>());
            set => _servers = value;
        }

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

    public sealed class ServerGroupState : global::Pulumi.ResourceArgs
    {
        [Input("appConnectorGroups")]
        private InputList<Inputs.ServerGroupAppConnectorGroupGetArgs>? _appConnectorGroups;

        /// <summary>
        /// List of app-connector IDs.
        /// </summary>
        public InputList<Inputs.ServerGroupAppConnectorGroupGetArgs> AppConnectorGroups
        {
            get => _appConnectorGroups ?? (_appConnectorGroups = new InputList<Inputs.ServerGroupAppConnectorGroupGetArgs>());
            set => _appConnectorGroups = value;
        }

        [Input("applications")]
        private InputList<Inputs.ServerGroupApplicationGetArgs>? _applications;

        /// <summary>
        /// This field is a json array of app-connector-id only.
        /// </summary>
        public InputList<Inputs.ServerGroupApplicationGetArgs> Applications
        {
            get => _applications ?? (_applications = new InputList<Inputs.ServerGroupApplicationGetArgs>());
            set => _applications = value;
        }

        [Input("configSpace")]
        public Input<string>? ConfigSpace { get; set; }

        /// <summary>
        /// (Optional) This field is the description of the server group.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// (Optional) This field controls dynamic discovery of the servers.
        /// </summary>
        [Input("dynamicDiscovery")]
        public Input<bool>? DynamicDiscovery { get; set; }

        /// <summary>
        /// (Optional) This field defines if the server group is enabled or disabled.
        /// </summary>
        [Input("enabled")]
        public Input<bool>? Enabled { get; set; }

        [Input("ipAnchored")]
        public Input<bool>? IpAnchored { get; set; }

        /// <summary>
        /// This field defines the name of the server group.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("servers")]
        private InputList<Inputs.ServerGroupServerGetArgs>? _servers;

        /// <summary>
        /// (Block List) This field is a list of servers that are applicable only when dynamic discovery is disabled. Server name is required only in cases where the new servers need to be created in this API.
        /// </summary>
        public InputList<Inputs.ServerGroupServerGetArgs> Servers
        {
            get => _servers ?? (_servers = new InputList<Inputs.ServerGroupServerGetArgs>());
            set => _servers = value;
        }

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