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

elasticstack.ElasticsearchIndexTemplate

Explore with Pulumi AI

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

    Creates or updates an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const myTemplate = new elasticstack.ElasticsearchIndexTemplate("myTemplate", {
        priority: 42,
        indexPatterns: [
            "logstash*",
            "filebeat*",
        ],
        template: {
            aliases: [
                {
                    name: "my_template_test",
                },
                {
                    name: "another_test",
                },
            ],
            settings: JSON.stringify({
                number_of_shards: "3",
            }),
        },
    });
    const myDataStream = new elasticstack.ElasticsearchIndexTemplate("myDataStream", {
        indexPatterns: ["stream*"],
        dataStream: {},
    });
    
    import pulumi
    import json
    import pulumi_elasticstack as elasticstack
    
    my_template = elasticstack.ElasticsearchIndexTemplate("myTemplate",
        priority=42,
        index_patterns=[
            "logstash*",
            "filebeat*",
        ],
        template={
            "aliases": [
                {
                    "name": "my_template_test",
                },
                {
                    "name": "another_test",
                },
            ],
            "settings": json.dumps({
                "number_of_shards": "3",
            }),
        })
    my_data_stream = elasticstack.ElasticsearchIndexTemplate("myDataStream",
        index_patterns=["stream*"],
        data_stream={})
    
    package main
    
    import (
    	"encoding/json"
    
    	"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 {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"number_of_shards": "3",
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = elasticstack.NewElasticsearchIndexTemplate(ctx, "myTemplate", &elasticstack.ElasticsearchIndexTemplateArgs{
    			Priority: pulumi.Float64(42),
    			IndexPatterns: pulumi.StringArray{
    				pulumi.String("logstash*"),
    				pulumi.String("filebeat*"),
    			},
    			Template: &elasticstack.ElasticsearchIndexTemplateTemplateArgs{
    				Aliases: elasticstack.ElasticsearchIndexTemplateTemplateAliasArray{
    					&elasticstack.ElasticsearchIndexTemplateTemplateAliasArgs{
    						Name: pulumi.String("my_template_test"),
    					},
    					&elasticstack.ElasticsearchIndexTemplateTemplateAliasArgs{
    						Name: pulumi.String("another_test"),
    					},
    				},
    				Settings: pulumi.String(json0),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = elasticstack.NewElasticsearchIndexTemplate(ctx, "myDataStream", &elasticstack.ElasticsearchIndexTemplateArgs{
    			IndexPatterns: pulumi.StringArray{
    				pulumi.String("stream*"),
    			},
    			DataStream: &elasticstack.ElasticsearchIndexTemplateDataStreamArgs{},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var myTemplate = new Elasticstack.ElasticsearchIndexTemplate("myTemplate", new()
        {
            Priority = 42,
            IndexPatterns = new[]
            {
                "logstash*",
                "filebeat*",
            },
            Template = new Elasticstack.Inputs.ElasticsearchIndexTemplateTemplateArgs
            {
                Aliases = new[]
                {
                    new Elasticstack.Inputs.ElasticsearchIndexTemplateTemplateAliasArgs
                    {
                        Name = "my_template_test",
                    },
                    new Elasticstack.Inputs.ElasticsearchIndexTemplateTemplateAliasArgs
                    {
                        Name = "another_test",
                    },
                },
                Settings = JsonSerializer.Serialize(new Dictionary<string, object?>
                {
                    ["number_of_shards"] = "3",
                }),
            },
        });
    
        var myDataStream = new Elasticstack.ElasticsearchIndexTemplate("myDataStream", new()
        {
            IndexPatterns = new[]
            {
                "stream*",
            },
            DataStream = null,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.elasticstack.ElasticsearchIndexTemplate;
    import com.pulumi.elasticstack.ElasticsearchIndexTemplateArgs;
    import com.pulumi.elasticstack.inputs.ElasticsearchIndexTemplateTemplateArgs;
    import com.pulumi.elasticstack.inputs.ElasticsearchIndexTemplateDataStreamArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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) {
            var myTemplate = new ElasticsearchIndexTemplate("myTemplate", ElasticsearchIndexTemplateArgs.builder()
                .priority(42)
                .indexPatterns(            
                    "logstash*",
                    "filebeat*")
                .template(ElasticsearchIndexTemplateTemplateArgs.builder()
                    .aliases(                
                        ElasticsearchIndexTemplateTemplateAliasArgs.builder()
                            .name("my_template_test")
                            .build(),
                        ElasticsearchIndexTemplateTemplateAliasArgs.builder()
                            .name("another_test")
                            .build())
                    .settings(serializeJson(
                        jsonObject(
                            jsonProperty("number_of_shards", "3")
                        )))
                    .build())
                .build());
    
            var myDataStream = new ElasticsearchIndexTemplate("myDataStream", ElasticsearchIndexTemplateArgs.builder()
                .indexPatterns("stream*")
                .dataStream()
                .build());
    
        }
    }
    
    resources:
      myTemplate:
        type: elasticstack:ElasticsearchIndexTemplate
        properties:
          priority: 42
          indexPatterns:
            - logstash*
            - filebeat*
          template:
            aliases:
              - name: my_template_test
              - name: another_test
            settings:
              fn::toJSON:
                number_of_shards: '3'
      myDataStream:
        type: elasticstack:ElasticsearchIndexTemplate
        properties:
          indexPatterns:
            - stream*
          dataStream: {}
    

    Create ElasticsearchIndexTemplate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ElasticsearchIndexTemplate(name: string, args: ElasticsearchIndexTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def ElasticsearchIndexTemplate(resource_name: str,
                                   args: ElasticsearchIndexTemplateArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ElasticsearchIndexTemplate(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   index_patterns: Optional[Sequence[str]] = None,
                                   composed_ofs: Optional[Sequence[str]] = None,
                                   data_stream: Optional[ElasticsearchIndexTemplateDataStreamArgs] = None,
                                   elasticsearch_connection: Optional[ElasticsearchIndexTemplateElasticsearchConnectionArgs] = None,
                                   metadata: Optional[str] = None,
                                   name: Optional[str] = None,
                                   priority: Optional[float] = None,
                                   template: Optional[ElasticsearchIndexTemplateTemplateArgs] = None,
                                   version: Optional[float] = None)
    func NewElasticsearchIndexTemplate(ctx *Context, name string, args ElasticsearchIndexTemplateArgs, opts ...ResourceOption) (*ElasticsearchIndexTemplate, error)
    public ElasticsearchIndexTemplate(string name, ElasticsearchIndexTemplateArgs args, CustomResourceOptions? opts = null)
    public ElasticsearchIndexTemplate(String name, ElasticsearchIndexTemplateArgs args)
    public ElasticsearchIndexTemplate(String name, ElasticsearchIndexTemplateArgs args, CustomResourceOptions options)
    
    type: elasticstack:ElasticsearchIndexTemplate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ElasticsearchIndexTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ElasticsearchIndexTemplateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ElasticsearchIndexTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ElasticsearchIndexTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ElasticsearchIndexTemplateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var elasticsearchIndexTemplateResource = new Elasticstack.ElasticsearchIndexTemplate("elasticsearchIndexTemplateResource", new()
    {
        IndexPatterns = new[]
        {
            "string",
        },
        ComposedOfs = new[]
        {
            "string",
        },
        DataStream = new Elasticstack.Inputs.ElasticsearchIndexTemplateDataStreamArgs
        {
            AllowCustomRouting = false,
            Hidden = false,
        },
        Metadata = "string",
        Name = "string",
        Priority = 0,
        Template = new Elasticstack.Inputs.ElasticsearchIndexTemplateTemplateArgs
        {
            Aliases = new[]
            {
                new Elasticstack.Inputs.ElasticsearchIndexTemplateTemplateAliasArgs
                {
                    Name = "string",
                    Filter = "string",
                    IndexRouting = "string",
                    IsHidden = false,
                    IsWriteIndex = false,
                    Routing = "string",
                    SearchRouting = "string",
                },
            },
            Lifecycle = new Elasticstack.Inputs.ElasticsearchIndexTemplateTemplateLifecycleArgs
            {
                DataRetention = "string",
            },
            Mappings = "string",
            Settings = "string",
        },
        Version = 0,
    });
    
    example, err := elasticstack.NewElasticsearchIndexTemplate(ctx, "elasticsearchIndexTemplateResource", &elasticstack.ElasticsearchIndexTemplateArgs{
    	IndexPatterns: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ComposedOfs: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DataStream: &elasticstack.ElasticsearchIndexTemplateDataStreamArgs{
    		AllowCustomRouting: pulumi.Bool(false),
    		Hidden:             pulumi.Bool(false),
    	},
    	Metadata: pulumi.String("string"),
    	Name:     pulumi.String("string"),
    	Priority: pulumi.Float64(0),
    	Template: &elasticstack.ElasticsearchIndexTemplateTemplateArgs{
    		Aliases: elasticstack.ElasticsearchIndexTemplateTemplateAliasArray{
    			&elasticstack.ElasticsearchIndexTemplateTemplateAliasArgs{
    				Name:          pulumi.String("string"),
    				Filter:        pulumi.String("string"),
    				IndexRouting:  pulumi.String("string"),
    				IsHidden:      pulumi.Bool(false),
    				IsWriteIndex:  pulumi.Bool(false),
    				Routing:       pulumi.String("string"),
    				SearchRouting: pulumi.String("string"),
    			},
    		},
    		Lifecycle: &elasticstack.ElasticsearchIndexTemplateTemplateLifecycleArgs{
    			DataRetention: pulumi.String("string"),
    		},
    		Mappings: pulumi.String("string"),
    		Settings: pulumi.String("string"),
    	},
    	Version: pulumi.Float64(0),
    })
    
    var elasticsearchIndexTemplateResource = new ElasticsearchIndexTemplate("elasticsearchIndexTemplateResource", ElasticsearchIndexTemplateArgs.builder()
        .indexPatterns("string")
        .composedOfs("string")
        .dataStream(ElasticsearchIndexTemplateDataStreamArgs.builder()
            .allowCustomRouting(false)
            .hidden(false)
            .build())
        .metadata("string")
        .name("string")
        .priority(0)
        .template(ElasticsearchIndexTemplateTemplateArgs.builder()
            .aliases(ElasticsearchIndexTemplateTemplateAliasArgs.builder()
                .name("string")
                .filter("string")
                .indexRouting("string")
                .isHidden(false)
                .isWriteIndex(false)
                .routing("string")
                .searchRouting("string")
                .build())
            .lifecycle(ElasticsearchIndexTemplateTemplateLifecycleArgs.builder()
                .dataRetention("string")
                .build())
            .mappings("string")
            .settings("string")
            .build())
        .version(0)
        .build());
    
    elasticsearch_index_template_resource = elasticstack.ElasticsearchIndexTemplate("elasticsearchIndexTemplateResource",
        index_patterns=["string"],
        composed_ofs=["string"],
        data_stream={
            "allow_custom_routing": False,
            "hidden": False,
        },
        metadata="string",
        name="string",
        priority=0,
        template={
            "aliases": [{
                "name": "string",
                "filter": "string",
                "index_routing": "string",
                "is_hidden": False,
                "is_write_index": False,
                "routing": "string",
                "search_routing": "string",
            }],
            "lifecycle": {
                "data_retention": "string",
            },
            "mappings": "string",
            "settings": "string",
        },
        version=0)
    
    const elasticsearchIndexTemplateResource = new elasticstack.ElasticsearchIndexTemplate("elasticsearchIndexTemplateResource", {
        indexPatterns: ["string"],
        composedOfs: ["string"],
        dataStream: {
            allowCustomRouting: false,
            hidden: false,
        },
        metadata: "string",
        name: "string",
        priority: 0,
        template: {
            aliases: [{
                name: "string",
                filter: "string",
                indexRouting: "string",
                isHidden: false,
                isWriteIndex: false,
                routing: "string",
                searchRouting: "string",
            }],
            lifecycle: {
                dataRetention: "string",
            },
            mappings: "string",
            settings: "string",
        },
        version: 0,
    });
    
    type: elasticstack:ElasticsearchIndexTemplate
    properties:
        composedOfs:
            - string
        dataStream:
            allowCustomRouting: false
            hidden: false
        indexPatterns:
            - string
        metadata: string
        name: string
        priority: 0
        template:
            aliases:
                - filter: string
                  indexRouting: string
                  isHidden: false
                  isWriteIndex: false
                  name: string
                  routing: string
                  searchRouting: string
            lifecycle:
                dataRetention: string
            mappings: string
            settings: string
        version: 0
    

    ElasticsearchIndexTemplate Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ElasticsearchIndexTemplate resource accepts the following input properties:

    IndexPatterns List<string>
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    ComposedOfs List<string>
    An ordered list of component template names.
    DataStream ElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    ElasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnection
    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

    Metadata string
    Optional user metadata about the index template.
    Name string
    Name of the index template to create.
    Priority double
    Priority to determine index template precedence when a new data stream or index is created.
    Template ElasticsearchIndexTemplateTemplate
    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.
    IndexPatterns []string
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    ComposedOfs []string
    An ordered list of component template names.
    DataStream ElasticsearchIndexTemplateDataStreamArgs
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    ElasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnectionArgs
    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

    Metadata string
    Optional user metadata about the index template.
    Name string
    Name of the index template to create.
    Priority float64
    Priority to determine index template precedence when a new data stream or index is created.
    Template ElasticsearchIndexTemplateTemplateArgs
    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.
    indexPatterns List<String>
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    composedOfs List<String>
    An ordered list of component template names.
    dataStream ElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    elasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnection
    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

    metadata String
    Optional user metadata about the index template.
    name String
    Name of the index template to create.
    priority Double
    Priority to determine index template precedence when a new data stream or index is created.
    template ElasticsearchIndexTemplateTemplate
    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.
    indexPatterns string[]
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    composedOfs string[]
    An ordered list of component template names.
    dataStream ElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    elasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnection
    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

    metadata string
    Optional user metadata about the index template.
    name string
    Name of the index template to create.
    priority number
    Priority to determine index template precedence when a new data stream or index is created.
    template ElasticsearchIndexTemplateTemplate
    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.
    index_patterns Sequence[str]
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    composed_ofs Sequence[str]
    An ordered list of component template names.
    data_stream ElasticsearchIndexTemplateDataStreamArgs
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    elasticsearch_connection ElasticsearchIndexTemplateElasticsearchConnectionArgs
    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

    metadata str
    Optional user metadata about the index template.
    name str
    Name of the index template to create.
    priority float
    Priority to determine index template precedence when a new data stream or index is created.
    template ElasticsearchIndexTemplateTemplateArgs
    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.
    indexPatterns List<String>
    Array of wildcard (*) expressions used to match the names of data streams and indices during creation.
    composedOfs List<String>
    An ordered list of component template names.
    dataStream Property Map
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    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

    metadata String
    Optional user metadata about the index template.
    name String
    Name of the index template to create.
    priority Number
    Priority to determine index template precedence when a new data stream or index is created.
    template 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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ElasticsearchIndexTemplate resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ElasticsearchIndexTemplate Resource

    Get an existing ElasticsearchIndexTemplate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ElasticsearchIndexTemplateState, opts?: CustomResourceOptions): ElasticsearchIndexTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            composed_ofs: Optional[Sequence[str]] = None,
            data_stream: Optional[ElasticsearchIndexTemplateDataStreamArgs] = None,
            elasticsearch_connection: Optional[ElasticsearchIndexTemplateElasticsearchConnectionArgs] = None,
            index_patterns: Optional[Sequence[str]] = None,
            metadata: Optional[str] = None,
            name: Optional[str] = None,
            priority: Optional[float] = None,
            template: Optional[ElasticsearchIndexTemplateTemplateArgs] = None,
            version: Optional[float] = None) -> ElasticsearchIndexTemplate
    func GetElasticsearchIndexTemplate(ctx *Context, name string, id IDInput, state *ElasticsearchIndexTemplateState, opts ...ResourceOption) (*ElasticsearchIndexTemplate, error)
    public static ElasticsearchIndexTemplate Get(string name, Input<string> id, ElasticsearchIndexTemplateState? state, CustomResourceOptions? opts = null)
    public static ElasticsearchIndexTemplate get(String name, Output<String> id, ElasticsearchIndexTemplateState state, CustomResourceOptions options)
    resources:  _:    type: elasticstack:ElasticsearchIndexTemplate    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ComposedOfs List<string>
    An ordered list of component template names.
    DataStream ElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    ElasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnection
    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

    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
    Name of the index template to create.
    Priority double
    Priority to determine index template precedence when a new data stream or index is created.
    Template ElasticsearchIndexTemplateTemplate
    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.
    ComposedOfs []string
    An ordered list of component template names.
    DataStream ElasticsearchIndexTemplateDataStreamArgs
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    ElasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnectionArgs
    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

    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
    Name of the index template to create.
    Priority float64
    Priority to determine index template precedence when a new data stream or index is created.
    Template ElasticsearchIndexTemplateTemplateArgs
    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.
    composedOfs List<String>
    An ordered list of component template names.
    dataStream ElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    elasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnection
    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

    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
    Name of the index template to create.
    priority Double
    Priority to determine index template precedence when a new data stream or index is created.
    template ElasticsearchIndexTemplateTemplate
    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.
    composedOfs string[]
    An ordered list of component template names.
    dataStream ElasticsearchIndexTemplateDataStream
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    elasticsearchConnection ElasticsearchIndexTemplateElasticsearchConnection
    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

    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
    Name of the index template to create.
    priority number
    Priority to determine index template precedence when a new data stream or index is created.
    template ElasticsearchIndexTemplateTemplate
    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.
    composed_ofs Sequence[str]
    An ordered list of component template names.
    data_stream ElasticsearchIndexTemplateDataStreamArgs
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    elasticsearch_connection ElasticsearchIndexTemplateElasticsearchConnectionArgs
    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

    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
    Name of the index template to create.
    priority float
    Priority to determine index template precedence when a new data stream or index is created.
    template ElasticsearchIndexTemplateTemplateArgs
    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.
    composedOfs List<String>
    An ordered list of component template names.
    dataStream Property Map
    If this object is included, the template is used to create data streams and their backing indices. Supports an empty object.
    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

    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
    Name of the index template to create.
    priority Number
    Priority to determine index template precedence when a new data stream or index is created.
    template 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.

    Supporting Types

    ElasticsearchIndexTemplateDataStream, ElasticsearchIndexTemplateDataStreamArgs

    AllowCustomRouting bool
    If true, the data stream supports custom routing. Defaults to false. Available only in 8.x
    Hidden bool
    If true, the data stream is hidden.
    AllowCustomRouting bool
    If true, the data stream supports custom routing. Defaults to false. Available only in 8.x
    Hidden bool
    If true, the data stream is hidden.
    allowCustomRouting Boolean
    If true, the data stream supports custom routing. Defaults to false. Available only in 8.x
    hidden Boolean
    If true, the data stream is hidden.
    allowCustomRouting boolean
    If true, the data stream supports custom routing. Defaults to false. Available only in 8.x
    hidden boolean
    If true, the data stream is hidden.
    allow_custom_routing bool
    If true, the data stream supports custom routing. Defaults to false. Available only in 8.x
    hidden bool
    If true, the data stream is hidden.
    allowCustomRouting Boolean
    If true, the data stream supports custom routing. Defaults to false. Available only in 8.x
    hidden Boolean
    If true, the data stream is hidden.

    ElasticsearchIndexTemplateElasticsearchConnection, ElasticsearchIndexTemplateElasticsearchConnectionArgs

    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.

    ElasticsearchIndexTemplateTemplate, ElasticsearchIndexTemplateTemplateArgs

    Aliases List<ElasticsearchIndexTemplateTemplateAlias>
    Alias to add.
    Lifecycle ElasticsearchIndexTemplateTemplateLifecycle
    Lifecycle of data stream. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle.html
    Mappings string
    Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details
    Settings string
    Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings
    Aliases []ElasticsearchIndexTemplateTemplateAlias
    Alias to add.
    Lifecycle ElasticsearchIndexTemplateTemplateLifecycle
    Lifecycle of data stream. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle.html
    Mappings string
    Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details
    Settings string
    Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings
    aliases List<ElasticsearchIndexTemplateTemplateAlias>
    Alias to add.
    lifecycle ElasticsearchIndexTemplateTemplateLifecycle
    Lifecycle of data stream. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle.html
    mappings String
    Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details
    settings String
    Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings
    aliases ElasticsearchIndexTemplateTemplateAlias[]
    Alias to add.
    lifecycle ElasticsearchIndexTemplateTemplateLifecycle
    Lifecycle of data stream. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle.html
    mappings string
    Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details
    settings string
    Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings
    aliases Sequence[ElasticsearchIndexTemplateTemplateAlias]
    Alias to add.
    lifecycle ElasticsearchIndexTemplateTemplateLifecycle
    Lifecycle of data stream. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle.html
    mappings str
    Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details
    settings str
    Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings
    aliases List<Property Map>
    Alias to add.
    lifecycle Property Map
    Lifecycle of data stream. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle.html
    mappings String
    Mapping for fields in the index. Should be specified as a JSON object of field mappings. See the documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html) for more details
    settings String
    Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings

    ElasticsearchIndexTemplateTemplateAlias, ElasticsearchIndexTemplateTemplateAliasArgs

    Name string
    The alias name.
    Filter string
    Query used to limit documents the alias can access.
    IndexRouting string
    Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations.
    IsHidden bool
    If true, the alias is hidden.
    IsWriteIndex bool
    If true, the index is the write index for the alias.
    Routing string
    Value used to route indexing and search operations to a specific shard.
    SearchRouting string
    Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations.
    Name string
    The alias name.
    Filter string
    Query used to limit documents the alias can access.
    IndexRouting string
    Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations.
    IsHidden bool
    If true, the alias is hidden.
    IsWriteIndex bool
    If true, the index is the write index for the alias.
    Routing string
    Value used to route indexing and search operations to a specific shard.
    SearchRouting string
    Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations.
    name String
    The alias name.
    filter String
    Query used to limit documents the alias can access.
    indexRouting String
    Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations.
    isHidden Boolean
    If true, the alias is hidden.
    isWriteIndex Boolean
    If true, the index is the write index for the alias.
    routing String
    Value used to route indexing and search operations to a specific shard.
    searchRouting String
    Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations.
    name string
    The alias name.
    filter string
    Query used to limit documents the alias can access.
    indexRouting string
    Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations.
    isHidden boolean
    If true, the alias is hidden.
    isWriteIndex boolean
    If true, the index is the write index for the alias.
    routing string
    Value used to route indexing and search operations to a specific shard.
    searchRouting string
    Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations.
    name str
    The alias name.
    filter str
    Query used to limit documents the alias can access.
    index_routing str
    Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations.
    is_hidden bool
    If true, the alias is hidden.
    is_write_index bool
    If true, the index is the write index for the alias.
    routing str
    Value used to route indexing and search operations to a specific shard.
    search_routing str
    Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations.
    name String
    The alias name.
    filter String
    Query used to limit documents the alias can access.
    indexRouting String
    Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations.
    isHidden Boolean
    If true, the alias is hidden.
    isWriteIndex Boolean
    If true, the index is the write index for the alias.
    routing String
    Value used to route indexing and search operations to a specific shard.
    searchRouting String
    Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations.

    ElasticsearchIndexTemplateTemplateLifecycle, ElasticsearchIndexTemplateTemplateLifecycleArgs

    DataRetention string
    The retention period of the data indexed in this data stream.
    DataRetention string
    The retention period of the data indexed in this data stream.
    dataRetention String
    The retention period of the data indexed in this data stream.
    dataRetention string
    The retention period of the data indexed in this data stream.
    data_retention str
    The retention period of the data indexed in this data stream.
    dataRetention String
    The retention period of the data indexed in this data stream.

    Import

    $ pulumi import elasticstack:index/elasticsearchIndexTemplate:ElasticsearchIndexTemplate my_template <cluster_uuid>/<template_name>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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