Skip to content

[Bug]: OpenSearch upgrade can lead to resource recreation #39263

@wincus

Description

@wincus

Terraform Core Version

1.9.5

AWS Provider Version

5.66.0

Affected Resource(s)

  • aws_elasticsearch_domain

Expected Behavior

If the resource is planned for an upgrade with a unsupported target version terraform should fail instead of resulting of a full cluster destroy / create operation.

Actual Behavior

If the target version is not listed as compatible the provider instructs terraform to delete the resource first and then create a new cluster with the target version resulting on a full cluster recreation. This is usually not what users want.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_elasticsearch_domain" "this" {
  domain_name           = "test-opensearch-cluster"
  elasticsearch_version  = "OpenSearch_1.0"
  cluster_config {
    instance_type       = "t3.small.elasticsearch"
    instance_count      = 1
  }
}

Steps to Reproduce

  • Create the cluster with version OpenSearch_1.0
  • Change elasticsearch_version from OpenSearch_1.0 to Opensearch_1.3 ( note that there is a typo in the target version )
  • Run terraform apply
  • The cluster is destroyed ( since target version is not listed as compatible )

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/elasticsearchIssues and PRs that pertain to the elasticsearch service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions