Skip to content

[Bug] ILM : elasticstack_elasticsearch_index_lifecycle does not support downsample attribute #378

@fludo

Description

@fludo

Describe the bug
The provider does not know how to handle downsample parameter in ILM
https://registry.terraform.io/providers/elastic/elasticstack/latest/docs/resources/elasticsearch_index_lifecycle

To Reproduce
Steps to reproduce the behavior:

  1. Import an ILM in terraform (for example .monitoring-8-ilm-policy)
  2. Change the down sample settings via Kibana (for example enable on cold for 1 minute interval), see screenshot
  3. Terraform plan
  4. Error:
    module.elk.module.pipelines.elasticstack_elasticsearch_index_lifecycle.templated_lifecycle[".monitoring-8-ilm-policy"]: Refreshing state... [id=G_zwXyyZTgGRjMDbIOoR2Q/.monitoring-8-ilm-policy] ╷ │ Error: Invalid address to set: []string{"cold", "0", "downsample"} │ │ with module.elk.module.pipelines.elasticstack_elasticsearch_index_lifecycle.templated_lifecycle[".monitoring-8-ilm-policy"], │ on ../../modules/elk/assets/index_lifecycle.tf line 1, in resource "elasticstack_elasticsearch_index_lifecycle" "templated_lifecycle": │ 1: resource "elasticstack_elasticsearch_index_lifecycle" "templated_lifecycle" { │ ╵
    Note: we wrapped the ressource in a module but should not make a difference in the state refresh step

Expected behavior
A diff on terraform showing that downsample settings was set outside terraform
or
Possibility to specify downsample using the provider

Debug output
not needed here

Screenshots
image

Versions (please complete the following information):

  • OS: Elastic on Elastic Cloud
  • Terraform Version 1.5.2
  • Provider version 0.6.1
  • Elasticsearch Version 8.8.2

Additional context
ILM Downsample documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions