<reponame>zlepper/pulumi-elasticstack// *** 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.Elasticstack
{
    public static class GetSecurityUser
    {
        /// <summary>
        /// Use this data source to get information about existing Elasticsearch user. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html".
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var userSecurityUser = Elasticstack.GetSecurityUser.Invoke(new()
        ///     {
        ///         Username = "elastic",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["user"] = userSecurityUser.Apply(getSecurityUserResult =&gt; getSecurityUserResult),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetSecurityUserResult> InvokeAsync(GetSecurityUserArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetSecurityUserResult>("elasticstack:index/getSecurityUser:getSecurityUser", args ?? new GetSecurityUserArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to get information about existing Elasticsearch user. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html".
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var userSecurityUser = Elasticstack.GetSecurityUser.Invoke(new()
        ///     {
        ///         Username = "elastic",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["user"] = userSecurityUser.Apply(getSecurityUserResult =&gt; getSecurityUserResult),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetSecurityUserResult> Invoke(GetSecurityUserInvokeArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetSecurityUserResult>("elasticstack:index/getSecurityUser:getSecurityUser", args ?? new GetSecurityUserInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetSecurityUserArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        [Input("elasticsearchConnection")]
        public Inputs.GetSecurityUserElasticsearchConnectionArgs? ElasticsearchConnection { get; set; }

        /// <summary>
        /// An identifier for the user
        /// </summary>
        [Input("username", required: true)]
        public string Username { get; set; } = null!;

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

    public sealed class GetSecurityUserInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        [Input("elasticsearchConnection")]
        public Input<Inputs.GetSecurityUserElasticsearchConnectionInputArgs>? ElasticsearchConnection { get; set; }

        /// <summary>
        /// An identifier for the user
        /// </summary>
        [Input("username", required: true)]
        public Input<string> Username { get; set; } = null!;

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


    [OutputType]
    public sealed class GetSecurityUserResult
    {
        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        public readonly Outputs.GetSecurityUserElasticsearchConnectionResult? ElasticsearchConnection;
        /// <summary>
        /// The email of the user.
        /// </summary>
        public readonly string Email;
        /// <summary>
        /// Specifies whether the user is enabled. The default value is true.
        /// </summary>
        public readonly bool Enabled;
        /// <summary>
        /// The full name of the user.
        /// </summary>
        public readonly string FullName;
        /// <summary>
        /// Internal identifier of the resource
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Arbitrary metadata that you want to associate with the user.
        /// </summary>
        public readonly string Metadata;
        /// <summary>
        /// A set of roles the user has. The roles determine the user’s access permissions. Default is [].
        /// </summary>
        public readonly ImmutableArray<string> Roles;
        /// <summary>
        /// An identifier for the user
        /// </summary>
        public readonly string Username;

        [OutputConstructor]
        private GetSecurityUserResult(
            Outputs.GetSecurityUserElasticsearchConnectionResult? elasticsearchConnection,

            string email,

            bool enabled,

            string fullName,

            string id,

            string metadata,

            ImmutableArray<string> roles,

            string username)
        {
            ElasticsearchConnection = elasticsearchConnection;
            Email = email;
            Enabled = enabled;
            FullName = fullName;
            Id = id;
            Metadata = metadata;
            Roles = roles;
            Username = username;
        }
    }
}
