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

elasticstack.getElasticsearchIndexTemplate

Explore with Pulumi AI

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

    Use this data source to retrieve information about existing Elasticsearch index templates. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const ilm_history_7 = elasticstack.getElasticsearchIndexTemplate({
        name: "ilm-history-7",
    });
    export const template = ilm_history_7;
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    ilm_history_7 = elasticstack.get_elasticsearch_index_template(name="ilm-history-7")
    pulumi.export("template", ilm_history_7)
    
    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 {
    		ilm_history_7, err := elasticstack.LookupElasticsearchIndexTemplate(ctx, &elasticstack.LookupElasticsearchIndexTemplateArgs{
    			Name: "ilm-history-7",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("template", ilm_history_7)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var ilm_history_7 = Elasticstack.GetElasticsearchIndexTemplate.Invoke(new()
        {
            Name = "ilm-history-7",
        });
    
        return new Dictionary<string, object?>
        {
            ["template"] = ilm_history_7,
        };
    });
    
    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.GetElasticsearchIndexTemplateArgs;
    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 ilm-history-7 = ElasticstackFunctions.getElasticsearchIndexTemplate(GetElasticsearchIndexTemplateArgs.builder()
                .name("ilm-history-7")
                .build());
    
            ctx.export("template", ilm_history_7);
        }
    }
    
    variables:
      ilm-history-7:
        fn::invoke:
          function: elasticstack:getElasticsearchIndexTemplate
          arguments:
            name: ilm-history-7
    outputs:
      template: ${["ilm-history-7"]}
    

    Using getElasticsearchIndexTemplate

    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 getElasticsearchIndexTemplate(args: GetElasticsearchIndexTemplateArgs, opts?: InvokeOptions): Promise<GetElasticsearchIndexTemplateResult>
    function getElasticsearchIndexTemplateOutput(args: GetElasticsearchIndexTemplateOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIndexTemplateResult>
    def get_elasticsearch_index_template(elasticsearch_connection: Optional[GetElasticsearchIndexTemplateElasticsearchConnection] = None,
                                         name: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetElasticsearchIndexTemplateResult
    def get_elasticsearch_index_template_output(elasticsearch_connection: Optional[pulumi.Input[GetElasticsearchIndexTemplateElasticsearchConnectionArgs]] = None,
                                         name: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIndexTemplateResult]
    func LookupElasticsearchIndexTemplate(ctx *Context, args *LookupElasticsearchIndexTemplateArgs, opts ...InvokeOption) (*LookupElasticsearchIndexTemplateResult, error)
    func LookupElasticsearchIndexTemplateOutput(ctx *Context, args *LookupElasticsearchIndexTemplateOutputArgs, opts ...InvokeOption) LookupElasticsearchIndexTemplateResultOutput

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

    public static class GetElasticsearchIndexTemplate 
    {
        public static Task<GetElasticsearchIndexTemplateResult> InvokeAsync(GetElasticsearchIndexTemplateArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchIndexTemplateResult> Invoke(GetElasticsearchIndexTemplateInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchIndexTemplateResult> getElasticsearchIndexTemplate(GetElasticsearchIndexTemplateArgs args, InvokeOptions options)
    public static Output<GetElasticsearchIndexTemplateResult> getElasticsearchIndexTemplate(GetElasticsearchIndexTemplateArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchIndexTemplate:getElasticsearchIndexTemplate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the index template.
    ElasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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 name of the index template.
    ElasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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 name of the index template.
    elasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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 name of the index template.
    elasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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 name of the index template.
    elasticsearch_connection GetElasticsearchIndexTemplateElasticsearchConnection
    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 name of the index template.
    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

    getElasticsearchIndexTemplate Result

    The following output properties are available:

    ComposedOfs List<string>
    An ordered list of component template names.
    DataStreams List<GetElasticsearchIndexTemplateDataStream>
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    Id string
    Internal identifier of the resource
    IndexPatterns List<string>
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    Metadata string
    Optional user metadata about the index template.
    Name string
    The name of the index template.
    Priority double
    Priority to determine index template precedence when a new data stream or index is created.
    Templates List<GetElasticsearchIndexTemplateTemplate>
    Template to be applied. It may optionally include an aliases, mappings, lifecycle, or settings configuration.
    Version double
    Version number used to manage index templates externally.
    ElasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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

    ComposedOfs []string
    An ordered list of component template names.
    DataStreams []GetElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    Id string
    Internal identifier of the resource
    IndexPatterns []string
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    Metadata string
    Optional user metadata about the index template.
    Name string
    The name of the index template.
    Priority float64
    Priority to determine index template precedence when a new data stream or index is created.
    Templates []GetElasticsearchIndexTemplateTemplate
    Template to be applied. It may optionally include an aliases, mappings, lifecycle, or settings configuration.
    Version float64
    Version number used to manage index templates externally.
    ElasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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

    composedOfs List<String>
    An ordered list of component template names.
    dataStreams List<GetElasticsearchIndexTemplateDataStream>
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    id String
    Internal identifier of the resource
    indexPatterns List<String>
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    metadata String
    Optional user metadata about the index template.
    name String
    The name of the index template.
    priority Double
    Priority to determine index template precedence when a new data stream or index is created.
    templates List<GetElasticsearchIndexTemplateTemplate>
    Template to be applied. It may optionally include an aliases, mappings, lifecycle, or settings configuration.
    version Double
    Version number used to manage index templates externally.
    elasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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

    composedOfs string[]
    An ordered list of component template names.
    dataStreams GetElasticsearchIndexTemplateDataStream[]
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    id string
    Internal identifier of the resource
    indexPatterns string[]
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    metadata string
    Optional user metadata about the index template.
    name string
    The name of the index template.
    priority number
    Priority to determine index template precedence when a new data stream or index is created.
    templates GetElasticsearchIndexTemplateTemplate[]
    Template to be applied. It may optionally include an aliases, mappings, lifecycle, or settings configuration.
    version number
    Version number used to manage index templates externally.
    elasticsearchConnection GetElasticsearchIndexTemplateElasticsearchConnection
    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

    composed_ofs Sequence[str]
    An ordered list of component template names.
    data_streams Sequence[GetElasticsearchIndexTemplateDataStream]
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    id str
    Internal identifier of the resource
    index_patterns Sequence[str]
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    metadata str
    Optional user metadata about the index template.
    name str
    The name of the index template.
    priority float
    Priority to determine index template precedence when a new data stream or index is created.
    templates Sequence[GetElasticsearchIndexTemplateTemplate]
    Template to be applied. It may optionally include an aliases, mappings, lifecycle, or settings configuration.
    version float
    Version number used to manage index templates externally.
    elasticsearch_connection GetElasticsearchIndexTemplateElasticsearchConnection
    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

    composedOfs List<String>
    An ordered list of component template names.
    dataStreams List<Property Map>
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    id String
    Internal identifier of the resource
    indexPatterns List<String>
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    metadata String
    Optional user metadata about the index template.
    name String
    The name of the index template.
    priority Number
    Priority to determine index template precedence when a new data stream or index is created.
    templates List<Property Map>
    Template to be applied. It may optionally include an aliases, mappings, lifecycle, or settings configuration.
    version Number
    Version number used to manage index templates externally.
    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

    GetElasticsearchIndexTemplateDataStream

    allowCustomRouting Boolean
    hidden Boolean
    allowCustomRouting boolean
    hidden boolean
    allowCustomRouting Boolean
    hidden Boolean

    GetElasticsearchIndexTemplateElasticsearchConnection

    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.

    GetElasticsearchIndexTemplateTemplate

    GetElasticsearchIndexTemplateTemplateAlias

    Filter string
    IndexRouting string
    IsHidden bool
    IsWriteIndex bool
    Name string
    Routing string
    SearchRouting string
    Filter string
    IndexRouting string
    IsHidden bool
    IsWriteIndex bool
    Name string
    Routing string
    SearchRouting string
    filter String
    indexRouting String
    isHidden Boolean
    isWriteIndex Boolean
    name String
    routing String
    searchRouting String
    filter string
    indexRouting string
    isHidden boolean
    isWriteIndex boolean
    name string
    routing string
    searchRouting string
    filter String
    indexRouting String
    isHidden Boolean
    isWriteIndex Boolean
    name String
    routing String
    searchRouting String

    GetElasticsearchIndexTemplateTemplateLifecycle

    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