1. Packages
  2. Elasticstack Provider
  3. API Docs
  4. getElasticsearchSecurityRoleMapping
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

elasticstack.getElasticsearchSecurityRoleMapping

Explore with Pulumi AI

elasticstack logo
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

    Retrieves role mappings. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const mapping = elasticstack.getElasticsearchSecurityRoleMapping({
        name: "my_mapping",
    });
    export const user = mapping.then(mapping => mapping.name);
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    mapping = elasticstack.get_elasticsearch_security_role_mapping(name="my_mapping")
    pulumi.export("user", mapping.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/elasticstack/elasticstack"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		mapping, err := elasticstack.LookupElasticsearchSecurityRoleMapping(ctx, &elasticstack.LookupElasticsearchSecurityRoleMappingArgs{
    			Name: "my_mapping",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("user", mapping.Name)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var mapping = Elasticstack.GetElasticsearchSecurityRoleMapping.Invoke(new()
        {
            Name = "my_mapping",
        });
    
        return new Dictionary<string, object?>
        {
            ["user"] = mapping.Apply(getElasticsearchSecurityRoleMappingResult => getElasticsearchSecurityRoleMappingResult.Name),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.elasticstack.ElasticstackFunctions;
    import com.pulumi.elasticstack.inputs.GetElasticsearchSecurityRoleMappingArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var mapping = ElasticstackFunctions.getElasticsearchSecurityRoleMapping(GetElasticsearchSecurityRoleMappingArgs.builder()
                .name("my_mapping")
                .build());
    
            ctx.export("user", mapping.applyValue(getElasticsearchSecurityRoleMappingResult -> getElasticsearchSecurityRoleMappingResult.name()));
        }
    }
    
    variables:
      mapping:
        fn::invoke:
          function: elasticstack:getElasticsearchSecurityRoleMapping
          arguments:
            name: my_mapping
    outputs:
      user: ${mapping.name}
    

    Using getElasticsearchSecurityRoleMapping

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getElasticsearchSecurityRoleMapping(args: GetElasticsearchSecurityRoleMappingArgs, opts?: InvokeOptions): Promise<GetElasticsearchSecurityRoleMappingResult>
    function getElasticsearchSecurityRoleMappingOutput(args: GetElasticsearchSecurityRoleMappingOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchSecurityRoleMappingResult>
    def get_elasticsearch_security_role_mapping(elasticsearch_connection: Optional[GetElasticsearchSecurityRoleMappingElasticsearchConnection] = None,
                                                name: Optional[str] = None,
                                                opts: Optional[InvokeOptions] = None) -> GetElasticsearchSecurityRoleMappingResult
    def get_elasticsearch_security_role_mapping_output(elasticsearch_connection: Optional[pulumi.Input[GetElasticsearchSecurityRoleMappingElasticsearchConnectionArgs]] = None,
                                                name: Optional[pulumi.Input[str]] = None,
                                                opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchSecurityRoleMappingResult]
    func LookupElasticsearchSecurityRoleMapping(ctx *Context, args *LookupElasticsearchSecurityRoleMappingArgs, opts ...InvokeOption) (*LookupElasticsearchSecurityRoleMappingResult, error)
    func LookupElasticsearchSecurityRoleMappingOutput(ctx *Context, args *LookupElasticsearchSecurityRoleMappingOutputArgs, opts ...InvokeOption) LookupElasticsearchSecurityRoleMappingResultOutput

    > Note: This function is named LookupElasticsearchSecurityRoleMapping in the Go SDK.

    public static class GetElasticsearchSecurityRoleMapping 
    {
        public static Task<GetElasticsearchSecurityRoleMappingResult> InvokeAsync(GetElasticsearchSecurityRoleMappingArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchSecurityRoleMappingResult> Invoke(GetElasticsearchSecurityRoleMappingInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchSecurityRoleMappingResult> getElasticsearchSecurityRoleMapping(GetElasticsearchSecurityRoleMappingArgs args, InvokeOptions options)
    public static Output<GetElasticsearchSecurityRoleMappingResult> getElasticsearchSecurityRoleMapping(GetElasticsearchSecurityRoleMappingArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchSecurityRoleMapping:getElasticsearchSecurityRoleMapping
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The distinct name that identifies the role mapping, used solely as an identifier.
    ElasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    Name string
    The distinct name that identifies the role mapping, used solely as an identifier.
    ElasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    name String
    The distinct name that identifies the role mapping, used solely as an identifier.
    elasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    name string
    The distinct name that identifies the role mapping, used solely as an identifier.
    elasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    name str
    The distinct name that identifies the role mapping, used solely as an identifier.
    elasticsearch_connection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    name String
    The distinct name that identifies the role mapping, used solely as an identifier.
    elasticsearchConnection Property Map
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    getElasticsearchSecurityRoleMapping Result

    The following output properties are available:

    Enabled bool
    Mappings that have enabled set to false are ignored when role mapping is performed.
    Id string
    Internal identifier of the resource
    Metadata string
    Additional metadata that helps define which roles are assigned to each user. Keys beginning with _ are reserved for system usage.
    Name string
    The distinct name that identifies the role mapping, used solely as an identifier.
    RoleTemplates string
    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.
    Roles List<string>
    A list of role names that are granted to the users that match the role mapping rules.
    Rules string
    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.
    ElasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    Enabled bool
    Mappings that have enabled set to false are ignored when role mapping is performed.
    Id string
    Internal identifier of the resource
    Metadata string
    Additional metadata that helps define which roles are assigned to each user. Keys beginning with _ are reserved for system usage.
    Name string
    The distinct name that identifies the role mapping, used solely as an identifier.
    RoleTemplates string
    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.
    Roles []string
    A list of role names that are granted to the users that match the role mapping rules.
    Rules string
    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.
    ElasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    enabled Boolean
    Mappings that have enabled set to false are ignored when role mapping is performed.
    id String
    Internal identifier of the resource
    metadata String
    Additional metadata that helps define which roles are assigned to each user. Keys beginning with _ are reserved for system usage.
    name String
    The distinct name that identifies the role mapping, used solely as an identifier.
    roleTemplates String
    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.
    roles List<String>
    A list of role names that are granted to the users that match the role mapping rules.
    rules String
    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.
    elasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    enabled boolean
    Mappings that have enabled set to false are ignored when role mapping is performed.
    id string
    Internal identifier of the resource
    metadata string
    Additional metadata that helps define which roles are assigned to each user. Keys beginning with _ are reserved for system usage.
    name string
    The distinct name that identifies the role mapping, used solely as an identifier.
    roleTemplates string
    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.
    roles string[]
    A list of role names that are granted to the users that match the role mapping rules.
    rules string
    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.
    elasticsearchConnection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    enabled bool
    Mappings that have enabled set to false are ignored when role mapping is performed.
    id str
    Internal identifier of the resource
    metadata str
    Additional metadata that helps define which roles are assigned to each user. Keys beginning with _ are reserved for system usage.
    name str
    The distinct name that identifies the role mapping, used solely as an identifier.
    role_templates str
    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.
    roles Sequence[str]
    A list of role names that are granted to the users that match the role mapping rules.
    rules str
    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.
    elasticsearch_connection GetElasticsearchSecurityRoleMappingElasticsearchConnection
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    enabled Boolean
    Mappings that have enabled set to false are ignored when role mapping is performed.
    id String
    Internal identifier of the resource
    metadata String
    Additional metadata that helps define which roles are assigned to each user. Keys beginning with _ are reserved for system usage.
    name String
    The distinct name that identifies the role mapping, used solely as an identifier.
    roleTemplates String
    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.
    roles List<String>
    A list of role names that are granted to the users that match the role mapping rules.
    rules String
    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.
    elasticsearchConnection Property Map
    Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.

    Deprecated: Deprecated

    Supporting Types

    GetElasticsearchSecurityRoleMappingElasticsearchConnection

    ApiKey string
    API Key to use for authentication to Elasticsearch
    BearerToken string
    Bearer Token to use for authentication to Elasticsearch
    CaData string
    PEM-encoded custom Certificate Authority certificate
    CaFile string
    Path to a custom Certificate Authority certificate
    CertData string
    PEM encoded certificate for client auth
    CertFile string
    Path to a file containing the PEM encoded certificate for client auth
    Endpoints List<string>
    EsClientAuthentication string
    ES Client Authentication field to be used with the JWT token
    Insecure bool
    Disable TLS certificate validation
    KeyData string
    PEM encoded private key for client auth
    KeyFile string
    Path to a file containing the PEM encoded private key for client auth
    Password string
    Password to use for API authentication to Elasticsearch.
    Username string
    Username to use for API authentication to Elasticsearch.
    ApiKey string
    API Key to use for authentication to Elasticsearch
    BearerToken string
    Bearer Token to use for authentication to Elasticsearch
    CaData string
    PEM-encoded custom Certificate Authority certificate
    CaFile string
    Path to a custom Certificate Authority certificate
    CertData string
    PEM encoded certificate for client auth
    CertFile string
    Path to a file containing the PEM encoded certificate for client auth
    Endpoints []string
    EsClientAuthentication string
    ES Client Authentication field to be used with the JWT token
    Insecure bool
    Disable TLS certificate validation
    KeyData string
    PEM encoded private key for client auth
    KeyFile string
    Path to a file containing the PEM encoded private key for client auth
    Password string
    Password to use for API authentication to Elasticsearch.
    Username string
    Username to use for API authentication to Elasticsearch.
    apiKey String
    API Key to use for authentication to Elasticsearch
    bearerToken String
    Bearer Token to use for authentication to Elasticsearch
    caData String
    PEM-encoded custom Certificate Authority certificate
    caFile String
    Path to a custom Certificate Authority certificate
    certData String
    PEM encoded certificate for client auth
    certFile String
    Path to a file containing the PEM encoded certificate for client auth
    endpoints List<String>
    esClientAuthentication String
    ES Client Authentication field to be used with the JWT token
    insecure Boolean
    Disable TLS certificate validation
    keyData String
    PEM encoded private key for client auth
    keyFile String
    Path to a file containing the PEM encoded private key for client auth
    password String
    Password to use for API authentication to Elasticsearch.
    username String
    Username to use for API authentication to Elasticsearch.
    apiKey string
    API Key to use for authentication to Elasticsearch
    bearerToken string
    Bearer Token to use for authentication to Elasticsearch
    caData string
    PEM-encoded custom Certificate Authority certificate
    caFile string
    Path to a custom Certificate Authority certificate
    certData string
    PEM encoded certificate for client auth
    certFile string
    Path to a file containing the PEM encoded certificate for client auth
    endpoints string[]
    esClientAuthentication string
    ES Client Authentication field to be used with the JWT token
    insecure boolean
    Disable TLS certificate validation
    keyData string
    PEM encoded private key for client auth
    keyFile string
    Path to a file containing the PEM encoded private key for client auth
    password string
    Password to use for API authentication to Elasticsearch.
    username string
    Username to use for API authentication to Elasticsearch.
    api_key str
    API Key to use for authentication to Elasticsearch
    bearer_token str
    Bearer Token to use for authentication to Elasticsearch
    ca_data str
    PEM-encoded custom Certificate Authority certificate
    ca_file str
    Path to a custom Certificate Authority certificate
    cert_data str
    PEM encoded certificate for client auth
    cert_file str
    Path to a file containing the PEM encoded certificate for client auth
    endpoints Sequence[str]
    es_client_authentication str
    ES Client Authentication field to be used with the JWT token
    insecure bool
    Disable TLS certificate validation
    key_data str
    PEM encoded private key for client auth
    key_file str
    Path to a file containing the PEM encoded private key for client auth
    password str
    Password to use for API authentication to Elasticsearch.
    username str
    Username to use for API authentication to Elasticsearch.
    apiKey String
    API Key to use for authentication to Elasticsearch
    bearerToken String
    Bearer Token to use for authentication to Elasticsearch
    caData String
    PEM-encoded custom Certificate Authority certificate
    caFile String
    Path to a custom Certificate Authority certificate
    certData String
    PEM encoded certificate for client auth
    certFile String
    Path to a file containing the PEM encoded certificate for client auth
    endpoints List<String>
    esClientAuthentication String
    ES Client Authentication field to be used with the JWT token
    insecure Boolean
    Disable TLS certificate validation
    keyData String
    PEM encoded private key for client auth
    keyFile String
    Path to a file containing the PEM encoded private key for client auth
    password String
    Password to use for API authentication to Elasticsearch.
    username String
    Username to use for API authentication to Elasticsearch.

    Package Details

    Repository
    elasticstack elastic/terraform-provider-elasticstack
    License
    Notes
    This Pulumi package is based on the elasticstack Terraform Provider.
    elasticstack logo
    elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic