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

elasticstack.getElasticsearchSecurityRole

Explore with Pulumi AI

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

    Use this data source to get information about an existing Elasticsearch role. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const roleElasticsearchSecurityRole = elasticstack.getElasticsearchSecurityRole({
        name: "testrole",
    });
    export const role = roleElasticsearchSecurityRole.then(roleElasticsearchSecurityRole => roleElasticsearchSecurityRole.name);
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    role_elasticsearch_security_role = elasticstack.get_elasticsearch_security_role(name="testrole")
    pulumi.export("role", role_elasticsearch_security_role.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 {
    		roleElasticsearchSecurityRole, err := elasticstack.LookupElasticsearchSecurityRole(ctx, &elasticstack.LookupElasticsearchSecurityRoleArgs{
    			Name: "testrole",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("role", roleElasticsearchSecurityRole.Name)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var roleElasticsearchSecurityRole = Elasticstack.GetElasticsearchSecurityRole.Invoke(new()
        {
            Name = "testrole",
        });
    
        return new Dictionary<string, object?>
        {
            ["role"] = roleElasticsearchSecurityRole.Apply(getElasticsearchSecurityRoleResult => getElasticsearchSecurityRoleResult.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.GetElasticsearchSecurityRoleArgs;
    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 roleElasticsearchSecurityRole = ElasticstackFunctions.getElasticsearchSecurityRole(GetElasticsearchSecurityRoleArgs.builder()
                .name("testrole")
                .build());
    
            ctx.export("role", roleElasticsearchSecurityRole.applyValue(getElasticsearchSecurityRoleResult -> getElasticsearchSecurityRoleResult.name()));
        }
    }
    
    variables:
      roleElasticsearchSecurityRole:
        fn::invoke:
          function: elasticstack:getElasticsearchSecurityRole
          arguments:
            name: testrole
    outputs:
      role: ${roleElasticsearchSecurityRole.name}
    

    Using getElasticsearchSecurityRole

    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 getElasticsearchSecurityRole(args: GetElasticsearchSecurityRoleArgs, opts?: InvokeOptions): Promise<GetElasticsearchSecurityRoleResult>
    function getElasticsearchSecurityRoleOutput(args: GetElasticsearchSecurityRoleOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchSecurityRoleResult>
    def get_elasticsearch_security_role(elasticsearch_connection: Optional[GetElasticsearchSecurityRoleElasticsearchConnection] = None,
                                        name: Optional[str] = None,
                                        run_as: Optional[Sequence[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetElasticsearchSecurityRoleResult
    def get_elasticsearch_security_role_output(elasticsearch_connection: Optional[pulumi.Input[GetElasticsearchSecurityRoleElasticsearchConnectionArgs]] = None,
                                        name: Optional[pulumi.Input[str]] = None,
                                        run_as: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchSecurityRoleResult]
    func LookupElasticsearchSecurityRole(ctx *Context, args *LookupElasticsearchSecurityRoleArgs, opts ...InvokeOption) (*LookupElasticsearchSecurityRoleResult, error)
    func LookupElasticsearchSecurityRoleOutput(ctx *Context, args *LookupElasticsearchSecurityRoleOutputArgs, opts ...InvokeOption) LookupElasticsearchSecurityRoleResultOutput

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

    public static class GetElasticsearchSecurityRole 
    {
        public static Task<GetElasticsearchSecurityRoleResult> InvokeAsync(GetElasticsearchSecurityRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchSecurityRoleResult> Invoke(GetElasticsearchSecurityRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchSecurityRoleResult> getElasticsearchSecurityRole(GetElasticsearchSecurityRoleArgs args, InvokeOptions options)
    public static Output<GetElasticsearchSecurityRoleResult> getElasticsearchSecurityRole(GetElasticsearchSecurityRoleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchSecurityRole:getElasticsearchSecurityRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the role.
    ElasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    RunAs List<string>
    A list of users that the owners of this role can impersonate.
    Name string
    The name of the role.
    ElasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    RunAs []string
    A list of users that the owners of this role can impersonate.
    name String
    The name of the role.
    elasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    runAs List<String>
    A list of users that the owners of this role can impersonate.
    name string
    The name of the role.
    elasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    runAs string[]
    A list of users that the owners of this role can impersonate.
    name str
    The name of the role.
    elasticsearch_connection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    run_as Sequence[str]
    A list of users that the owners of this role can impersonate.
    name String
    The name of the role.
    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

    runAs List<String>
    A list of users that the owners of this role can impersonate.

    getElasticsearchSecurityRole Result

    The following output properties are available:

    Applications List<GetElasticsearchSecurityRoleApplication>
    A list of application privilege entries.
    Clusters List<string>
    A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute.
    Description string
    The description of the role.
    Global string
    An object defining global privileges.
    Id string
    Internal identifier of the resource
    Indices List<GetElasticsearchSecurityRoleIndex>
    A list of indices permissions entries.
    Metadata string
    Optional meta-data.
    Name string
    The name of the role.
    RemoteIndices List<GetElasticsearchSecurityRoleRemoteIndex>
    A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model.
    ElasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    RunAs List<string>
    A list of users that the owners of this role can impersonate.
    Applications []GetElasticsearchSecurityRoleApplication
    A list of application privilege entries.
    Clusters []string
    A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute.
    Description string
    The description of the role.
    Global string
    An object defining global privileges.
    Id string
    Internal identifier of the resource
    Indices []GetElasticsearchSecurityRoleIndex
    A list of indices permissions entries.
    Metadata string
    Optional meta-data.
    Name string
    The name of the role.
    RemoteIndices []GetElasticsearchSecurityRoleRemoteIndex
    A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model.
    ElasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    RunAs []string
    A list of users that the owners of this role can impersonate.
    applications List<GetElasticsearchSecurityRoleApplication>
    A list of application privilege entries.
    clusters List<String>
    A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute.
    description String
    The description of the role.
    global String
    An object defining global privileges.
    id String
    Internal identifier of the resource
    indices List<GetElasticsearchSecurityRoleIndex>
    A list of indices permissions entries.
    metadata String
    Optional meta-data.
    name String
    The name of the role.
    remoteIndices List<GetElasticsearchSecurityRoleRemoteIndex>
    A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model.
    elasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    runAs List<String>
    A list of users that the owners of this role can impersonate.
    applications GetElasticsearchSecurityRoleApplication[]
    A list of application privilege entries.
    clusters string[]
    A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute.
    description string
    The description of the role.
    global string
    An object defining global privileges.
    id string
    Internal identifier of the resource
    indices GetElasticsearchSecurityRoleIndex[]
    A list of indices permissions entries.
    metadata string
    Optional meta-data.
    name string
    The name of the role.
    remoteIndices GetElasticsearchSecurityRoleRemoteIndex[]
    A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model.
    elasticsearchConnection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    runAs string[]
    A list of users that the owners of this role can impersonate.
    applications Sequence[GetElasticsearchSecurityRoleApplication]
    A list of application privilege entries.
    clusters Sequence[str]
    A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute.
    description str
    The description of the role.
    global_ str
    An object defining global privileges.
    id str
    Internal identifier of the resource
    indices Sequence[GetElasticsearchSecurityRoleIndex]
    A list of indices permissions entries.
    metadata str
    Optional meta-data.
    name str
    The name of the role.
    remote_indices Sequence[GetElasticsearchSecurityRoleRemoteIndex]
    A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model.
    elasticsearch_connection GetElasticsearchSecurityRoleElasticsearchConnection
    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

    run_as Sequence[str]
    A list of users that the owners of this role can impersonate.
    applications List<Property Map>
    A list of application privilege entries.
    clusters List<String>
    A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute.
    description String
    The description of the role.
    global String
    An object defining global privileges.
    id String
    Internal identifier of the resource
    indices List<Property Map>
    A list of indices permissions entries.
    metadata String
    Optional meta-data.
    name String
    The name of the role.
    remoteIndices List<Property Map>
    A list of remote indices permissions entries. Remote indices are effective for remote clusters configured with the API key based model. They have no effect for remote clusters configured with the certificate based model.
    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

    runAs List<String>
    A list of users that the owners of this role can impersonate.

    Supporting Types

    GetElasticsearchSecurityRoleApplication

    Application string
    Privileges List<string>
    Resources List<string>
    Application string
    Privileges []string
    Resources []string
    application String
    privileges List<String>
    resources List<String>
    application string
    privileges string[]
    resources string[]
    application str
    privileges Sequence[str]
    resources Sequence[str]
    application String
    privileges List<String>
    resources List<String>

    GetElasticsearchSecurityRoleElasticsearchConnection

    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.

    GetElasticsearchSecurityRoleIndex

    GetElasticsearchSecurityRoleIndexFieldSecurity

    Excepts List<string>
    Grants List<string>
    Excepts []string
    Grants []string
    excepts List<String>
    grants List<String>
    excepts string[]
    grants string[]
    excepts Sequence[str]
    grants Sequence[str]
    excepts List<String>
    grants List<String>

    GetElasticsearchSecurityRoleRemoteIndex

    clusters List<String>
    fieldSecurities List<Property Map>
    names List<String>
    privileges List<String>
    query String

    GetElasticsearchSecurityRoleRemoteIndexFieldSecurity

    Excepts List<string>
    Grants List<string>
    Excepts []string
    Grants []string
    excepts List<String>
    grants List<String>
    excepts string[]
    grants string[]
    excepts Sequence[str]
    grants Sequence[str]
    excepts List<String>
    grants List<String>

    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