1. Packages
  2. Elasticstack Provider
  3. API Docs
  4. getElasticsearchSecurityUser
elasticstack 0.11.14 published on Monday, Apr 14, 2025 by elastic

elasticstack.getElasticsearchSecurityUser

Explore with Pulumi AI

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".

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";

const userElasticsearchSecurityUser = elasticstack.getElasticsearchSecurityUser({
    username: "elastic",
});
export const user = userElasticsearchSecurityUser;
Copy
import pulumi
import pulumi_elasticstack as elasticstack

user_elasticsearch_security_user = elasticstack.get_elasticsearch_security_user(username="elastic")
pulumi.export("user", user_elasticsearch_security_user)
Copy
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 {
		userElasticsearchSecurityUser, err := elasticstack.LookupElasticsearchSecurityUser(ctx, &elasticstack.LookupElasticsearchSecurityUserArgs{
			Username: "elastic",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("user", userElasticsearchSecurityUser)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Elasticstack = Pulumi.Elasticstack;

return await Deployment.RunAsync(() => 
{
    var userElasticsearchSecurityUser = Elasticstack.GetElasticsearchSecurityUser.Invoke(new()
    {
        Username = "elastic",
    });

    return new Dictionary<string, object?>
    {
        ["user"] = userElasticsearchSecurityUser,
    };
});
Copy
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.GetElasticsearchSecurityUserArgs;
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 userElasticsearchSecurityUser = ElasticstackFunctions.getElasticsearchSecurityUser(GetElasticsearchSecurityUserArgs.builder()
            .username("elastic")
            .build());

        ctx.export("user", userElasticsearchSecurityUser.applyValue(getElasticsearchSecurityUserResult -> getElasticsearchSecurityUserResult));
    }
}
Copy
variables:
  userElasticsearchSecurityUser:
    fn::invoke:
      function: elasticstack:getElasticsearchSecurityUser
      arguments:
        username: elastic
outputs:
  user: ${userElasticsearchSecurityUser}
Copy

Using getElasticsearchSecurityUser

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 getElasticsearchSecurityUser(args: GetElasticsearchSecurityUserArgs, opts?: InvokeOptions): Promise<GetElasticsearchSecurityUserResult>
function getElasticsearchSecurityUserOutput(args: GetElasticsearchSecurityUserOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchSecurityUserResult>
Copy
def get_elasticsearch_security_user(elasticsearch_connection: Optional[GetElasticsearchSecurityUserElasticsearchConnection] = None,
                                    username: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetElasticsearchSecurityUserResult
def get_elasticsearch_security_user_output(elasticsearch_connection: Optional[pulumi.Input[GetElasticsearchSecurityUserElasticsearchConnectionArgs]] = None,
                                    username: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchSecurityUserResult]
Copy
func LookupElasticsearchSecurityUser(ctx *Context, args *LookupElasticsearchSecurityUserArgs, opts ...InvokeOption) (*LookupElasticsearchSecurityUserResult, error)
func LookupElasticsearchSecurityUserOutput(ctx *Context, args *LookupElasticsearchSecurityUserOutputArgs, opts ...InvokeOption) LookupElasticsearchSecurityUserResultOutput
Copy

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

public static class GetElasticsearchSecurityUser 
{
    public static Task<GetElasticsearchSecurityUserResult> InvokeAsync(GetElasticsearchSecurityUserArgs args, InvokeOptions? opts = null)
    public static Output<GetElasticsearchSecurityUserResult> Invoke(GetElasticsearchSecurityUserInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetElasticsearchSecurityUserResult> getElasticsearchSecurityUser(GetElasticsearchSecurityUserArgs args, InvokeOptions options)
public static Output<GetElasticsearchSecurityUserResult> getElasticsearchSecurityUser(GetElasticsearchSecurityUserArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: elasticstack:index/getElasticsearchSecurityUser:getElasticsearchSecurityUser
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Username This property is required. string
An identifier for the user
ElasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

Username This property is required. string
An identifier for the user
ElasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

username This property is required. String
An identifier for the user
elasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

username This property is required. string
An identifier for the user
elasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

username This property is required. str
An identifier for the user
elasticsearch_connection GetElasticsearchSecurityUserElasticsearchConnection
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

username This property is required. String
An identifier for the user
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

getElasticsearchSecurityUser Result

The following output properties are available:

Email string
The email of the user.
Enabled bool
Specifies whether the user is enabled. The default value is true.
FullName string
The full name of the user.
Id string
Internal identifier of the resource
Metadata string
Arbitrary metadata that you want to associate with the user.
Roles List<string>
A set of roles the user has. The roles determine the user’s access permissions. Default is [].
Username string
An identifier for the user
ElasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

Email string
The email of the user.
Enabled bool
Specifies whether the user is enabled. The default value is true.
FullName string
The full name of the user.
Id string
Internal identifier of the resource
Metadata string
Arbitrary metadata that you want to associate with the user.
Roles []string
A set of roles the user has. The roles determine the user’s access permissions. Default is [].
Username string
An identifier for the user
ElasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

email String
The email of the user.
enabled Boolean
Specifies whether the user is enabled. The default value is true.
fullName String
The full name of the user.
id String
Internal identifier of the resource
metadata String
Arbitrary metadata that you want to associate with the user.
roles List<String>
A set of roles the user has. The roles determine the user’s access permissions. Default is [].
username String
An identifier for the user
elasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

email string
The email of the user.
enabled boolean
Specifies whether the user is enabled. The default value is true.
fullName string
The full name of the user.
id string
Internal identifier of the resource
metadata string
Arbitrary metadata that you want to associate with the user.
roles string[]
A set of roles the user has. The roles determine the user’s access permissions. Default is [].
username string
An identifier for the user
elasticsearchConnection GetElasticsearchSecurityUserElasticsearchConnection
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

email str
The email of the user.
enabled bool
Specifies whether the user is enabled. The default value is true.
full_name str
The full name of the user.
id str
Internal identifier of the resource
metadata str
Arbitrary metadata that you want to associate with the user.
roles Sequence[str]
A set of roles the user has. The roles determine the user’s access permissions. Default is [].
username str
An identifier for the user
elasticsearch_connection GetElasticsearchSecurityUserElasticsearchConnection
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

email String
The email of the user.
enabled Boolean
Specifies whether the user is enabled. The default value is true.
fullName String
The full name of the user.
id String
Internal identifier of the resource
metadata String
Arbitrary metadata that you want to associate with the user.
roles List<String>
A set of roles the user has. The roles determine the user’s access permissions. Default is [].
username String
An identifier for the user
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

GetElasticsearchSecurityUserElasticsearchConnection

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.