From a259b303049becce8a67f0465863bb0d4f606186 Mon Sep 17 00:00:00 2001 From: berimbolo13 Date: Tue, 25 Nov 2025 15:47:58 +0800 Subject: [PATCH 1/3] opensearch: Remove 10-minute delays from domain creation and deletion --- CHANGELOG.md | 1 + internal/service/opensearch/wait.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b33b92dffccf..ae26b94f73ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ ENHANCEMENTS: * resource/aws_fis_experiment_template: Add support for `Functions` to `action.*.target` ([#41209](https://github.com/hashicorp/terraform-provider-aws/issues/41209)) * resource/aws_lambda_invocation: Add import support ([#41240](https://github.com/hashicorp/terraform-provider-aws/issues/41240)) * resource/aws_lb_listener: Support `jwt-validation` as a valid `default_action.type` and add `default_action.jwt_validation` configuration block ([#45089](https://github.com/hashicorp/terraform-provider-aws/issues/45089)) +* resource/aws_opensearch_domain: Remove hardcoded 10-minute delay before polling domain state during creation and deletion ([#45244](https://github.com/hashicorp/terraform-provider-aws/issues/45244)) * resource/aws_lb_listener_rule: Support `jwt-validation` as a valid `action.type` and add `action.jwt_validation` configuration block ([#45089](https://github.com/hashicorp/terraform-provider-aws/issues/45089)) * resource/aws_odb_cloud_vm_cluster: vm cluster creation using odb network ARN and exadata infrastructure ARN for resource sharing model. ([#45003](https://github.com/hashicorp/terraform-provider-aws/issues/45003)) * resource/aws_organizations_organization: Add `SECURITYHUB_POLICY` as a valid value for `enabled_policy_types` argument ([#45135](https://github.com/hashicorp/terraform-provider-aws/issues/45135)) diff --git a/internal/service/opensearch/wait.go b/internal/service/opensearch/wait.go index 1c1a7a560851..26a8ab02db1a 100644 --- a/internal/service/opensearch/wait.go +++ b/internal/service/opensearch/wait.go @@ -58,7 +58,7 @@ func waitForDomainCreation(ctx context.Context, conn *opensearch.Client, domainN return tfresource.RetryableError( fmt.Errorf("%q: Timeout while waiting for OpenSearch Domain to be created", domainName)) - }, tfresource.WithDelay(10*time.Minute), tfresource.WithPollInterval(10*time.Second)) + }, tfresource.WithPollInterval(10*time.Second)) if err != nil { return fmt.Errorf("waiting for OpenSearch Domain to be created: %w", err) @@ -109,7 +109,7 @@ func waitForDomainDelete(ctx context.Context, conn *opensearch.Client, domainNam } return tfresource.RetryableError(fmt.Errorf("timeout while waiting for the OpenSearch Domain %q to be deleted", domainName)) - }, tfresource.WithDelay(10*time.Minute), tfresource.WithPollInterval(10*time.Second)) + }, tfresource.WithPollInterval(10*time.Second)) if err != nil { return fmt.Errorf("waiting for OpenSearch Domain to be deleted: %w", err) From 44472a424385a9ac397105bcd2a90e6da766a501 Mon Sep 17 00:00:00 2001 From: berimbolo13 Date: Tue, 25 Nov 2025 16:09:16 +0800 Subject: [PATCH 2/3] Use .changelog directory instead of modifying CHANGELOG.md directly --- .changelog/45245.txt | 3 +++ CHANGELOG.md | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .changelog/45245.txt diff --git a/.changelog/45245.txt b/.changelog/45245.txt new file mode 100644 index 000000000000..f85db4bf389b --- /dev/null +++ b/.changelog/45245.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_opensearch_domain: Remove hardcoded 10-minute delay before polling domain state during creation and deletion +``` diff --git a/CHANGELOG.md b/CHANGELOG.md index ae26b94f73ac..b33b92dffccf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,7 +61,6 @@ ENHANCEMENTS: * resource/aws_fis_experiment_template: Add support for `Functions` to `action.*.target` ([#41209](https://github.com/hashicorp/terraform-provider-aws/issues/41209)) * resource/aws_lambda_invocation: Add import support ([#41240](https://github.com/hashicorp/terraform-provider-aws/issues/41240)) * resource/aws_lb_listener: Support `jwt-validation` as a valid `default_action.type` and add `default_action.jwt_validation` configuration block ([#45089](https://github.com/hashicorp/terraform-provider-aws/issues/45089)) -* resource/aws_opensearch_domain: Remove hardcoded 10-minute delay before polling domain state during creation and deletion ([#45244](https://github.com/hashicorp/terraform-provider-aws/issues/45244)) * resource/aws_lb_listener_rule: Support `jwt-validation` as a valid `action.type` and add `action.jwt_validation` configuration block ([#45089](https://github.com/hashicorp/terraform-provider-aws/issues/45089)) * resource/aws_odb_cloud_vm_cluster: vm cluster creation using odb network ARN and exadata infrastructure ARN for resource sharing model. ([#45003](https://github.com/hashicorp/terraform-provider-aws/issues/45003)) * resource/aws_organizations_organization: Add `SECURITYHUB_POLICY` as a valid value for `enabled_policy_types` argument ([#45135](https://github.com/hashicorp/terraform-provider-aws/issues/45135)) From 99f5bd63b6ca385f8de1bd404e5f756294bd7388 Mon Sep 17 00:00:00 2001 From: berimbolo13 Date: Tue, 25 Nov 2025 17:01:07 +0800 Subject: [PATCH 3/3] Remove 1-minute delay from waitForDomainUpdate for consistency For consistency with create and delete operations, remove the 1-minute delay from update operations as well. All three operations now poll immediately with a 10-second interval. --- .changelog/45245.txt | 2 +- internal/service/opensearch/wait.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/45245.txt b/.changelog/45245.txt index f85db4bf389b..18016bcc5cb6 100644 --- a/.changelog/45245.txt +++ b/.changelog/45245.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_opensearch_domain: Remove hardcoded 10-minute delay before polling domain state during creation and deletion +resource/aws_opensearch_domain: Remove hardcoded delays before polling domain state during creation, update, and deletion operations ``` diff --git a/internal/service/opensearch/wait.go b/internal/service/opensearch/wait.go index 26a8ab02db1a..3a829d5768d8 100644 --- a/internal/service/opensearch/wait.go +++ b/internal/service/opensearch/wait.go @@ -82,7 +82,7 @@ func waitForDomainUpdate(ctx context.Context, conn *opensearch.Client, domainNam return tfresource.RetryableError( fmt.Errorf("%q: Timeout while waiting for changes to be processed", domainName)) - }, tfresource.WithDelay(1*time.Minute), tfresource.WithPollInterval(10*time.Second)) + }, tfresource.WithPollInterval(10*time.Second)) if err != nil { return fmt.Errorf("waiting for OpenSearch Domain changes to be processed: %w", err)