<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<gh_stars>0// *** 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.PolarDB
{
    public static class GetEndpoints
    {
        /// <summary>
        /// The `alicloud.polardb.getEndpoints` data source provides a collection of PolarDB endpoints available in Alibaba Cloud account.
        /// Filters support regular expression for the cluster name, searches by clusterId, and other filters which are listed below.
        /// 
        /// &gt; **NOTE:** Available in v1.68.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var polardbClustersDs = AliCloud.PolarDB.GetClusters.Invoke(new()
        ///     {
        ///         DescriptionRegex = "pc-\\w+",
        ///         Status = "Running",
        ///     });
        /// 
        ///     var @default = AliCloud.PolarDB.GetEndpoints.Invoke(new()
        ///     {
        ///         DbClusterId = polardbClustersDs.Apply(getClustersResult =&gt; getClustersResult.Clusters[0]?.Id),
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["endpoint"] = @default.Apply(getEndpointsResult =&gt; getEndpointsResult).Apply(@default =&gt; @default.Apply(getEndpointsResult =&gt; getEndpointsResult.Endpoints[0]?.DbEndpointId)),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetEndpointsResult> InvokeAsync(GetEndpointsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetEndpointsResult>("alicloud:polardb/getEndpoints:getEndpoints", args ?? new GetEndpointsArgs(), options.WithDefaults());

        /// <summary>
        /// The `alicloud.polardb.getEndpoints` data source provides a collection of PolarDB endpoints available in Alibaba Cloud account.
        /// Filters support regular expression for the cluster name, searches by clusterId, and other filters which are listed below.
        /// 
        /// &gt; **NOTE:** Available in v1.68.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var polardbClustersDs = AliCloud.PolarDB.GetClusters.Invoke(new()
        ///     {
        ///         DescriptionRegex = "pc-\\w+",
        ///         Status = "Running",
        ///     });
        /// 
        ///     var @default = AliCloud.PolarDB.GetEndpoints.Invoke(new()
        ///     {
        ///         DbClusterId = polardbClustersDs.Apply(getClustersResult =&gt; getClustersResult.Clusters[0]?.Id),
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["endpoint"] = @default.Apply(getEndpointsResult =&gt; getEndpointsResult).Apply(@default =&gt; @default.Apply(getEndpointsResult =&gt; getEndpointsResult.Endpoints[0]?.DbEndpointId)),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetEndpointsResult> Invoke(GetEndpointsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetEndpointsResult>("alicloud:polardb/getEndpoints:getEndpoints", args ?? new GetEndpointsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetEndpointsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// PolarDB cluster ID.
        /// </summary>
        [Input("dbClusterId", required: true)]
        public string DbClusterId { get; set; } = null!;

        /// <summary>
        /// endpoint of the cluster.
        /// </summary>
        [Input("dbEndpointId")]
        public string? DbEndpointId { get; set; }

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

    public sealed class GetEndpointsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// PolarDB cluster ID.
        /// </summary>
        [Input("dbClusterId", required: true)]
        public Input<string> DbClusterId { get; set; } = null!;

        /// <summary>
        /// endpoint of the cluster.
        /// </summary>
        [Input("dbEndpointId")]
        public Input<string>? DbEndpointId { get; set; }

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


    [OutputType]
    public sealed class GetEndpointsResult
    {
        public readonly string DbClusterId;
        /// <summary>
        /// The endpoint ID.
        /// </summary>
        public readonly string? DbEndpointId;
        /// <summary>
        /// A list of PolarDB cluster endpoints. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetEndpointsEndpointResult> Endpoints;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;

        [OutputConstructor]
        private GetEndpointsResult(
            string dbClusterId,

            string? dbEndpointId,

            ImmutableArray<Outputs.GetEndpointsEndpointResult> endpoints,

            string id)
        {
            DbClusterId = dbClusterId;
            DbEndpointId = dbEndpointId;
            Endpoints = endpoints;
            Id = id;
        }
    }
}
