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

r/aws_opensearch_domain: handle unset auto_tune_options.rollback_on_disable #37394

Merged
merged 4 commits into from
May 9, 2024

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented May 9, 2024

Description

Previously omitting this optional argument resulted in a failure when creating or updating the domain:

Error: modifying config for OpenSearch Domain: ValidationException: 1 validation error detected: Value '' at 'autoTuneOptions.rollbackOnDisable' failed to satisfy constraint: Member must satisfy enum value set: [DEFAULT_ROLLBACK, NO_ROLLBACK]

The auto_tune_options expander logic has been updated to properly handle cases where rollback_on_disable is unset.

Also adds a missing waiter in create operation when auto_tune_options are configured.

Relations

Closes #37234

References

Output from Acceptance Testing

% make testacc PKG=opensearch TESTS=TestAccOpenSearchDomain_autoTuneOptions
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/opensearch/... -v -count 1 -parallel 20 -run='TestAccOpenSearchDomain_autoTuneOptions'  -timeout 360m

--- PASS: TestAccOpenSearchDomain_autoTuneOptions (1915.20s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/opensearch 1920.265s
% make testacc PKG=elasticsearch TESTS=TestAccElasticsearchDomain_AutoTuneOptions
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/elasticsearch/... -v -count 1 -parallel 20 -run='TestAccElasticsearchDomain_AutoTuneOptions'  -timeout 360m

--- PASS: TestAccElasticsearchDomain_AutoTuneOptions (2287.79s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch      2292.708s

Copy link

github-actions bot commented May 9, 2024

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/opensearch Issues and PRs that pertain to the opensearch service. labels May 9, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 9, 2024
@jar-b jar-b marked this pull request as draft May 9, 2024 17:20
jar-b added 4 commits May 9, 2024 13:20
This fixes an issue observed during domain creation when `auto_tune_options` are configured. `auto_tune_options` are set after the cluster becomes active via the `UpdateDomain` API. The provider was not waiting for this update to complete before calling the read operation, which can result in incorrect `auto_tune_options` data being written to state. The appropriate waiter has been added to prevent this failure mode.
…isable

Previously omitting this optional argument resulted in a failure when creating or updating the domain:

```
Error: modifying config for OpenSearch Domain: ValidationException: 1 validation error detected: Value '' at 'autoTuneOptions.rollbackOnDisable' failed to satisfy constraint: Member must satisfy enum value set: [DEFAULT_ROLLBACK, NO_ROLLBACK]
```

The `auto_tune_options` expander logic has been updated to properly handle cases where `rollback_on_disable` is unset.

```console
% make testacc PKG=opensearch TESTS=TestAccOpenSearchDomain_autoTuneOptions
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/opensearch/... -v -count 1 -parallel 20 -run='TestAccOpenSearchDomain_autoTuneOptions'  -timeout 360m

--- PASS: TestAccOpenSearchDomain_autoTuneOptions (1915.20s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/opensearch 1920.265s
```
…n_disable

Previously omitting this optional argument resulted in a failure when creating or updating the domain:

```
Error: modifying config for OpenSearch Domain: ValidationException: 1 validation error detected: Value '' at 'autoTuneOptions.rollbackOnDisable' failed to satisfy constraint: Member must satisfy enum value set: [DEFAULT_ROLLBACK, NO_ROLLBACK]
```

The `auto_tune_options` expander logic has been updated to properly handle cases where `rollback_on_disable` is unset.

```console
% make testacc PKG=elasticsearch TESTS=TestAccElasticsearchDomain_AutoTuneOptions
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/elasticsearch/... -v -count 1 -parallel 20 -run='TestAccElasticsearchDomain_AutoTuneOptions'  -timeout 360m
=== RUN   TestAccElasticsearchDomain_AutoTuneOptions
=== PAUSE TestAccElasticsearchDomain_AutoTuneOptions
=== CONT  TestAccElasticsearchDomain_AutoTuneOptions
--- PASS: TestAccElasticsearchDomain_AutoTuneOptions (2287.79s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch      2292.708s
```
@jar-b jar-b force-pushed the b-opensearch_domain-autotune branch from 245fd1f to fb7a829 Compare May 9, 2024 17:20
@jar-b jar-b marked this pull request as ready for review May 9, 2024 18:03
@jar-b jar-b merged commit 1e2a92d into main May 9, 2024
43 checks passed
@jar-b jar-b deleted the b-opensearch_domain-autotune branch May 9, 2024 18:28
@github-actions github-actions bot added this to the v5.49.0 milestone May 9, 2024
github-actions bot pushed a commit that referenced this pull request May 9, 2024
Copy link

This functionality has been released in v5.49.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 10, 2024
Copy link

I'm going to lock this pull request 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 related to this change, 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 Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/opensearch Issues and PRs that pertain to the opensearch service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: r/aws_opensearch_domain: omitting auto_tune_options.rollback_on_disable causes creation failure
1 participant