// *** 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.Yandex
{
    /// <summary>
    /// Manages a MySQL database within the Yandex.Cloud. For more information, see
    /// [the official documentation](https://cloud.yandex.com/docs/managed-mysql/).
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Yandex = Pulumi.Yandex;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var fooVpcNetwork = new Yandex.VpcNetwork("fooVpcNetwork");
    /// 
    ///     var fooVpcSubnet = new Yandex.VpcSubnet("fooVpcSubnet", new()
    ///     {
    ///         Zone = "ru-central1-a",
    ///         NetworkId = fooVpcNetwork.Id,
    ///         V4CidrBlocks = new[]
    ///         {
    ///             "10.5.0.0/24",
    ///         },
    ///     });
    /// 
    ///     var fooMdbMysqlCluster = new Yandex.MdbMysqlCluster("fooMdbMysqlCluster", new()
    ///     {
    ///         Environment = "PRESTABLE",
    ///         NetworkId = fooVpcNetwork.Id,
    ///         Version = "8.0",
    ///         Resources = new Yandex.Inputs.MdbMysqlClusterResourcesArgs
    ///         {
    ///             ResourcePresetId = "s2.micro",
    ///             DiskTypeId = "network-ssd",
    ///             DiskSize = 16,
    ///         },
    ///         Hosts = new[]
    ///         {
    ///             new Yandex.Inputs.MdbMysqlClusterHostArgs
    ///             {
    ///                 Zone = "ru-central1-a",
    ///                 SubnetId = fooVpcSubnet.Id,
    ///             },
    ///         },
    ///     });
    /// 
    ///     var foomdbMysqlDatabase = new Yandex.MdbMysqlDatabase("foomdbMysqlDatabase", new()
    ///     {
    ///         ClusterId = fooMdbMysqlCluster.Id,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// A MySQL database can be imported using the following format
    /// 
    /// ```sh
    ///  $ pulumi import yandex:index/mdbMysqlDatabase:mdbMysqlDatabase foo {{cluster_id}}:{{database_name}}
    /// ```
    /// </summary>
    [YandexResourceType("yandex:index/mdbMysqlDatabase:mdbMysqlDatabase")]
    public partial class MdbMysqlDatabase : global::Pulumi.CustomResource
    {
        [Output("clusterId")]
        public Output<string> ClusterId { get; private set; } = null!;

        /// <summary>
        /// The name of the database.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;


        /// <summary>
        /// Create a MdbMysqlDatabase 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 MdbMysqlDatabase(string name, MdbMysqlDatabaseArgs args, CustomResourceOptions? options = null)
            : base("yandex:index/mdbMysqlDatabase:mdbMysqlDatabase", name, args ?? new MdbMysqlDatabaseArgs(), MakeResourceOptions(options, ""))
        {
        }

        private MdbMysqlDatabase(string name, Input<string> id, MdbMysqlDatabaseState? state = null, CustomResourceOptions? options = null)
            : base("yandex:index/mdbMysqlDatabase:mdbMysqlDatabase", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/regrau/pulumi-yandex/releases",
            };
            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 MdbMysqlDatabase 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 MdbMysqlDatabase Get(string name, Input<string> id, MdbMysqlDatabaseState? state = null, CustomResourceOptions? options = null)
        {
            return new MdbMysqlDatabase(name, id, state, options);
        }
    }

    public sealed class MdbMysqlDatabaseArgs : global::Pulumi.ResourceArgs
    {
        [Input("clusterId", required: true)]
        public Input<string> ClusterId { get; set; } = null!;

        /// <summary>
        /// The name of the database.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

    public sealed class MdbMysqlDatabaseState : global::Pulumi.ResourceArgs
    {
        [Input("clusterId")]
        public Input<string>? ClusterId { get; set; }

        /// <summary>
        /// The name of the database.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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