Is your feature request related to a problem?
The elasticstack_elasticsearch_index_template resource's template block does not support data_stream_options, which was introduced in Elasticsearch 9.x. This prevents enabling the failure store for data streams via Terraform, requiring out-of-band API calls and creating configuration drift between Terraform state and actual cluster configuration.
Describe the solution you'd like
Add a data_stream_options block inside the template block of elasticstack_elasticsearch_index_template. This should support at minimum the failure_store.enabled boolean.
Desired HCL syntax:
resource "elasticstack_elasticsearch_index_template" "example" {
name = "my-index-template"
index_patterns = ["my-datastream-*"]
template {
data_stream_options {
failure_store {
enabled = true
}
}
}
data_stream {}
}
The corresponding Elasticsearch API:
PUT _index_template/my-index-template
{
"index_patterns": ["my-datastream-*"],
"data_stream": {},
"template": {
"data_stream_options": {
"failure_store": {
"enabled": true
}
}
}
}
Describe alternatives you've considered
Using terraform_data with local-exec to GET the index template from Elasticsearch, patch in data_stream_options via jq, and PUT it back. This works but breaks infrastructure-as-code principles, requires curl/jq as dependencies, and creates drift between Terraform state and actual cluster configuration.
Additional context
Is your feature request related to a problem?
The
elasticstack_elasticsearch_index_templateresource'stemplateblock does not supportdata_stream_options, which was introduced in Elasticsearch 9.x. This prevents enabling the failure store for data streams via Terraform, requiring out-of-band API calls and creating configuration drift between Terraform state and actual cluster configuration.Describe the solution you'd like
Add a
data_stream_optionsblock inside thetemplateblock ofelasticstack_elasticsearch_index_template. This should support at minimum thefailure_store.enabledboolean.Desired HCL syntax:
The corresponding Elasticsearch API:
Describe alternatives you've considered
Using
terraform_datawithlocal-execto GET the index template from Elasticsearch, patch indata_stream_optionsviajq, and PUT it back. This works but breaks infrastructure-as-code principles, requirescurl/jqas dependencies, and creates drift between Terraform state and actual cluster configuration.Additional context
data_stream_optionsfield is part of the index template API starting in Elasticsearch 9.x