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

opensearch_index_template stopped working on opensearch <2.0 eventhough it's documented as working #112

Open
arianvp opened this issue Oct 24, 2023 · 12 comments · May be fixed by #129
Open
Assignees

Comments

@arianvp
Copy link

arianvp commented Oct 24, 2023

This introduces a nasty bug! opensearch_index_template is supposed to call _template not _index_template. Now this doesn't behave as documented. The documentation states that opensearch_composable_index_template calls _index_template and you should use opensearch_index_template on opensearch <2.0 but now both resources use the same endpoint.

Originally posted by @arianvp in #62 (comment)

@prudhvigodithi
Copy link
Member

Thanks @arianvp can you please contribute with the fix?
Thanks

@prudhvigodithi
Copy link
Member

[Untriage]
Adding @premkirank @afrodidact

@premkirank
Copy link
Contributor

@prudhvigodithi I would like to work on this

@prudhvigodithi
Copy link
Member

Thanks @premkirank

@prudhvigodithi
Copy link
Member

Thanks for your PR @premkirank.
@arianvp the idea for using Provider 2.x is for OpenSearch version 2.x series, did you try with https://registry.terraform.io/providers/opensearch-project/opensearch/1.0.0 for 1.x series of OpenSearch

More info on compatibility: https://github.com/opensearch-project/terraform-provider-opensearch#compatibility, https://github.com/opensearch-project/terraform-provider-opensearch/tree/1.x#compatibility

@sharathganga
Copy link

@prudhvigodithi I'm facing the same issue described above after upgrading to OpenSearch 2.x, I cannot update the opensearch_index_template resources that were created using provider version 1.0.0. When I upgrade to provider version 2.0.0, the plan says that the new resources will be created.

@prudhvigodithi
Copy link
Member

prudhvigodithi commented Feb 3, 2024

Hey @sharathganga may I please know what is the OpenSearch cluster version you are using when used 1.0.0 and 2.x, also can you share the full config file?
Adding @rblcoder @bbarani

@sharathganga
Copy link

@prudhvigodithi I'm using AWS Opensearch version 2.11. The index templates were created when I was using AWS Opensearch 1.3 and provider 1.0.0. After upgrading the cluster 2.11, I cannot update the index template settings using the same provider version 1.0.0.

Upgraded the provider to the latest version 2.2.0 and the terraform plan shows that the index templates will be recreated using the new _index_template endpoint.

@prudhvigodithi
Copy link
Member

Adding @rblcoder

@prudhvigodithi
Copy link
Member

I had a call with @rblcoder and the behaviour is expected. The _template is legacy and looks like they replaced by the composable templates. For information about composable templates please check
https://opensearch.org/docs/2.11/im-plugin/index-templates/,
https://opster.com/guides/opensearch/opensearch-data-architecture/index-templating-in-opensearch-how-to-use-composable-templates/

Also the go client olivere/elastic used routes the requests to _index_templates

@rblcoder @bbarani @peterzhuamazon @gaiksaya please add your thoughts as well.

Tagging index-management owners to please provide some insights on _template and _index_template
@bowenlan-amzn @getsaurabh02 @lezzago @amsiglan @AWSHurneyt

Thank you

@prudhvigodithi
Copy link
Member

Exact commit in olivere/elastic that depreciated the _template.

@rblcoder
Copy link
Collaborator

I have posted a question in the OpenSearch Community https://forum.opensearch.org/t/differences-between-legacy-template-and-index-template/17831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📦 Backlog
5 participants