hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.17k forks source link

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

Open wincus opened 1 month ago

wincus commented 1 month ago

Terraform Core Version

1.9.5

AWS Provider Version

5.66.0

Affected Resource(s)

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

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue