Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "elasticsearch_index_template" resource is using the legacy /_template API endpoint #88

Closed
haywoood opened this issue Sep 17, 2020 · 7 comments

Comments

@haywoood
Copy link

Not sure there is going to be any action needed from this library, but figured I'd link the two issues.

olivere/elastic#1393

I was trying to create this resource:

resource "elasticsearch_index_template" "logs-haywood4-template" {
  name = "logs-haywood4-template"
  body = <<-EOF
{
  "index_patterns": ["logs-haywood4-*"],
  "data_stream": {},
  "composed_of": ["logs-mappings"],
  "template": {
    "settings": {
      "index.lifecycle.name": "logs-epr-ilm",
      "index.codec": "best_compression",
      "index.query.default_field": ["message"]
    }
  }
}
EOF
}

But it failed to apply because of a 400 error from Elasticsearch. Downstream, the legacy /_template endpoint is being used instead of the new /_index_template endpoint.

@ruflin
Copy link

ruflin commented Sep 18, 2020

@haywoood The only work around I can think of at the moment, is to just not load a template and use the default one. I would hope this works. At the same time I do not want to consume more time of you for this as what you created works and is the most important part here.

We can still iterate later on this again and improve it!

Update: I commented on the wrong issue 🤦‍♂️

@haywoood
Copy link
Author

@ruflin yea, the only problem is that the default ILM policy won't work for us, neither is missing the no hot/warm default that will arrive in 7.10.

@ruflin
Copy link

ruflin commented Sep 21, 2020

@haywoood Please ignore me on this thread, I commented on the wrong issue 🤦‍♂️

@phillbaker
Copy link
Owner

I'd suggest contributing a PR upstream for this, which will then need to be pulled into this provider.

It looks like this endpoint was added in ES7.8 - I'm not sure how we want to handle that in the provider, we're currently only differentiating based on major versions of ES which tie to major versions of the client.

@z0rc
Copy link

z0rc commented Oct 13, 2020

In addition to new endpoint it would nice to have support of "component templates" which is also part of ES 7.8. Tracked at olivere/elastic#1388

It looks like this endpoint was added in ES7.8 - I'm not sure how we want to handle that in the provider, we're currently only differentiating based on major versions of ES which tie to major versions of the client.

I'd suggest introducing new resources for component templates and index templates.

@haywoood
Copy link
Author

introducing new resources for component templates and index templates

++

@phillbaker
Copy link
Owner

Going to close this as composable templates were added in #120. Component templates support is being tracked upstream in olivere/elastic#1414, a new issue can be opened to support that when upstream support is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants