<filename>sdk/dotnet/PolarDB/GlobalDatabaseNetwork.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;

namespace Pulumi.AliCloud.PolarDB
{
    /// <summary>
    /// Provides a PolarDB Global Database Network resource.
    /// 
    /// For information about PolarDB Global Database Network and how to use it, see [What is Global Database Network](https://www.alibabacloud.com/help/en/polardb-for-mysql/latest/createglobaldatabasenetwork).
    /// 
    /// &gt; **NOTE:** Available in v1.181.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
    ///     {
    ///         NameRegex = "default-NODELETING",
    ///     });
    /// 
    ///     var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
    ///     {
    ///         VpcId = defaultNetworks.Apply(getNetworksResult =&gt; getNetworksResult.Ids[0]),
    ///     });
    /// 
    ///     var defaultNodeClasses = AliCloud.PolarDB.GetNodeClasses.Invoke(new()
    ///     {
    ///         ZoneId = defaultSwitches.Apply(getSwitchesResult =&gt; getSwitchesResult.Vswitches[0]?.ZoneId),
    ///         PayType = "PostPaid",
    ///         DbType = "MySQL",
    ///         DbVersion = "8.0",
    ///     });
    /// 
    ///     var defaultCluster = new AliCloud.PolarDB.Cluster("defaultCluster", new()
    ///     {
    ///         DbType = "MySQL",
    ///         DbVersion = "8.0",
    ///         PayType = "PostPaid",
    ///         DbNodeClass = defaultNodeClasses.Apply(getNodeClassesResult =&gt; getNodeClassesResult.Classes[0]?.SupportedEngines[0]?.AvailableResources[0]?.DbNodeClass),
    ///         VswitchId = defaultSwitches.Apply(getSwitchesResult =&gt; getSwitchesResult.Ids[0]),
    ///         Description = "example_value",
    ///     });
    /// 
    ///     var defaultGlobalDatabaseNetwork = new AliCloud.PolarDB.GlobalDatabaseNetwork("defaultGlobalDatabaseNetwork", new()
    ///     {
    ///         DbClusterId = defaultCluster.Id,
    ///         Description = "example_value",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// PolarDB Global Database Network can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:polardb/globalDatabaseNetwork:GlobalDatabaseNetwork example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:polardb/globalDatabaseNetwork:GlobalDatabaseNetwork")]
    public partial class GlobalDatabaseNetwork : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of the primary cluster.
        /// </summary>
        [Output("dbClusterId")]
        public Output<string> DbClusterId { get; private set; } = null!;

        /// <summary>
        /// The description of the Global Database Network.
        /// </summary>
        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        /// <summary>
        /// The status of the Global Database Network.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;


        /// <summary>
        /// Create a GlobalDatabaseNetwork 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 GlobalDatabaseNetwork(string name, GlobalDatabaseNetworkArgs args, CustomResourceOptions? options = null)
            : base("alicloud:polardb/globalDatabaseNetwork:GlobalDatabaseNetwork", name, args ?? new GlobalDatabaseNetworkArgs(), MakeResourceOptions(options, ""))
        {
        }

        private GlobalDatabaseNetwork(string name, Input<string> id, GlobalDatabaseNetworkState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:polardb/globalDatabaseNetwork:GlobalDatabaseNetwork", 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/rhysmdnz/pulumi-alicloud",
            };
            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 GlobalDatabaseNetwork 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 GlobalDatabaseNetwork Get(string name, Input<string> id, GlobalDatabaseNetworkState? state = null, CustomResourceOptions? options = null)
        {
            return new GlobalDatabaseNetwork(name, id, state, options);
        }
    }

    public sealed class GlobalDatabaseNetworkArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the primary cluster.
        /// </summary>
        [Input("dbClusterId", required: true)]
        public Input<string> DbClusterId { get; set; } = null!;

        /// <summary>
        /// The description of the Global Database Network.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

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

    public sealed class GlobalDatabaseNetworkState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the primary cluster.
        /// </summary>
        [Input("dbClusterId")]
        public Input<string>? DbClusterId { get; set; }

        /// <summary>
        /// The description of the Global Database Network.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The status of the Global Database Network.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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