// *** 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 PiersKarsenbarg.Sdm
{
    public static class GetResource
    {
        /// <summary>
        /// A Resource is a database, server, cluster, website, or cloud that strongDM
        ///  delegates access to.
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Sdm = Pulumi.Sdm;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var mysqlDatasources = Sdm.GetResource.Invoke(new()
        ///     {
        ///         Name = "us-west*",
        ///         Tags = 
        ///         {
        ///             { "env", "dev" },
        ///             { "region", "us-west" },
        ///         },
        ///         Type = "mysql",
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetResourceResult> InvokeAsync(GetResourceArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetResourceResult>("sdm:index/getResource:getResource", args ?? new GetResourceArgs(), options.WithDefaults());

        /// <summary>
        /// A Resource is a database, server, cluster, website, or cloud that strongDM
        ///  delegates access to.
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Sdm = Pulumi.Sdm;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var mysqlDatasources = Sdm.GetResource.Invoke(new()
        ///     {
        ///         Name = "us-west*",
        ///         Tags = 
        ///         {
        ///             { "env", "dev" },
        ///             { "region", "us-west" },
        ///         },
        ///         Type = "mysql",
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetResourceResult> Invoke(GetResourceInvokeArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetResourceResult>("sdm:index/getResource:getResource", args ?? new GetResourceInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetResourceArgs : global::Pulumi.InvokeArgs
    {
        [Input("hostname")]
        public string? Hostname { get; set; }

        /// <summary>
        /// Unique identifier of the Resource.
        /// </summary>
        [Input("id")]
        public string? Id { get; set; }

        /// <summary>
        /// Unique human-readable name of the Resource.
        /// </summary>
        [Input("name")]
        public string? Name { get; set; }

        [Input("port")]
        public int? Port { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// Tags is a map of key, value pairs.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

        /// <summary>
        /// a filter to select all items of a certain subtype. See the [filter documentation](https://www.strongdm.com/docs/automation/getting-started/filters for more information.
        /// </summary>
        [Input("type")]
        public string? Type { get; set; }

        [Input("username")]
        public string? Username { get; set; }

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

    public sealed class GetResourceInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("hostname")]
        public Input<string>? Hostname { get; set; }

        /// <summary>
        /// Unique identifier of the Resource.
        /// </summary>
        [Input("id")]
        public Input<string>? Id { get; set; }

        /// <summary>
        /// Unique human-readable name of the Resource.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("port")]
        public Input<int>? Port { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Tags is a map of key, value pairs.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// a filter to select all items of a certain subtype. See the [filter documentation](https://www.strongdm.com/docs/automation/getting-started/filters for more information.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

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

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


    [OutputType]
    public sealed class GetResourceResult
    {
        public readonly string? Hostname;
        /// <summary>
        /// Unique identifier of the Resource.
        /// </summary>
        public readonly string? Id;
        /// <summary>
        /// a list of strings of ids of data sources that match the given arguments.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        /// <summary>
        /// Unique human-readable name of the Resource.
        /// </summary>
        public readonly string? Name;
        public readonly int? Port;
        /// <summary>
        /// A single element list containing a map, where each key lists one of the following objects:
        /// * aks:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetResourceResourceResult> Resources;
        /// <summary>
        /// Tags is a map of key, value pairs.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;
        public readonly string? Type;
        public readonly string? Username;

        [OutputConstructor]
        private GetResourceResult(
            string? hostname,

            string? id,

            ImmutableArray<string> ids,

            string? name,

            int? port,

            ImmutableArray<Outputs.GetResourceResourceResult> resources,

            ImmutableDictionary<string, object>? tags,

            string? type,

            string? username)
        {
            Hostname = hostname;
            Id = id;
            Ids = ids;
            Name = name;
            Port = port;
            Resources = resources;
            Tags = tags;
            Type = type;
            Username = username;
        }
    }
}
