// *** 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.AliCloud
{
    public static class GetZones
    {
        /// <summary>
        /// This data source provides availability zones that can be accessed by an Alibaba Cloud account within the region configured in the provider.
        /// 
        /// 
        /// &gt; **NOTE:** If one zone is sold out, it will not be exported.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var zonesDs = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableDiskCategory = "cloud_ssd",
        ///         AvailableInstanceType = "ecs.n4.large",
        ///     });
        /// 
        ///     // Create an ECS instance with the first matched zone
        ///     var instance = new AliCloud.Ecs.Instance("instance", new()
        ///     {
        ///         AvailabilityZone = zonesDs.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetZonesResult> InvokeAsync(GetZonesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetZonesResult>("alicloud:index/getZones:getZones", args ?? new GetZonesArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides availability zones that can be accessed by an Alibaba Cloud account within the region configured in the provider.
        /// 
        /// 
        /// &gt; **NOTE:** If one zone is sold out, it will not be exported.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var zonesDs = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableDiskCategory = "cloud_ssd",
        ///         AvailableInstanceType = "ecs.n4.large",
        ///     });
        /// 
        ///     // Create an ECS instance with the first matched zone
        ///     var instance = new AliCloud.Ecs.Instance("instance", new()
        ///     {
        ///         AvailabilityZone = zonesDs.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetZonesResult> Invoke(GetZonesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetZonesResult>("alicloud:index/getZones:getZones", args ?? new GetZonesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetZonesArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Filter the results by a specific disk category. Can be either `cloud`, `cloud_efficiency`, `cloud_ssd`, `ephemeral_ssd`.
        /// </summary>
        [Input("availableDiskCategory")]
        public string? AvailableDiskCategory { get; set; }

        /// <summary>
        /// Filter the results by a specific instance type.
        /// </summary>
        [Input("availableInstanceType")]
        public string? AvailableInstanceType { get; set; }

        /// <summary>
        /// Filter the results by a specific resource type.
        /// Valid values: `Instance`, `Disk`, `VSwitch`, `Rds`, `KVStore`, `FunctionCompute`, `Elasticsearch`, `Slb`.
        /// </summary>
        [Input("availableResourceCreation")]
        public string? AvailableResourceCreation { get; set; }

        /// <summary>
        /// Filter the results by a slb instance address version. Can be either `ipv4`, or `ipv6`.
        /// </summary>
        [Input("availableSlbAddressIpVersion")]
        public string? AvailableSlbAddressIpVersion { get; set; }

        /// <summary>
        /// Filter the results by a slb instance address type. Can be either `Vpc`, `classic_internet` or `classic_intranet`
        /// </summary>
        [Input("availableSlbAddressType")]
        public string? AvailableSlbAddressType { get; set; }

        /// <summary>
        /// Default to false and only output `id` in the `zones` block. Set it to true can output more details.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        /// <summary>
        /// Filter the results by a specific ECS instance charge type. Valid values: `PrePaid` and `PostPaid`. Default to `PostPaid`.
        /// </summary>
        [Input("instanceChargeType")]
        public string? InstanceChargeType { get; set; }

        /// <summary>
        /// Indicate whether the zones can be used in a multi AZ configuration. Default to `false`. Multi AZ is usually used to launch RDS instances.
        /// </summary>
        [Input("multi")]
        public bool? Multi { get; set; }

        /// <summary>
        /// Filter the results by a specific network type. Valid values: `Classic` and `Vpc`.
        /// </summary>
        [Input("networkType")]
        public string? NetworkType { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// - (Optional) Filter the results by a specific ECS spot type. Valid values: `NoSpot`, `SpotWithPriceLimit` and `SpotAsPriceGo`. Default to `NoSpot`.
        /// </summary>
        [Input("spotStrategy")]
        public string? SpotStrategy { get; set; }

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

    public sealed class GetZonesInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Filter the results by a specific disk category. Can be either `cloud`, `cloud_efficiency`, `cloud_ssd`, `ephemeral_ssd`.
        /// </summary>
        [Input("availableDiskCategory")]
        public Input<string>? AvailableDiskCategory { get; set; }

        /// <summary>
        /// Filter the results by a specific instance type.
        /// </summary>
        [Input("availableInstanceType")]
        public Input<string>? AvailableInstanceType { get; set; }

        /// <summary>
        /// Filter the results by a specific resource type.
        /// Valid values: `Instance`, `Disk`, `VSwitch`, `Rds`, `KVStore`, `FunctionCompute`, `Elasticsearch`, `Slb`.
        /// </summary>
        [Input("availableResourceCreation")]
        public Input<string>? AvailableResourceCreation { get; set; }

        /// <summary>
        /// Filter the results by a slb instance address version. Can be either `ipv4`, or `ipv6`.
        /// </summary>
        [Input("availableSlbAddressIpVersion")]
        public Input<string>? AvailableSlbAddressIpVersion { get; set; }

        /// <summary>
        /// Filter the results by a slb instance address type. Can be either `Vpc`, `classic_internet` or `classic_intranet`
        /// </summary>
        [Input("availableSlbAddressType")]
        public Input<string>? AvailableSlbAddressType { get; set; }

        /// <summary>
        /// Default to false and only output `id` in the `zones` block. Set it to true can output more details.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        /// <summary>
        /// Filter the results by a specific ECS instance charge type. Valid values: `PrePaid` and `PostPaid`. Default to `PostPaid`.
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        /// <summary>
        /// Indicate whether the zones can be used in a multi AZ configuration. Default to `false`. Multi AZ is usually used to launch RDS instances.
        /// </summary>
        [Input("multi")]
        public Input<bool>? Multi { get; set; }

        /// <summary>
        /// Filter the results by a specific network type. Valid values: `Classic` and `Vpc`.
        /// </summary>
        [Input("networkType")]
        public Input<string>? NetworkType { get; set; }

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

        /// <summary>
        /// - (Optional) Filter the results by a specific ECS spot type. Valid values: `NoSpot`, `SpotWithPriceLimit` and `SpotAsPriceGo`. Default to `NoSpot`.
        /// </summary>
        [Input("spotStrategy")]
        public Input<string>? SpotStrategy { get; set; }

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


    [OutputType]
    public sealed class GetZonesResult
    {
        public readonly string? AvailableDiskCategory;
        public readonly string? AvailableInstanceType;
        /// <summary>
        /// Type of resources that can be created.
        /// </summary>
        public readonly string? AvailableResourceCreation;
        public readonly string? AvailableSlbAddressIpVersion;
        public readonly string? AvailableSlbAddressType;
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of zone IDs.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        public readonly string? InstanceChargeType;
        public readonly bool? Multi;
        public readonly string? NetworkType;
        public readonly string? OutputFile;
        public readonly string? SpotStrategy;
        /// <summary>
        /// A list of availability zones. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetZonesZoneResult> Zones;

        [OutputConstructor]
        private GetZonesResult(
            string? availableDiskCategory,

            string? availableInstanceType,

            string? availableResourceCreation,

            string? availableSlbAddressIpVersion,

            string? availableSlbAddressType,

            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            string? instanceChargeType,

            bool? multi,

            string? networkType,

            string? outputFile,

            string? spotStrategy,

            ImmutableArray<Outputs.GetZonesZoneResult> zones)
        {
            AvailableDiskCategory = availableDiskCategory;
            AvailableInstanceType = availableInstanceType;
            AvailableResourceCreation = availableResourceCreation;
            AvailableSlbAddressIpVersion = availableSlbAddressIpVersion;
            AvailableSlbAddressType = availableSlbAddressType;
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            InstanceChargeType = instanceChargeType;
            Multi = multi;
            NetworkType = networkType;
            OutputFile = outputFile;
            SpotStrategy = spotStrategy;
            Zones = zones;
        }
    }
}
