<gh_stars>0// *** 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 GetSecurityRoleMapping
    {
        /// <summary>
        /// Retrieves role mappings. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var mapping = Elasticstack.GetSecurityRoleMapping.Invoke(new()
        ///     {
        ///         Name = "my_mapping",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["user"] = mapping.Apply(getSecurityRoleMappingResult =&gt; getSecurityRoleMappingResult.Name),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetSecurityRoleMappingResult> InvokeAsync(GetSecurityRoleMappingArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetSecurityRoleMappingResult>("elasticstack:index/getSecurityRoleMapping:getSecurityRoleMapping", args ?? new GetSecurityRoleMappingArgs(), options.WithDefaults());

        /// <summary>
        /// Retrieves role mappings. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var mapping = Elasticstack.GetSecurityRoleMapping.Invoke(new()
        ///     {
        ///         Name = "my_mapping",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["user"] = mapping.Apply(getSecurityRoleMappingResult =&gt; getSecurityRoleMappingResult.Name),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetSecurityRoleMappingResult> Invoke(GetSecurityRoleMappingInvokeArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetSecurityRoleMappingResult>("elasticstack:index/getSecurityRoleMapping:getSecurityRoleMapping", args ?? new GetSecurityRoleMappingInvokeArgs(), options.WithDefaults());
    }


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

        /// <summary>
        /// The distinct name that identifies the role mapping, used solely as an identifier.
        /// </summary>
        [Input("name", required: true)]
        public string Name { get; set; } = null!;

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

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

        /// <summary>
        /// The distinct name that identifies the role mapping, used solely as an identifier.
        /// </summary>
        [Input("name", required: true)]
        public Input<string> Name { get; set; } = null!;

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


    [OutputType]
    public sealed class GetSecurityRoleMappingResult
    {
        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        public readonly Outputs.GetSecurityRoleMappingElasticsearchConnectionResult? ElasticsearchConnection;
        /// <summary>
        /// Mappings that have `enabled` set to `false` are ignored when role mapping is performed.
        /// </summary>
        public readonly bool Enabled;
        /// <summary>
        /// Internal identifier of the resource
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Additional metadata that helps define which roles are assigned to each user. Keys beginning with `_` are reserved for system usage.
        /// </summary>
        public readonly string Metadata;
        /// <summary>
        /// The distinct name that identifies the role mapping, used solely as an identifier.
        /// </summary>
        public readonly string Name;
        /// <summary>
        /// A list of mustache templates that will be evaluated to determine the roles names that should granted to the users that match the role mapping rules.
        /// </summary>
        public readonly string RoleTemplates;
        /// <summary>
        /// A list of role names that are granted to the users that match the role mapping rules.
        /// </summary>
        public readonly ImmutableArray<string> Roles;
        /// <summary>
        /// The rules that determine which users should be matched by the mapping. A rule is a logical condition that is expressed by using a JSON DSL.
        /// </summary>
        public readonly string Rules;

        [OutputConstructor]
        private GetSecurityRoleMappingResult(
            Outputs.GetSecurityRoleMappingElasticsearchConnectionResult? elasticsearchConnection,

            bool enabled,

            string id,

            string metadata,

            string name,

            string roleTemplates,

            ImmutableArray<string> roles,

            string rules)
        {
            ElasticsearchConnection = elasticsearchConnection;
            Enabled = enabled;
            Id = id;
            Metadata = metadata;
            Name = name;
            RoleTemplates = roleTemplates;
            Roles = roles;
            Rules = rules;
        }
    }
}
