Open xsnrg opened 1 year ago
[Triage] @prudhvigodithi @phillbaker Could you help look into this issue as well? Thanks!
Related Similar issue https://github.com/opensearch-project/terraform-provider-opensearch/issues/71 Closing this, @xsnrg please re-open if required. Adding @phillbaker @david-alpert-nl @bbarani @peterzhuamazon
This is still happening, and I do not seem to have the ability to re-open.
terraform import module.es-indexes.opensearch_index_template.app app Running (inside redacted): module.es-indexes.data.aws_opensearch_domain.domain: Reading... module.es-indexes.data.aws_opensearch_domain.domain: Read complete after 1s [redacted] module.es-indexes.opensearch_index_template.app: Importing from ID "app"... module.es-indexes.opensearch_index_template.app: Import prepared! Prepared opensearch_index_template for import module.es-indexes.opensearch_index_template.app: Refreshing state... [id=app] ╷ │ Error: Cannot import non-existent remote object │ │ While attempting to import an existing object to "module.es-indexes.opensearch_index_template.app", the provider detected that no object exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or use "terraform apply" │ to create a new remote object for this resource. ╵
$ curl -H GET https://[URL]/_template/app {"app":{"order":10,"index_patterns":["app-*"],"settings":{"index":{"refresh_interval":"5s"}},"mappings":{"dynamic":"false","properties":{"exception":{"type":"text","fields":{"keyword":{"ignore_ab......
@prudhvigodithi - Are you able to re-open?
Sure @xsnrg, Adding @getsaurabh02
What is the bug?
terraform cannot import index template - not found
How can one reproduce the bug?
Create an index template in some way. In this case I create an index template with an older provider. Switch to the new provider and try to import, and it is not able to find the index.
What is the expected behavior?
The index template should import from the existing configuration by name
What is your host/environment?
MacOS for the terraform client, Server cluster is AWS Opensearch 2.7
Do you have any screenshots?
GET _cat/templates
- shows the templatesGET _index_template/*
- does not show templatesDo you have any additional context?
The cluster is running in compatibility mode, and the index template API may have changed between the provider that created the template and the one trying to import it. The console shows the index template though, so the new provider should be able to find it and import it.