I am trying to upgrade the domain from elastic search 7.10 to OpenSearch 1.0
It’s pretty straight forward to update via web app, just like how its shown below but how do we do this via terraform?
How do I upgrade my elastic search version to Open search 1.0 via Terraform? I am not able to find out any documentation in regards to this, is this something thats being worked on or Am I missing something? Any suggestion or help is much appreciated.
Please do yourself a favour and use “OpenSearch_1.0” and not “OS_1.0”. It is translated properly but you will run into mismatches on consecutive runs causing resource to be destroyed.
If use “OS_1.1” it will destroy the existing resource and recreate a new one, below is the output, shows it will destroy, add new and change the endpoint if applied.
# aws_elasticsearch_domain.elasticsearch must be replaced
-/+ resource "aws_elasticsearch_domain" "elasticsearch" {
...
~ advanced_options = {
- "override_main_response_version" = "false"
- "rest.action.multi.allow_explicit_index" = "true"
} -> (known after apply)
~ arn = "existing-omitted" -> (known after apply)
~ elasticsearch_version = "7.10" -> "OS_1.1" # forces replacement
~ endpoint = "omitted" -> (known after apply)
~ kibana_endpoint = "omitted" -> (known after apply)
Plan: 1 to add, 3 to change, 1 to destroy.
While if you use “OpenSearch_1.1” it upgrade the elasticsearch version
# aws_elasticsearch_domain.elasticsearch will be updated in-place
~ resource "aws_elasticsearch_domain" "elasticsearch" {
...
~ elasticsearch_version = "7.10" -> "OpenSearch_1.1"
Plan: 0 to add, 3 to change, 0 to destroy.
Its recommended to use “OpenSearch_1.1” to avoid recreation of new resource.