<filename>sdk/dotnet/Ovh/CloudProjectDatabase/GetDatabaseInstance.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 Lbrlabs.PulumiPackage.Ovh.CloudProjectDatabase
{
    public static class GetDatabaseInstance
    {
        /// <summary>
        /// Use this data source to get information about a database of a database cluster associated with a public cloud project.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Ovh = Pulumi.Ovh;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var database = Ovh.CloudProjectDatabase.GetDatabaseInstance.Invoke(new()
        ///     {
        ///         ServiceName = "XXX",
        ///         Engine = "YYY",
        ///         ClusterId = "ZZZ",
        ///         Name = "UUU",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["databaseName"] = database.Apply(getDatabaseInstanceResult =&gt; getDatabaseInstanceResult.Name),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetDatabaseInstanceResult> InvokeAsync(GetDatabaseInstanceArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetDatabaseInstanceResult>("ovh:CloudProjectDatabase/getDatabaseInstance:getDatabaseInstance", args ?? new GetDatabaseInstanceArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to get information about a database of a database cluster associated with a public cloud project.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Ovh = Pulumi.Ovh;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var database = Ovh.CloudProjectDatabase.GetDatabaseInstance.Invoke(new()
        ///     {
        ///         ServiceName = "XXX",
        ///         Engine = "YYY",
        ///         ClusterId = "ZZZ",
        ///         Name = "UUU",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["databaseName"] = database.Apply(getDatabaseInstanceResult =&gt; getDatabaseInstanceResult.Name),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetDatabaseInstanceResult> Invoke(GetDatabaseInstanceInvokeArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetDatabaseInstanceResult>("ovh:CloudProjectDatabase/getDatabaseInstance:getDatabaseInstance", args ?? new GetDatabaseInstanceInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetDatabaseInstanceArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Cluster ID
        /// </summary>
        [Input("clusterId", required: true)]
        public string ClusterId { get; set; } = null!;

        /// <summary>
        /// The engine of the database cluster you want database information. To get a full list of available engine visit:
        /// [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases).
        /// Available engines:
        /// </summary>
        [Input("engine", required: true)]
        public string Engine { get; set; } = null!;

        /// <summary>
        /// Name of the database.
        /// </summary>
        [Input("name", required: true)]
        public string Name { get; set; } = null!;

        /// <summary>
        /// The id of the public cloud project. If omitted,
        /// the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
        /// </summary>
        [Input("serviceName", required: true)]
        public string ServiceName { get; set; } = null!;

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

    public sealed class GetDatabaseInstanceInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Cluster ID
        /// </summary>
        [Input("clusterId", required: true)]
        public Input<string> ClusterId { get; set; } = null!;

        /// <summary>
        /// The engine of the database cluster you want database information. To get a full list of available engine visit:
        /// [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases).
        /// Available engines:
        /// </summary>
        [Input("engine", required: true)]
        public Input<string> Engine { get; set; } = null!;

        /// <summary>
        /// Name of the database.
        /// </summary>
        [Input("name", required: true)]
        public Input<string> Name { get; set; } = null!;

        /// <summary>
        /// The id of the public cloud project. If omitted,
        /// the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
        /// </summary>
        [Input("serviceName", required: true)]
        public Input<string> ServiceName { get; set; } = null!;

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


    [OutputType]
    public sealed class GetDatabaseInstanceResult
    {
        /// <summary>
        /// See Argument Reference above.
        /// </summary>
        public readonly string ClusterId;
        /// <summary>
        /// Defines if the database has been created by default.
        /// </summary>
        public readonly bool Default;
        /// <summary>
        /// See Argument Reference above.
        /// </summary>
        public readonly string Engine;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Name of the database.
        /// </summary>
        public readonly string Name;
        /// <summary>
        /// Current status of the database.
        /// </summary>
        public readonly string ServiceName;

        [OutputConstructor]
        private GetDatabaseInstanceResult(
            string clusterId,

            bool @default,

            string engine,

            string id,

            string name,

            string serviceName)
        {
            ClusterId = clusterId;
            Default = @default;
            Engine = engine;
            Id = id;
            Name = name;
            ServiceName = serviceName;
        }
    }
}
