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

aws_elasticsearch_domain does not support instance types with .search suffix instead of .elasticsearch #22574

Closed
tmccombs opened this issue Jan 13, 2022 · 6 comments · Fixed by #23902
Assignees
Labels
bug Addresses a defect in current functionality. service/elasticsearch Issues and PRs that pertain to the elasticsearch service.
Milestone

Comments

@tmccombs
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v1.1.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/archive v2.2.0
+ provider registry.terraform.io/hashicorp/aws v3.63.0
+ provider registry.terraform.io/hashicorp/external v2.1.1
+ provider registry.terraform.io/hashicorp/random v3.1.0

Affected Resource(s)

  • aws_elasticsearch_domain

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_elasticsearch_domain" "example" {
 // ...
 instance_type = "m6g.large.search"
}

Error Output

╷
│ Error: ValidationException: 1 validation error detected: Value 'm6g.large.search' at 'elasticsearchClusterConfig.instanceType' failed to satisfy constraint: Member must satisfy enum value set: [r6gd.12xlarge.elasticsearch, i3.2xlarge.elasticsearch, ultrawarm1.xlarge.elasticsearch, m5.4xlarge.elasticsearch, t3.xlarge.elasticsearch, m6g.xlarge.elasticsearch, i3.4xlarge.elasticsearch, m3.large.elasticsearch, m6g.12xlarge.elasticsearch, r4.16xlarge.elasticsearch, t2.micro.elasticsearch, m4.large.elasticsearch, r6gd.16xlarge.elasticsearch, d2.2xlarge.elasticsearch, t3.micro.elasticsearch, m5.large.elasticsearch, i3.8xlarge.elasticsearch, i3.large.elasticsearch, d2.4xlarge.elasticsearch, t2.small.elasticsearch, c4.2xlarge.elasticsearch, t3.small.elasticsearch, c5.2xlarge.elasticsearch, c4.4xlarge.elasticsearch, c6g.2xlarge.elasticsearch, d2.8xlarge.elasticsearch, c5.4xlarge.elasticsearch, t4g.medium.elasticsearch, c6g.4xlarge.elasticsearch, c6g.xlarge.elasticsearch, m3.medium.elasticsearch, c6g.12xlarge.elasticsearch, c4.8xlarge.elasticsearch, c4.large.elasticsearch, c5.xlarge.elasticsearch, c5.large.elasticsearch, t4g.small.elasticsearch, c4.xlarge.elasticsearch, c5.9xlarge.elasticsearch, c6g.8xlarge.elasticsearch, c6g.large.elasticsearch, d2.xlarge.elasticsearch, ultrawarm1.medium.elasticsearch, t3.nano.elasticsearch, t3.medium.elasticsearch, m6g.2xlarge.elasticsearch, t2.medium.elasticsearch, t3.2xlarge.elasticsearch, c5.18xlarge.elasticsearch, m6g.4xlarge.elasticsearch, i3.xlarge.elasticsearch, r6gd.2xlarge.elasticsearch, i2.xlarge.elasticsearch, r3.2xlarge.elasticsearch, r4.2xlarge.elasticsearch, m5.xlarge.elasticsearch, m4.10xlarge.elasticsearch, r6gd.4xlarge.elasticsearch, r6g.2xlarge.elasticsearch, r3.4xlarge.elasticsearch, r5.2xlarge.elasticsearch, m5.12xlarge.elasticsearch, m4.xlarge.elasticsearch, m6g.8xlarge.elasticsearch, m6g.large.elasticsearch, r4.4xlarge.elasticsearch, m5.24xlarge.elasticsearch, m3.xlarge.elasticsearch, r6g.4xlarge.elasticsearch, i3.16xlarge.elasticsearch, t3.large.elasticsearch, r5.4xlarge.elasticsearch, ultrawarm1.large.elasticsearch, m3.2xlarge.elasticsearch, r6gd.8xlarge.elasticsearch, r6gd.large.elasticsearch, r6g.xlarge.elasticsearch, r3.8xlarge.elasticsearch, r3.large.elasticsearch, r5.xlarge.elasticsearch, m4.2xlarge.elasticsearch, r6g.12xlarge.elasticsearch, r4.8xlarge.elasticsearch, r4.xlarge.elasticsearch, r4.large.elasticsearch, r5.12xlarge.elasticsearch, m5.2xlarge.elasticsearch, r6gd.xlarge.elasticsearch, r6g.8xlarge.elasticsearch, r6g.large.elasticsearch, i2.2xlarge.elasticsearch, r3.xlarge.elasticsearch, r5.24xlarge.elasticsearch, r5.large.elasticsearch, m4.4xlarge.elasticsearch]

during apply (no error during plan)

Expected Behavior

I should be able to use the instance types listed at https://aws.amazon.com/opensearch-service/pricing/ in the instance_type property of aws_elasticsearch_domain

Actual Behavior

Instead of using the instance types listed on the pricing page, I need to instead replace the ".search" suffix with ".elasticsearch"

Steps to Reproduce

  1. Create config for an elasticsearch domain that uses an instance type as listed on the pricing page with a ".search" suffix
  2. terraform apply

Important Factoids

I believe this is because the aws_elasticsearch_domain is using the deprecated elasticsearchservice API instead of the new opensearch API.

See https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/opensearch@v1.6.0/types#OpenSearchPartitionInstanceType and https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/elasticsearchservice@v1.12.0/types#ESPartitionInstanceType

Suggested solutions:

Either:

  1. Switch to using the opensearch API, and for backwards compatibility continue to accept the ".elasticsearch" suffix, but when applying actually use the ".search" suffix. Would probably need some way to not show a diff if the config is "elasticsearch" but the state is "search"
  2. Accept a ".search" suffix, but change it to ".elasticsearch" when applying. Would probably need some way to not show a diff if the config is "search" but the state is "elasticsearch".

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. labels Jan 13, 2022
@tmccombs
Copy link
Contributor Author

Another potential option: Create a new aws_opensearch_domain resource type and deprecate aws_elasticsearch_domain (and similarly for other elasticsearch resources).

@tmccombs
Copy link
Contributor Author

I'm also willing to try implementing a solution for this, although I'm not sure what the preferred approach would be.

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 13, 2022
@hayata-yamamoto
Copy link

+1

at least, I would developers to add new instance types in elasticsearch only if it's compatibility mode to OpenSearch.
It leads misunderstanding because of gaps between aws console and terraform...

@luisamador
Copy link

I've just hit this too

@github-actions github-actions bot added this to the v4.9.0 milestone Mar 30, 2022
@YakDriver YakDriver self-assigned this Mar 30, 2022
@github-actions
Copy link

github-actions bot commented Apr 7, 2022

This functionality has been released in v4.9.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented May 8, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elasticsearch Issues and PRs that pertain to the elasticsearch service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants