elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic
elasticstack.getElasticsearchSecurityRole
Explore with Pulumi AI
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.
- Elasticsearch
Connection GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- Run
As List<string> - A list of users that the owners of this role can impersonate.
- Name string
- The name of the role.
- Elasticsearch
Connection GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- Run
As []string - A list of users that the owners of this role can impersonate.
- name String
- The name of the role.
- elasticsearch
Connection GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- run
As List<String> - A list of users that the owners of this role can impersonate.
- name string
- The name of the role.
- elasticsearch
Connection GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- run
As string[] - A list of users that the owners of this role can impersonate.
- name str
- The name of the role.
- elasticsearch_
connection GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- run_
as Sequence[str] - A list of users that the owners of this role can impersonate.
- name String
- The name of the role.
- elasticsearch
Connection 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.
- run
As List<String> - A list of users that the owners of this role can impersonate.
getElasticsearchSecurityRole Result
The following output properties are available:
- Applications
List<Get
Elasticsearch Security Role Application> - 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<Get
Elasticsearch Security Role Index> - A list of indices permissions entries.
- Metadata string
- Optional meta-data.
- Name string
- The name of the role.
- Remote
Indices List<GetElasticsearch Security Role Remote Index> - 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 GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- Run
As List<string> - A list of users that the owners of this role can impersonate.
- Applications
[]Get
Elasticsearch Security Role Application - 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
[]Get
Elasticsearch Security Role Index - A list of indices permissions entries.
- Metadata string
- Optional meta-data.
- Name string
- The name of the role.
- Remote
Indices []GetElasticsearch Security Role Remote Index - 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 GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- Run
As []string - A list of users that the owners of this role can impersonate.
- applications
List<Get
Elasticsearch Security Role Application> - 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<Get
Elasticsearch Security Role Index> - A list of indices permissions entries.
- metadata String
- Optional meta-data.
- name String
- The name of the role.
- remote
Indices List<GetElasticsearch Security Role Remote Index> - 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 GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- run
As List<String> - A list of users that the owners of this role can impersonate.
- applications
Get
Elasticsearch Security Role Application[] - 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
Get
Elasticsearch Security Role Index[] - A list of indices permissions entries.
- metadata string
- Optional meta-data.
- name string
- The name of the role.
- remote
Indices GetElasticsearch Security Role Remote Index[] - 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 GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- run
As string[] - A list of users that the owners of this role can impersonate.
- applications
Sequence[Get
Elasticsearch Security Role Application] - 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[Get
Elasticsearch Security Role Index] - A list of indices permissions entries.
- metadata str
- Optional meta-data.
- name str
- The name of the role.
- remote_
indices Sequence[GetElasticsearch Security Role Remote Index] - 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 GetElasticsearch Security Role Elasticsearch Connection - Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead.
- 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.
- remote
Indices 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.
- elasticsearch
Connection 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.
- run
As 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
- Api
Key string - API Key to use for authentication to Elasticsearch
- Bearer
Token string - Bearer Token to use for authentication to Elasticsearch
- Ca
Data string - PEM-encoded custom Certificate Authority certificate
- Ca
File string - Path to a custom Certificate Authority certificate
- Cert
Data string - PEM encoded certificate for client auth
- Cert
File string - Path to a file containing the PEM encoded certificate for client auth
- Endpoints List<string>
- Es
Client stringAuthentication - ES Client Authentication field to be used with the JWT token
- Insecure bool
- Disable TLS certificate validation
- Key
Data string - PEM encoded private key for client auth
- Key
File 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 string - API Key to use for authentication to Elasticsearch
- Bearer
Token string - Bearer Token to use for authentication to Elasticsearch
- Ca
Data string - PEM-encoded custom Certificate Authority certificate
- Ca
File string - Path to a custom Certificate Authority certificate
- Cert
Data string - PEM encoded certificate for client auth
- Cert
File string - Path to a file containing the PEM encoded certificate for client auth
- Endpoints []string
- Es
Client stringAuthentication - ES Client Authentication field to be used with the JWT token
- Insecure bool
- Disable TLS certificate validation
- Key
Data string - PEM encoded private key for client auth
- Key
File 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 String - API Key to use for authentication to Elasticsearch
- bearer
Token String - Bearer Token to use for authentication to Elasticsearch
- ca
Data String - PEM-encoded custom Certificate Authority certificate
- ca
File String - Path to a custom Certificate Authority certificate
- cert
Data String - PEM encoded certificate for client auth
- cert
File String - Path to a file containing the PEM encoded certificate for client auth
- endpoints List<String>
- es
Client StringAuthentication - ES Client Authentication field to be used with the JWT token
- insecure Boolean
- Disable TLS certificate validation
- key
Data String - PEM encoded private key for client auth
- key
File 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 string - API Key to use for authentication to Elasticsearch
- bearer
Token string - Bearer Token to use for authentication to Elasticsearch
- ca
Data string - PEM-encoded custom Certificate Authority certificate
- ca
File string - Path to a custom Certificate Authority certificate
- cert
Data string - PEM encoded certificate for client auth
- cert
File string - Path to a file containing the PEM encoded certificate for client auth
- endpoints string[]
- es
Client stringAuthentication - ES Client Authentication field to be used with the JWT token
- insecure boolean
- Disable TLS certificate validation
- key
Data string - PEM encoded private key for client auth
- key
File 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_ strauthentication - 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.
- api
Key String - API Key to use for authentication to Elasticsearch
- bearer
Token String - Bearer Token to use for authentication to Elasticsearch
- ca
Data String - PEM-encoded custom Certificate Authority certificate
- ca
File String - Path to a custom Certificate Authority certificate
- cert
Data String - PEM encoded certificate for client auth
- cert
File String - Path to a file containing the PEM encoded certificate for client auth
- endpoints List<String>
- es
Client StringAuthentication - ES Client Authentication field to be used with the JWT token
- insecure Boolean
- Disable TLS certificate validation
- key
Data String - PEM encoded private key for client auth
- key
File 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
- Allow
Restricted boolIndices - Field
Securities List<GetElasticsearch Security Role Index Field Security> - Names List<string>
- Privileges List<string>
- Query string
- Allow
Restricted boolIndices - Field
Securities []GetElasticsearch Security Role Index Field Security - Names []string
- Privileges []string
- Query string
- allow
Restricted BooleanIndices - field
Securities List<GetElasticsearch Security Role Index Field Security> - names List<String>
- privileges List<String>
- query String
- allow
Restricted booleanIndices - field
Securities GetElasticsearch Security Role Index Field Security[] - names string[]
- privileges string[]
- query string
- allow_
restricted_ boolindices - field_
securities Sequence[GetElasticsearch Security Role Index Field Security] - names Sequence[str]
- privileges Sequence[str]
- query str
- allow
Restricted BooleanIndices - field
Securities List<Property Map> - names List<String>
- privileges List<String>
- query String
GetElasticsearchSecurityRoleIndexFieldSecurity
GetElasticsearchSecurityRoleRemoteIndex
- Clusters List<string>
- Field
Securities List<GetElasticsearch Security Role Remote Index Field Security> - Names List<string>
- Privileges List<string>
- Query string
- Clusters []string
- Field
Securities []GetElasticsearch Security Role Remote Index Field Security - Names []string
- Privileges []string
- Query string
- clusters List<String>
- field
Securities List<GetElasticsearch Security Role Remote Index Field Security> - names List<String>
- privileges List<String>
- query String
- clusters string[]
- field
Securities GetElasticsearch Security Role Remote Index Field Security[] - names string[]
- privileges string[]
- query string
- clusters Sequence[str]
- field_
securities Sequence[GetElasticsearch Security Role Remote Index Field Security] - names Sequence[str]
- privileges Sequence[str]
- query str
- clusters List<String>
- field
Securities List<Property Map> - names List<String>
- privileges List<String>
- query String
GetElasticsearchSecurityRoleRemoteIndexFieldSecurity
Package Details
- Repository
- elasticstack elastic/terraform-provider-elasticstack
- License
- Notes
- This Pulumi package is based on the
elasticstack
Terraform Provider.
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic