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

elasticstack.ElasticsearchSnapshotLifecycle

Explore with Pulumi AI

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

    Creates or updates a snapshot lifecycle policy. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    // create a repository for snapshots
    const repo = new elasticstack.ElasticsearchSnapshotRepository("repo", {fs: {
        location: "/tmp/snapshots",
        compress: true,
        maxRestoreBytesPerSec: "20mb",
    }});
    // create a SLM policy and use the above created repository
    const slmPolicy = new elasticstack.ElasticsearchSnapshotLifecycle("slmPolicy", {
        schedule: "0 30 1 * * ?",
        snapshotName: "<daily-snap-{now/d}>",
        repository: repo.name,
        indices: [
            "data-*",
            "important",
        ],
        ignoreUnavailable: false,
        includeGlobalState: false,
        expireAfter: "30d",
        minCount: 5,
        maxCount: 50,
    });
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    # create a repository for snapshots
    repo = elasticstack.ElasticsearchSnapshotRepository("repo", fs={
        "location": "/tmp/snapshots",
        "compress": True,
        "max_restore_bytes_per_sec": "20mb",
    })
    # create a SLM policy and use the above created repository
    slm_policy = elasticstack.ElasticsearchSnapshotLifecycle("slmPolicy",
        schedule="0 30 1 * * ?",
        snapshot_name="<daily-snap-{now/d}>",
        repository=repo.name,
        indices=[
            "data-*",
            "important",
        ],
        ignore_unavailable=False,
        include_global_state=False,
        expire_after="30d",
        min_count=5,
        max_count=50)
    
    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 {
    		// create a repository for snapshots
    		repo, err := elasticstack.NewElasticsearchSnapshotRepository(ctx, "repo", &elasticstack.ElasticsearchSnapshotRepositoryArgs{
    			Fs: &elasticstack.ElasticsearchSnapshotRepositoryFsArgs{
    				Location:              pulumi.String("/tmp/snapshots"),
    				Compress:              pulumi.Bool(true),
    				MaxRestoreBytesPerSec: pulumi.String("20mb"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// create a SLM policy and use the above created repository
    		_, err = elasticstack.NewElasticsearchSnapshotLifecycle(ctx, "slmPolicy", &elasticstack.ElasticsearchSnapshotLifecycleArgs{
    			Schedule:     pulumi.String("0 30 1 * * ?"),
    			SnapshotName: pulumi.String("<daily-snap-{now/d}>"),
    			Repository:   repo.Name,
    			Indices: pulumi.StringArray{
    				pulumi.String("data-*"),
    				pulumi.String("important"),
    			},
    			IgnoreUnavailable:  pulumi.Bool(false),
    			IncludeGlobalState: pulumi.Bool(false),
    			ExpireAfter:        pulumi.String("30d"),
    			MinCount:           pulumi.Float64(5),
    			MaxCount:           pulumi.Float64(50),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        // create a repository for snapshots
        var repo = new Elasticstack.ElasticsearchSnapshotRepository("repo", new()
        {
            Fs = new Elasticstack.Inputs.ElasticsearchSnapshotRepositoryFsArgs
            {
                Location = "/tmp/snapshots",
                Compress = true,
                MaxRestoreBytesPerSec = "20mb",
            },
        });
    
        // create a SLM policy and use the above created repository
        var slmPolicy = new Elasticstack.ElasticsearchSnapshotLifecycle("slmPolicy", new()
        {
            Schedule = "0 30 1 * * ?",
            SnapshotName = "<daily-snap-{now/d}>",
            Repository = repo.Name,
            Indices = new[]
            {
                "data-*",
                "important",
            },
            IgnoreUnavailable = false,
            IncludeGlobalState = false,
            ExpireAfter = "30d",
            MinCount = 5,
            MaxCount = 50,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.elasticstack.ElasticsearchSnapshotRepository;
    import com.pulumi.elasticstack.ElasticsearchSnapshotRepositoryArgs;
    import com.pulumi.elasticstack.inputs.ElasticsearchSnapshotRepositoryFsArgs;
    import com.pulumi.elasticstack.ElasticsearchSnapshotLifecycle;
    import com.pulumi.elasticstack.ElasticsearchSnapshotLifecycleArgs;
    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) {
            // create a repository for snapshots
            var repo = new ElasticsearchSnapshotRepository("repo", ElasticsearchSnapshotRepositoryArgs.builder()
                .fs(ElasticsearchSnapshotRepositoryFsArgs.builder()
                    .location("/tmp/snapshots")
                    .compress(true)
                    .maxRestoreBytesPerSec("20mb")
                    .build())
                .build());
    
            // create a SLM policy and use the above created repository
            var slmPolicy = new ElasticsearchSnapshotLifecycle("slmPolicy", ElasticsearchSnapshotLifecycleArgs.builder()
                .schedule("0 30 1 * * ?")
                .snapshotName("<daily-snap-{now/d}>")
                .repository(repo.name())
                .indices(            
                    "data-*",
                    "important")
                .ignoreUnavailable(false)
                .includeGlobalState(false)
                .expireAfter("30d")
                .minCount(5)
                .maxCount(50)
                .build());
    
        }
    }
    
    resources:
      # create a repository for snapshots
      repo:
        type: elasticstack:ElasticsearchSnapshotRepository
        properties:
          fs:
            location: /tmp/snapshots
            compress: true
            maxRestoreBytesPerSec: 20mb
      # create a SLM policy and use the above created repository
      slmPolicy:
        type: elasticstack:ElasticsearchSnapshotLifecycle
        properties:
          schedule: 0 30 1 * * ?
          snapshotName: <daily-snap-{now/d}>
          repository: ${repo.name}
          indices:
            - data-*
            - important
          ignoreUnavailable: false
          includeGlobalState: false
          expireAfter: 30d
          minCount: 5
          maxCount: 50
    

    Create ElasticsearchSnapshotLifecycle Resource

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

    Constructor syntax

    new ElasticsearchSnapshotLifecycle(name: string, args: ElasticsearchSnapshotLifecycleArgs, opts?: CustomResourceOptions);
    @overload
    def ElasticsearchSnapshotLifecycle(resource_name: str,
                                       args: ElasticsearchSnapshotLifecycleArgs,
                                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ElasticsearchSnapshotLifecycle(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       repository: Optional[str] = None,
                                       schedule: Optional[str] = None,
                                       indices: Optional[Sequence[str]] = None,
                                       feature_states: Optional[Sequence[str]] = None,
                                       ignore_unavailable: Optional[bool] = None,
                                       include_global_state: Optional[bool] = None,
                                       elasticsearch_connection: Optional[ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs] = None,
                                       max_count: Optional[float] = None,
                                       metadata: Optional[str] = None,
                                       min_count: Optional[float] = None,
                                       name: Optional[str] = None,
                                       partial: Optional[bool] = None,
                                       expire_after: Optional[str] = None,
                                       expand_wildcards: Optional[str] = None,
                                       snapshot_name: Optional[str] = None)
    func NewElasticsearchSnapshotLifecycle(ctx *Context, name string, args ElasticsearchSnapshotLifecycleArgs, opts ...ResourceOption) (*ElasticsearchSnapshotLifecycle, error)
    public ElasticsearchSnapshotLifecycle(string name, ElasticsearchSnapshotLifecycleArgs args, CustomResourceOptions? opts = null)
    public ElasticsearchSnapshotLifecycle(String name, ElasticsearchSnapshotLifecycleArgs args)
    public ElasticsearchSnapshotLifecycle(String name, ElasticsearchSnapshotLifecycleArgs args, CustomResourceOptions options)
    
    type: elasticstack:ElasticsearchSnapshotLifecycle
    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 ElasticsearchSnapshotLifecycleArgs
    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 ElasticsearchSnapshotLifecycleArgs
    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 ElasticsearchSnapshotLifecycleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ElasticsearchSnapshotLifecycleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ElasticsearchSnapshotLifecycleArgs
    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 elasticsearchSnapshotLifecycleResource = new Elasticstack.ElasticsearchSnapshotLifecycle("elasticsearchSnapshotLifecycleResource", new()
    {
        Repository = "string",
        Schedule = "string",
        Indices = new[]
        {
            "string",
        },
        FeatureStates = new[]
        {
            "string",
        },
        IgnoreUnavailable = false,
        IncludeGlobalState = false,
        MaxCount = 0,
        Metadata = "string",
        MinCount = 0,
        Name = "string",
        Partial = false,
        ExpireAfter = "string",
        ExpandWildcards = "string",
        SnapshotName = "string",
    });
    
    example, err := elasticstack.NewElasticsearchSnapshotLifecycle(ctx, "elasticsearchSnapshotLifecycleResource", &elasticstack.ElasticsearchSnapshotLifecycleArgs{
    	Repository: pulumi.String("string"),
    	Schedule:   pulumi.String("string"),
    	Indices: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	FeatureStates: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	IgnoreUnavailable:  pulumi.Bool(false),
    	IncludeGlobalState: pulumi.Bool(false),
    	MaxCount:           pulumi.Float64(0),
    	Metadata:           pulumi.String("string"),
    	MinCount:           pulumi.Float64(0),
    	Name:               pulumi.String("string"),
    	Partial:            pulumi.Bool(false),
    	ExpireAfter:        pulumi.String("string"),
    	ExpandWildcards:    pulumi.String("string"),
    	SnapshotName:       pulumi.String("string"),
    })
    
    var elasticsearchSnapshotLifecycleResource = new ElasticsearchSnapshotLifecycle("elasticsearchSnapshotLifecycleResource", ElasticsearchSnapshotLifecycleArgs.builder()
        .repository("string")
        .schedule("string")
        .indices("string")
        .featureStates("string")
        .ignoreUnavailable(false)
        .includeGlobalState(false)
        .maxCount(0)
        .metadata("string")
        .minCount(0)
        .name("string")
        .partial(false)
        .expireAfter("string")
        .expandWildcards("string")
        .snapshotName("string")
        .build());
    
    elasticsearch_snapshot_lifecycle_resource = elasticstack.ElasticsearchSnapshotLifecycle("elasticsearchSnapshotLifecycleResource",
        repository="string",
        schedule="string",
        indices=["string"],
        feature_states=["string"],
        ignore_unavailable=False,
        include_global_state=False,
        max_count=0,
        metadata="string",
        min_count=0,
        name="string",
        partial=False,
        expire_after="string",
        expand_wildcards="string",
        snapshot_name="string")
    
    const elasticsearchSnapshotLifecycleResource = new elasticstack.ElasticsearchSnapshotLifecycle("elasticsearchSnapshotLifecycleResource", {
        repository: "string",
        schedule: "string",
        indices: ["string"],
        featureStates: ["string"],
        ignoreUnavailable: false,
        includeGlobalState: false,
        maxCount: 0,
        metadata: "string",
        minCount: 0,
        name: "string",
        partial: false,
        expireAfter: "string",
        expandWildcards: "string",
        snapshotName: "string",
    });
    
    type: elasticstack:ElasticsearchSnapshotLifecycle
    properties:
        expandWildcards: string
        expireAfter: string
        featureStates:
            - string
        ignoreUnavailable: false
        includeGlobalState: false
        indices:
            - string
        maxCount: 0
        metadata: string
        minCount: 0
        name: string
        partial: false
        repository: string
        schedule: string
        snapshotName: string
    

    ElasticsearchSnapshotLifecycle 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 ElasticsearchSnapshotLifecycle resource accepts the following input properties:

    Repository string
    Repository used to store snapshots created by this policy.
    Schedule string
    Periodic or absolute schedule at which the policy creates snapshots.
    ElasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnection
    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

    ExpandWildcards string
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    ExpireAfter string
    Time period after which a snapshot is considered expired and eligible for deletion.
    FeatureStates List<string>
    Feature states to include in the snapshot.
    IgnoreUnavailable bool
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    IncludeGlobalState bool
    If true, include the cluster state in the snapshot.
    Indices List<string>
    Comma-separated list of data streams and indices to include in the snapshot.
    MaxCount double
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    Metadata string
    Attaches arbitrary metadata to the snapshot.
    MinCount double
    Minimum number of snapshots to retain, even if the snapshots have expired.
    Name string
    ID for the snapshot lifecycle policy you want to create or update.
    Partial bool
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    SnapshotName string
    Name automatically assigned to each snapshot created by the policy.
    Repository string
    Repository used to store snapshots created by this policy.
    Schedule string
    Periodic or absolute schedule at which the policy creates snapshots.
    ElasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs
    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

    ExpandWildcards string
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    ExpireAfter string
    Time period after which a snapshot is considered expired and eligible for deletion.
    FeatureStates []string
    Feature states to include in the snapshot.
    IgnoreUnavailable bool
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    IncludeGlobalState bool
    If true, include the cluster state in the snapshot.
    Indices []string
    Comma-separated list of data streams and indices to include in the snapshot.
    MaxCount float64
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    Metadata string
    Attaches arbitrary metadata to the snapshot.
    MinCount float64
    Minimum number of snapshots to retain, even if the snapshots have expired.
    Name string
    ID for the snapshot lifecycle policy you want to create or update.
    Partial bool
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    SnapshotName string
    Name automatically assigned to each snapshot created by the policy.
    repository String
    Repository used to store snapshots created by this policy.
    schedule String
    Periodic or absolute schedule at which the policy creates snapshots.
    elasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnection
    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

    expandWildcards String
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expireAfter String
    Time period after which a snapshot is considered expired and eligible for deletion.
    featureStates List<String>
    Feature states to include in the snapshot.
    ignoreUnavailable Boolean
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    includeGlobalState Boolean
    If true, include the cluster state in the snapshot.
    indices List<String>
    Comma-separated list of data streams and indices to include in the snapshot.
    maxCount Double
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata String
    Attaches arbitrary metadata to the snapshot.
    minCount Double
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name String
    ID for the snapshot lifecycle policy you want to create or update.
    partial Boolean
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    snapshotName String
    Name automatically assigned to each snapshot created by the policy.
    repository string
    Repository used to store snapshots created by this policy.
    schedule string
    Periodic or absolute schedule at which the policy creates snapshots.
    elasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnection
    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

    expandWildcards string
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expireAfter string
    Time period after which a snapshot is considered expired and eligible for deletion.
    featureStates string[]
    Feature states to include in the snapshot.
    ignoreUnavailable boolean
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    includeGlobalState boolean
    If true, include the cluster state in the snapshot.
    indices string[]
    Comma-separated list of data streams and indices to include in the snapshot.
    maxCount number
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata string
    Attaches arbitrary metadata to the snapshot.
    minCount number
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name string
    ID for the snapshot lifecycle policy you want to create or update.
    partial boolean
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    snapshotName string
    Name automatically assigned to each snapshot created by the policy.
    repository str
    Repository used to store snapshots created by this policy.
    schedule str
    Periodic or absolute schedule at which the policy creates snapshots.
    elasticsearch_connection ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs
    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

    expand_wildcards str
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expire_after str
    Time period after which a snapshot is considered expired and eligible for deletion.
    feature_states Sequence[str]
    Feature states to include in the snapshot.
    ignore_unavailable bool
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    include_global_state bool
    If true, include the cluster state in the snapshot.
    indices Sequence[str]
    Comma-separated list of data streams and indices to include in the snapshot.
    max_count float
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata str
    Attaches arbitrary metadata to the snapshot.
    min_count float
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name str
    ID for the snapshot lifecycle policy you want to create or update.
    partial bool
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    snapshot_name str
    Name automatically assigned to each snapshot created by the policy.
    repository String
    Repository used to store snapshots created by this policy.
    schedule String
    Periodic or absolute schedule at which the policy creates snapshots.
    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

    expandWildcards String
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expireAfter String
    Time period after which a snapshot is considered expired and eligible for deletion.
    featureStates List<String>
    Feature states to include in the snapshot.
    ignoreUnavailable Boolean
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    includeGlobalState Boolean
    If true, include the cluster state in the snapshot.
    indices List<String>
    Comma-separated list of data streams and indices to include in the snapshot.
    maxCount Number
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata String
    Attaches arbitrary metadata to the snapshot.
    minCount Number
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name String
    ID for the snapshot lifecycle policy you want to create or update.
    partial Boolean
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    snapshotName String
    Name automatically assigned to each snapshot created by the policy.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ElasticsearchSnapshotLifecycle 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 ElasticsearchSnapshotLifecycle Resource

    Get an existing ElasticsearchSnapshotLifecycle 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?: ElasticsearchSnapshotLifecycleState, opts?: CustomResourceOptions): ElasticsearchSnapshotLifecycle
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            elasticsearch_connection: Optional[ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs] = None,
            expand_wildcards: Optional[str] = None,
            expire_after: Optional[str] = None,
            feature_states: Optional[Sequence[str]] = None,
            ignore_unavailable: Optional[bool] = None,
            include_global_state: Optional[bool] = None,
            indices: Optional[Sequence[str]] = None,
            max_count: Optional[float] = None,
            metadata: Optional[str] = None,
            min_count: Optional[float] = None,
            name: Optional[str] = None,
            partial: Optional[bool] = None,
            repository: Optional[str] = None,
            schedule: Optional[str] = None,
            snapshot_name: Optional[str] = None) -> ElasticsearchSnapshotLifecycle
    func GetElasticsearchSnapshotLifecycle(ctx *Context, name string, id IDInput, state *ElasticsearchSnapshotLifecycleState, opts ...ResourceOption) (*ElasticsearchSnapshotLifecycle, error)
    public static ElasticsearchSnapshotLifecycle Get(string name, Input<string> id, ElasticsearchSnapshotLifecycleState? state, CustomResourceOptions? opts = null)
    public static ElasticsearchSnapshotLifecycle get(String name, Output<String> id, ElasticsearchSnapshotLifecycleState state, CustomResourceOptions options)
    resources:  _:    type: elasticstack:ElasticsearchSnapshotLifecycle    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:
    ElasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnection
    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

    ExpandWildcards string
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    ExpireAfter string
    Time period after which a snapshot is considered expired and eligible for deletion.
    FeatureStates List<string>
    Feature states to include in the snapshot.
    IgnoreUnavailable bool
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    IncludeGlobalState bool
    If true, include the cluster state in the snapshot.
    Indices List<string>
    Comma-separated list of data streams and indices to include in the snapshot.
    MaxCount double
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    Metadata string
    Attaches arbitrary metadata to the snapshot.
    MinCount double
    Minimum number of snapshots to retain, even if the snapshots have expired.
    Name string
    ID for the snapshot lifecycle policy you want to create or update.
    Partial bool
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    Repository string
    Repository used to store snapshots created by this policy.
    Schedule string
    Periodic or absolute schedule at which the policy creates snapshots.
    SnapshotName string
    Name automatically assigned to each snapshot created by the policy.
    ElasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs
    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

    ExpandWildcards string
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    ExpireAfter string
    Time period after which a snapshot is considered expired and eligible for deletion.
    FeatureStates []string
    Feature states to include in the snapshot.
    IgnoreUnavailable bool
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    IncludeGlobalState bool
    If true, include the cluster state in the snapshot.
    Indices []string
    Comma-separated list of data streams and indices to include in the snapshot.
    MaxCount float64
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    Metadata string
    Attaches arbitrary metadata to the snapshot.
    MinCount float64
    Minimum number of snapshots to retain, even if the snapshots have expired.
    Name string
    ID for the snapshot lifecycle policy you want to create or update.
    Partial bool
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    Repository string
    Repository used to store snapshots created by this policy.
    Schedule string
    Periodic or absolute schedule at which the policy creates snapshots.
    SnapshotName string
    Name automatically assigned to each snapshot created by the policy.
    elasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnection
    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

    expandWildcards String
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expireAfter String
    Time period after which a snapshot is considered expired and eligible for deletion.
    featureStates List<String>
    Feature states to include in the snapshot.
    ignoreUnavailable Boolean
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    includeGlobalState Boolean
    If true, include the cluster state in the snapshot.
    indices List<String>
    Comma-separated list of data streams and indices to include in the snapshot.
    maxCount Double
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata String
    Attaches arbitrary metadata to the snapshot.
    minCount Double
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name String
    ID for the snapshot lifecycle policy you want to create or update.
    partial Boolean
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    repository String
    Repository used to store snapshots created by this policy.
    schedule String
    Periodic or absolute schedule at which the policy creates snapshots.
    snapshotName String
    Name automatically assigned to each snapshot created by the policy.
    elasticsearchConnection ElasticsearchSnapshotLifecycleElasticsearchConnection
    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

    expandWildcards string
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expireAfter string
    Time period after which a snapshot is considered expired and eligible for deletion.
    featureStates string[]
    Feature states to include in the snapshot.
    ignoreUnavailable boolean
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    includeGlobalState boolean
    If true, include the cluster state in the snapshot.
    indices string[]
    Comma-separated list of data streams and indices to include in the snapshot.
    maxCount number
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata string
    Attaches arbitrary metadata to the snapshot.
    minCount number
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name string
    ID for the snapshot lifecycle policy you want to create or update.
    partial boolean
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    repository string
    Repository used to store snapshots created by this policy.
    schedule string
    Periodic or absolute schedule at which the policy creates snapshots.
    snapshotName string
    Name automatically assigned to each snapshot created by the policy.
    elasticsearch_connection ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs
    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

    expand_wildcards str
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expire_after str
    Time period after which a snapshot is considered expired and eligible for deletion.
    feature_states Sequence[str]
    Feature states to include in the snapshot.
    ignore_unavailable bool
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    include_global_state bool
    If true, include the cluster state in the snapshot.
    indices Sequence[str]
    Comma-separated list of data streams and indices to include in the snapshot.
    max_count float
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata str
    Attaches arbitrary metadata to the snapshot.
    min_count float
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name str
    ID for the snapshot lifecycle policy you want to create or update.
    partial bool
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    repository str
    Repository used to store snapshots created by this policy.
    schedule str
    Periodic or absolute schedule at which the policy creates snapshots.
    snapshot_name str
    Name automatically assigned to each snapshot created by the policy.
    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

    expandWildcards String
    Determines how wildcard patterns in the indices parameter match data streams and indices. Supports comma-separated values, such as closed,hidden.
    expireAfter String
    Time period after which a snapshot is considered expired and eligible for deletion.
    featureStates List<String>
    Feature states to include in the snapshot.
    ignoreUnavailable Boolean
    If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices.
    includeGlobalState Boolean
    If true, include the cluster state in the snapshot.
    indices List<String>
    Comma-separated list of data streams and indices to include in the snapshot.
    maxCount Number
    Maximum number of snapshots to retain, even if the snapshots have not yet expired.
    metadata String
    Attaches arbitrary metadata to the snapshot.
    minCount Number
    Minimum number of snapshots to retain, even if the snapshots have expired.
    name String
    ID for the snapshot lifecycle policy you want to create or update.
    partial Boolean
    If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available.
    repository String
    Repository used to store snapshots created by this policy.
    schedule String
    Periodic or absolute schedule at which the policy creates snapshots.
    snapshotName String
    Name automatically assigned to each snapshot created by the policy.

    Supporting Types

    ElasticsearchSnapshotLifecycleElasticsearchConnection, ElasticsearchSnapshotLifecycleElasticsearchConnectionArgs

    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.

    Import

    $ pulumi import elasticstack:index/elasticsearchSnapshotLifecycle:ElasticsearchSnapshotLifecycle my_policy <cluster_uuid>/<slm policy 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