From 0f1d73a2d29a0d4b4a570cb0dbc922791161e87c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 00:12:49 -0800 Subject: [PATCH 001/227] `acctest` --- internal/acctest/acctest.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index 0b6c418f5e8..a019856b76e 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -63,6 +63,7 @@ import ( tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" "github.com/hashicorp/terraform-provider-aws/internal/provider" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfaccount "github.com/hashicorp/terraform-provider-aws/internal/service/account" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" @@ -1164,7 +1165,7 @@ func PreCheckOrganizationsAccount(ctx context.Context, t *testing.T) { _, err := tforganizations.FindOrganization(ctx, Provider.Meta().(*conns.AWSClient).OrganizationsClient(ctx)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -1200,7 +1201,7 @@ func PreCheckOrganizationsEnabledWithProvider(ctx context.Context, t *testing.T, organization, err := tforganizations.FindOrganization(ctx, providerF().Meta().(*conns.AWSClient).OrganizationsClient(ctx)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip("this AWS account must be an existing member of an AWS Organization") } @@ -1340,7 +1341,7 @@ func PreCheckHasIAMRole(ctx context.Context, t *testing.T, roleName string) { _, err := tfiam.FindRoleByName(ctx, Provider.Meta().(*conns.AWSClient).IAMClient(ctx), roleName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skipf("skipping acceptance test: required IAM role %q not found", roleName) } From 22fe32391ba7c8dde259ceb5dd0a90210ab8a47b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 00:13:12 -0800 Subject: [PATCH 002/227] `interceptors` --- internal/provider/interceptors/htags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/interceptors/htags.go b/internal/provider/interceptors/htags.go index 3572e6018e3..551cc92e554 100644 --- a/internal/provider/interceptors/htags.go +++ b/internal/provider/interceptors/htags.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" tfunique "github.com/hashicorp/terraform-provider-aws/internal/unique" "github.com/hashicorp/terraform-provider-aws/names" @@ -95,7 +95,7 @@ func (h HTags) ListTags(ctx context.Context, sp conns.ServicePackage, c taggingA err = nil case sp.ServicePackageName() == names.DynamoDB && err != nil: // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. - if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { + if retry.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { err = nil } } From 8fb20b08c880b41273f64d28684b3078efd145a7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:30:49 -0800 Subject: [PATCH 003/227] `acm` --- internal/service/acm/certificate.go | 6 +++--- internal/service/acm/certificate_data_source.go | 3 ++- internal/service/acm/certificate_test.go | 4 ++-- internal/service/acm/certificate_validation.go | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/service/acm/certificate.go b/internal/service/acm/certificate.go index 793ee6ac30b..a52a88fe18e 100644 --- a/internal/service/acm/certificate.go +++ b/internal/service/acm/certificate.go @@ -421,7 +421,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a certificate, err := findCertificateByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM Certificate %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -851,7 +851,7 @@ func statusCertificateDomainValidationsAvailable(ctx context.Context, conn *acm. return func() (any, string, error) { certificate, err := findCertificateByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -905,7 +905,7 @@ func statusCertificateRenewal(ctx context.Context, conn *acm.Client, arn string) return func() (any, string, error) { output, err := findCertificateRenewalByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/acm/certificate_data_source.go b/internal/service/acm/certificate_data_source.go index 6e0d6f88ca9..59e5517b274 100644 --- a/internal/service/acm/certificate_data_source.go +++ b/internal/service/acm/certificate_data_source.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -145,7 +146,7 @@ func dataSourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta certificateARN := aws.ToString(certificateSummary.CertificateArn) certificate, err := findCertificateByARN(ctx, conn, certificateARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index 3b79a60221a..3ad51be7bdc 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfacm "github.com/hashicorp/terraform-provider-aws/internal/service/acm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1808,7 +1808,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfacm.FindCertificateByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/acm/certificate_validation.go b/internal/service/acm/certificate_validation.go index d421e22c499..cf267fae3db 100644 --- a/internal/service/acm/certificate_validation.go +++ b/internal/service/acm/certificate_validation.go @@ -115,7 +115,7 @@ func resourceCertificateValidationRead(ctx context.Context, d *schema.ResourceDa arn := d.Get(names.AttrCertificateARN).(string) certificate, err := findCertificateValidationByARN(ctx, conn, arn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM Certificate %s not found, removing from state", arn) d.SetId("") return diags @@ -155,7 +155,7 @@ func statusCertificate(ctx context.Context, conn *acm.Client, arn string) sdkret output, err := findCertificate(ctx, conn, &input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 2f1cf501471d3abbb0eff9b0de93240307dae894 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:30:53 -0800 Subject: [PATCH 004/227] `acmpca` --- internal/service/acmpca/certificate.go | 2 +- internal/service/acmpca/certificate_authority.go | 4 ++-- internal/service/acmpca/certificate_authority_certificate.go | 2 +- internal/service/acmpca/certificate_authority_test.go | 4 ++-- internal/service/acmpca/certificate_test.go | 4 ++-- internal/service/acmpca/permission.go | 2 +- internal/service/acmpca/permission_test.go | 4 ++-- internal/service/acmpca/policy.go | 2 +- internal/service/acmpca/policy_test.go | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/service/acmpca/certificate.go b/internal/service/acmpca/certificate.go index 7031144f65a..91a4f0a1892 100644 --- a/internal/service/acmpca/certificate.go +++ b/internal/service/acmpca/certificate.go @@ -194,7 +194,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findCertificateByTwoPartKey(ctx, conn, d.Id(), d.Get("certificate_authority_arn").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM PCA Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/acmpca/certificate_authority.go b/internal/service/acmpca/certificate_authority.go index c53a92d7d2a..6efe5f48585 100644 --- a/internal/service/acmpca/certificate_authority.go +++ b/internal/service/acmpca/certificate_authority.go @@ -391,7 +391,7 @@ func resourceCertificateAuthorityRead(ctx context.Context, d *schema.ResourceDat certificateAuthority, err := findCertificateAuthorityByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -586,7 +586,7 @@ func statusCertificateAuthority(ctx context.Context, conn *acmpca.Client, arn st return func() (any, string, error) { output, err := findCertificateAuthorityByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/acmpca/certificate_authority_certificate.go b/internal/service/acmpca/certificate_authority_certificate.go index 9c235c458d8..3bde06bf0fa 100644 --- a/internal/service/acmpca/certificate_authority_certificate.go +++ b/internal/service/acmpca/certificate_authority_certificate.go @@ -88,7 +88,7 @@ func resourceCertificateAuthorityCertificateRead(ctx context.Context, d *schema. output, err := findCertificateAuthorityCertificateByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM PCA Certificate Authority Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/acmpca/certificate_authority_test.go b/internal/service/acmpca/certificate_authority_test.go index a45edd9fc5d..a4453c4babc 100644 --- a/internal/service/acmpca/certificate_authority_test.go +++ b/internal/service/acmpca/certificate_authority_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -718,7 +718,7 @@ func testAccCheckCertificateAuthorityDestroy(ctx context.Context) resource.TestC _, err := tfacmpca.FindCertificateAuthorityByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/acmpca/certificate_test.go b/internal/service/acmpca/certificate_test.go index a26934a1fc3..408247f40bb 100644 --- a/internal/service/acmpca/certificate_test.go +++ b/internal/service/acmpca/certificate_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -298,7 +298,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfacmpca.FindCertificateByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["certificate_authority_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/acmpca/permission.go b/internal/service/acmpca/permission.go index 5129c40c535..7277657097e 100644 --- a/internal/service/acmpca/permission.go +++ b/internal/service/acmpca/permission.go @@ -117,7 +117,7 @@ func resourcePermissionRead(ctx context.Context, d *schema.ResourceData, meta an caARN, principal, sourceAccount := parts[0], parts[1], parts[2] permission, err := findPermissionByThreePartKey(ctx, conn, caARN, principal, sourceAccount) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM PCA Permission (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/acmpca/permission_test.go b/internal/service/acmpca/permission_test.go index e7a2f88f0ad..21f080abdaf 100644 --- a/internal/service/acmpca/permission_test.go +++ b/internal/service/acmpca/permission_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func testAccCheckPermissionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfacmpca.FindPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes["certificate_authority_arn"], rs.Primary.Attributes[names.AttrPrincipal], rs.Primary.Attributes["source_account"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/acmpca/policy.go b/internal/service/acmpca/policy.go index 3ca2b8e3630..869bdd4bb78 100644 --- a/internal/service/acmpca/policy.go +++ b/internal/service/acmpca/policy.go @@ -78,7 +78,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d policy, err := findPolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ACM PCA Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/acmpca/policy_test.go b/internal/service/acmpca/policy_test.go index 55fb2752325..237dcd858a0 100644 --- a/internal/service/acmpca/policy_test.go +++ b/internal/service/acmpca/policy_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -54,7 +54,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfacmpca.FindPolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From b98dc7bdf581c1a2bbb633461e4d595a29d7defc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:30:55 -0800 Subject: [PATCH 005/227] `amp` --- internal/service/amp/alert_manager_definition.go | 4 ++-- internal/service/amp/alert_manager_definition_test.go | 4 ++-- internal/service/amp/query_logging_configuration.go | 5 +++-- internal/service/amp/query_logging_configuration_test.go | 4 ++-- internal/service/amp/resource_policy.go | 5 +++-- internal/service/amp/rule_group_namespace.go | 5 +++-- internal/service/amp/rule_group_namespace_test.go | 4 ++-- internal/service/amp/scraper.go | 5 +++-- internal/service/amp/scraper_test.go | 4 ++-- internal/service/amp/workspace.go | 9 +++++---- internal/service/amp/workspace_configuration.go | 5 +++-- internal/service/amp/workspace_test.go | 4 ++-- 12 files changed, 32 insertions(+), 26 deletions(-) diff --git a/internal/service/amp/alert_manager_definition.go b/internal/service/amp/alert_manager_definition.go index 9dd15e1a290..9e1c796870e 100644 --- a/internal/service/amp/alert_manager_definition.go +++ b/internal/service/amp/alert_manager_definition.go @@ -80,7 +80,7 @@ func resourceAlertManagerDefinitionRead(ctx context.Context, d *schema.ResourceD amd, err := findAlertManagerDefinitionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Prometheus Alert Manager Definition (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -171,7 +171,7 @@ func statusAlertManagerDefinition(ctx context.Context, conn *amp.Client, id stri return func() (any, string, error) { output, err := findAlertManagerDefinitionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/alert_manager_definition_test.go b/internal/service/amp/alert_manager_definition_test.go index c0c419b698f..d5ac69bbf91 100644 --- a/internal/service/amp/alert_manager_definition_test.go +++ b/internal/service/amp/alert_manager_definition_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckAlertManagerDefinitionDestroy(ctx context.Context) resource.Tes _, err := tfamp.FindAlertManagerDefinitionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amp/query_logging_configuration.go b/internal/service/amp/query_logging_configuration.go index a662b35a83d..7c643325926 100644 --- a/internal/service/amp/query_logging_configuration.go +++ b/internal/service/amp/query_logging_configuration.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +170,7 @@ func (r *queryLoggingConfigurationResource) Read(ctx context.Context, request re workspaceID := fwflex.StringValueFromFramework(ctx, data.WorkspaceID) output, err := findQueryLoggingConfigurationByID(ctx, conn, workspaceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -291,7 +292,7 @@ func statusQueryLoggingConfiguration(ctx context.Context, conn *amp.Client, id s return func() (any, string, error) { output, err := findQueryLoggingConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/query_logging_configuration_test.go b/internal/service/amp/query_logging_configuration_test.go index aee3d0ba105..c89a18027ea 100644 --- a/internal/service/amp/query_logging_configuration_test.go +++ b/internal/service/amp/query_logging_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +131,7 @@ func testAccCheckQueryLoggingConfigurationDestroy(ctx context.Context) resource. _, err := tfamp.FindQueryLoggingConfigurationByID(ctx, conn, rs.Primary.Attributes["workspace_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amp/resource_policy.go b/internal/service/amp/resource_policy.go index 54286e7b3e0..105ce928d0f 100644 --- a/internal/service/amp/resource_policy.go +++ b/internal/service/amp/resource_policy.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -125,7 +126,7 @@ func (r *resourcePolicyResource) Read(ctx context.Context, request resource.Read workspaceID := fwflex.StringValueFromFramework(ctx, data.WorkspaceID) output, err := findResourcePolicyByWorkspaceID(ctx, conn, workspaceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -269,7 +270,7 @@ func statusResourcePolicy(ctx context.Context, conn *amp.Client, workspaceID str return func() (any, string, error) { output, err := findResourcePolicyByWorkspaceID(ctx, conn, workspaceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/rule_group_namespace.go b/internal/service/amp/rule_group_namespace.go index cf807d19538..3c5f9d53bb5 100644 --- a/internal/service/amp/rule_group_namespace.go +++ b/internal/service/amp/rule_group_namespace.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -97,7 +98,7 @@ func resourceRuleGroupNamespaceRead(ctx context.Context, d *schema.ResourceData, rgn, err := findRuleGroupNamespaceByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Prometheus Rule Group Namespace (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -224,7 +225,7 @@ func statusRuleGroupNamespace(ctx context.Context, conn *amp.Client, arn string) return func() (any, string, error) { output, err := findRuleGroupNamespaceByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/rule_group_namespace_test.go b/internal/service/amp/rule_group_namespace_test.go index d3a08695fe5..cd5999a752d 100644 --- a/internal/service/amp/rule_group_namespace_test.go +++ b/internal/service/amp/rule_group_namespace_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func testAccCheckRuleGroupNamespaceDestroy(ctx context.Context) resource.TestChe _, err := tfamp.FindRuleGroupNamespaceByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amp/scraper.go b/internal/service/amp/scraper.go index 234768d60a3..31ba50f4124 100644 --- a/internal/service/amp/scraper.go +++ b/internal/service/amp/scraper.go @@ -34,6 +34,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -264,7 +265,7 @@ func (r *scraperResource) Read(ctx context.Context, request resource.ReadRequest scraper, err := findScraperByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -530,7 +531,7 @@ func statusScraper(ctx context.Context, conn *amp.Client, id string) sdkretry.St return func() (any, string, error) { output, err := findScraperByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/scraper_test.go b/internal/service/amp/scraper_test.go index b90ae33601a..641b254bc46 100644 --- a/internal/service/amp/scraper_test.go +++ b/internal/service/amp/scraper_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -234,7 +234,7 @@ func testAccCheckScraperDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfamp.FindScraperByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amp/workspace.go b/internal/service/amp/workspace.go index d2641734e20..2286acdd29e 100644 --- a/internal/service/amp/workspace.go +++ b/internal/service/amp/workspace.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -147,7 +148,7 @@ func resourceWorkspaceRead(ctx context.Context, d *schema.ResourceData, meta any ws, err := findWorkspaceByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] Prometheus Workspace (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -165,7 +166,7 @@ func resourceWorkspaceRead(ctx context.Context, d *schema.ResourceData, meta any loggingConfiguration, err := findLoggingConfigurationByWorkspaceID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { d.Set(names.AttrLoggingConfiguration, nil) } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading Prometheus Workspace (%s) logging configuration: %s", d.Id(), err) @@ -318,7 +319,7 @@ func statusWorkspace(ctx context.Context, conn *amp.Client, id string) sdkretry. return func() (any, string, error) { output, err := findWorkspaceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -419,7 +420,7 @@ func statusLoggingConfiguration(ctx context.Context, conn *amp.Client, workspace return func() (any, string, error) { output, err := findLoggingConfigurationByWorkspaceID(ctx, conn, workspaceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/workspace_configuration.go b/internal/service/amp/workspace_configuration.go index c7ff8a247c1..fcf9bbaec55 100644 --- a/internal/service/amp/workspace_configuration.go +++ b/internal/service/amp/workspace_configuration.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +170,7 @@ func (r *workspaceConfigurationResource) Read(ctx context.Context, request resou out, err := findWorkspaceConfigurationByID(ctx, conn, data.WorkspaceID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -258,7 +259,7 @@ func statusWorkspaceConfiguration(ctx context.Context, conn *amp.Client, id stri return func() (any, string, error) { output, err := findWorkspaceConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amp/workspace_test.go b/internal/service/amp/workspace_test.go index 76fecd2d388..4f7ddacbc54 100644 --- a/internal/service/amp/workspace_test.go +++ b/internal/service/amp/workspace_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -250,7 +250,7 @@ func testAccCheckWorkspaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfamp.FindWorkspaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From e7fdad6c70d4b61b72272b653251c7051611228a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:30:57 -0800 Subject: [PATCH 006/227] `amplify` --- internal/service/amplify/app.go | 3 ++- internal/service/amplify/app_test.go | 4 ++-- internal/service/amplify/backend_environment.go | 3 ++- internal/service/amplify/backend_environment_test.go | 4 ++-- internal/service/amplify/branch.go | 3 ++- internal/service/amplify/branch_test.go | 4 ++-- internal/service/amplify/domain_association.go | 5 +++-- internal/service/amplify/domain_association_test.go | 4 ++-- internal/service/amplify/webhook.go | 3 ++- internal/service/amplify/webhook_test.go | 4 ++-- 10 files changed, 21 insertions(+), 16 deletions(-) diff --git a/internal/service/amplify/app.go b/internal/service/amplify/app.go index e814c8ce540..8405ece3feb 100644 --- a/internal/service/amplify/app.go +++ b/internal/service/amplify/app.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -442,7 +443,7 @@ func resourceAppRead(ctx context.Context, d *schema.ResourceData, meta any) diag app, err := findAppByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Amplify App (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/amplify/app_test.go b/internal/service/amplify/app_test.go index e18c961af83..a618c632d0b 100644 --- a/internal/service/amplify/app_test.go +++ b/internal/service/amplify/app_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -748,7 +748,7 @@ func testAccCheckAppDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfamplify.FindAppByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amplify/backend_environment.go b/internal/service/amplify/backend_environment.go index b1e994bad53..48766553de1 100644 --- a/internal/service/amplify/backend_environment.go +++ b/internal/service/amplify/backend_environment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +113,7 @@ func resourceBackendEnvironmentRead(ctx context.Context, d *schema.ResourceData, backendEnvironment, err := findBackendEnvironmentByTwoPartKey(ctx, conn, appID, environmentName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Amplify Backend Environment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/amplify/backend_environment_test.go b/internal/service/amplify/backend_environment_test.go index 956d407f9bb..431c5931ef5 100644 --- a/internal/service/amplify/backend_environment_test.go +++ b/internal/service/amplify/backend_environment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckBackendEnvironmentDestroy(ctx context.Context) resource.TestChe _, err := tfamplify.FindBackendEnvironmentByTwoPartKey(ctx, conn, rs.Primary.Attributes["app_id"], rs.Primary.Attributes["environment_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amplify/branch.go b/internal/service/amplify/branch.go index 986cdefe5f9..8b235f9ea70 100644 --- a/internal/service/amplify/branch.go +++ b/internal/service/amplify/branch.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -269,7 +270,7 @@ func resourceBranchRead(ctx context.Context, d *schema.ResourceData, meta any) d branch, err := findBranchByTwoPartKey(ctx, conn, appID, branchName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Amplify Branch (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/amplify/branch_test.go b/internal/service/amplify/branch_test.go index c0a228b614d..cd51a1aff57 100644 --- a/internal/service/amplify/branch_test.go +++ b/internal/service/amplify/branch_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -279,7 +279,7 @@ func testAccCheckBranchDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfamplify.FindBranchByTwoPartKey(ctx, conn, rs.Primary.Attributes["app_id"], rs.Primary.Attributes["branch_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amplify/domain_association.go b/internal/service/amplify/domain_association.go index 27dc60709c5..cb832077e11 100644 --- a/internal/service/amplify/domain_association.go +++ b/internal/service/amplify/domain_association.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -173,7 +174,7 @@ func resourceDomainAssociationRead(ctx context.Context, d *schema.ResourceData, domainAssociation, err := findDomainAssociationByTwoPartKey(ctx, conn, appID, domainName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Amplify Domain Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -300,7 +301,7 @@ func statusDomainAssociation(ctx context.Context, conn *amplify.Client, appID, d return func() (any, string, error) { domainAssociation, err := findDomainAssociationByTwoPartKey(ctx, conn, appID, domainName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/amplify/domain_association_test.go b/internal/service/amplify/domain_association_test.go index d87ac5efbb4..9cd671dc80b 100644 --- a/internal/service/amplify/domain_association_test.go +++ b/internal/service/amplify/domain_association_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -394,7 +394,7 @@ func testAccCheckDomainAssociationDestroy(ctx context.Context) resource.TestChec _, err := tfamplify.FindDomainAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["app_id"], rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/amplify/webhook.go b/internal/service/amplify/webhook.go index 12593f9cfc3..fe3f906284c 100644 --- a/internal/service/amplify/webhook.go +++ b/internal/service/amplify/webhook.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +92,7 @@ func resourceWebhookRead(ctx context.Context, d *schema.ResourceData, meta any) webhook, err := findWebhookByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Amplify Webhook (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/amplify/webhook_test.go b/internal/service/amplify/webhook_test.go index 99101697f0d..c18635f281e 100644 --- a/internal/service/amplify/webhook_test.go +++ b/internal/service/amplify/webhook_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -149,7 +149,7 @@ func testAccCheckWebhookDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfamplify.FindWebhookByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From dc8c495abf4401fb7ad87d8ecc50399706bcf27e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:30:58 -0800 Subject: [PATCH 007/227] `apigateway` --- internal/service/apigateway/account.go | 3 ++- internal/service/apigateway/api_key.go | 3 ++- internal/service/apigateway/api_key_test.go | 4 ++-- internal/service/apigateway/authorizer.go | 3 ++- internal/service/apigateway/authorizer_test.go | 4 ++-- internal/service/apigateway/base_path_mapping.go | 3 ++- internal/service/apigateway/base_path_mapping_test.go | 4 ++-- internal/service/apigateway/client_certificate.go | 3 ++- internal/service/apigateway/client_certificate_test.go | 4 ++-- internal/service/apigateway/deployment.go | 3 ++- internal/service/apigateway/deployment_test.go | 4 ++-- internal/service/apigateway/documentation_part.go | 3 ++- internal/service/apigateway/documentation_part_test.go | 4 ++-- internal/service/apigateway/documentation_version.go | 3 ++- internal/service/apigateway/documentation_version_test.go | 4 ++-- internal/service/apigateway/domain_name.go | 5 +++-- .../service/apigateway/domain_name_access_association.go | 3 ++- .../apigateway/domain_name_access_association_test.go | 4 ++-- internal/service/apigateway/domain_name_test.go | 4 ++-- internal/service/apigateway/gateway_response.go | 3 ++- internal/service/apigateway/gateway_response_test.go | 4 ++-- internal/service/apigateway/integration.go | 3 ++- internal/service/apigateway/integration_response.go | 3 ++- internal/service/apigateway/integration_response_test.go | 4 ++-- internal/service/apigateway/integration_test.go | 4 ++-- internal/service/apigateway/method.go | 3 ++- internal/service/apigateway/method_response.go | 3 ++- internal/service/apigateway/method_response_test.go | 4 ++-- internal/service/apigateway/method_settings.go | 3 ++- internal/service/apigateway/method_settings_test.go | 4 ++-- internal/service/apigateway/method_test.go | 4 ++-- internal/service/apigateway/model.go | 3 ++- internal/service/apigateway/model_test.go | 4 ++-- internal/service/apigateway/request_validator.go | 3 ++- internal/service/apigateway/request_validator_test.go | 4 ++-- internal/service/apigateway/resource.go | 3 ++- internal/service/apigateway/resource_test.go | 4 ++-- internal/service/apigateway/rest_api.go | 5 +++-- internal/service/apigateway/rest_api_data_source.go | 3 ++- internal/service/apigateway/rest_api_policy.go | 4 ++-- internal/service/apigateway/rest_api_put.go | 6 +++--- internal/service/apigateway/rest_api_test.go | 4 ++-- internal/service/apigateway/stage.go | 5 +++-- internal/service/apigateway/stage_test.go | 4 ++-- internal/service/apigateway/usage_plan.go | 3 ++- internal/service/apigateway/usage_plan_key.go | 3 ++- internal/service/apigateway/usage_plan_key_test.go | 4 ++-- internal/service/apigateway/usage_plan_test.go | 4 ++-- internal/service/apigateway/vpc_link.go | 5 +++-- internal/service/apigateway/vpc_link_test.go | 4 ++-- 50 files changed, 105 insertions(+), 80 deletions(-) diff --git a/internal/service/apigateway/account.go b/internal/service/apigateway/account.go index 8777942cdec..46d42deda4f 100644 --- a/internal/service/apigateway/account.go +++ b/internal/service/apigateway/account.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +132,7 @@ func (r *accountResource) Read(ctx context.Context, request resource.ReadRequest conn := r.Meta().APIGatewayClient(ctx) account, err := findAccount(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/apigateway/api_key.go b/internal/service/apigateway/api_key.go index 5d2de70420e..47340aed3eb 100644 --- a/internal/service/apigateway/api_key.go +++ b/internal/service/apigateway/api_key.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -117,7 +118,7 @@ func resourceAPIKeyRead(ctx context.Context, d *schema.ResourceData, meta any) d apiKey, err := findAPIKeyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway API Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/api_key_test.go b/internal/service/apigateway/api_key_test.go index a0e86a47592..9d1a42d2f16 100644 --- a/internal/service/apigateway/api_key_test.go +++ b/internal/service/apigateway/api_key_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -263,7 +263,7 @@ func testAccCheckAPIKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindAPIKeyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/authorizer.go b/internal/service/apigateway/authorizer.go index 63f1dfa4579..82ec5962600 100644 --- a/internal/service/apigateway/authorizer.go +++ b/internal/service/apigateway/authorizer.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -183,7 +184,7 @@ func resourceAuthorizerRead(ctx context.Context, d *schema.ResourceData, meta an apiID := d.Get("rest_api_id").(string) authorizer, err := findAuthorizerByTwoPartKey(ctx, conn, d.Id(), apiID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Authorizer (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/authorizer_test.go b/internal/service/apigateway/authorizer_test.go index 81962519907..98b95d44730 100644 --- a/internal/service/apigateway/authorizer_test.go +++ b/internal/service/apigateway/authorizer_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -351,7 +351,7 @@ func testAccCheckAuthorizerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindAuthorizerByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/base_path_mapping.go b/internal/service/apigateway/base_path_mapping.go index 02593c2ec61..aca6afefbcd 100644 --- a/internal/service/apigateway/base_path_mapping.go +++ b/internal/service/apigateway/base_path_mapping.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +112,7 @@ func resourceBasePathMappingRead(ctx context.Context, d *schema.ResourceData, me mapping, err := findBasePathMappingByThreePartKey(ctx, conn, domainName, basePath, domainNameID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Base Path Mapping (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/base_path_mapping_test.go b/internal/service/apigateway/base_path_mapping_test.go index 241111943f8..9e50a970993 100644 --- a/internal/service/apigateway/base_path_mapping_test.go +++ b/internal/service/apigateway/base_path_mapping_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -270,7 +270,7 @@ func testAccCheckBasePathDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfapigateway.FindBasePathMappingByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrDomainName], basePath, rs.Primary.Attributes["domain_name_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/client_certificate.go b/internal/service/apigateway/client_certificate.go index 9e8b82d4e22..6ed6766c409 100644 --- a/internal/service/apigateway/client_certificate.go +++ b/internal/service/apigateway/client_certificate.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -93,7 +94,7 @@ func resourceClientCertificateRead(ctx context.Context, d *schema.ResourceData, cert, err := findClientCertificateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Client Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/client_certificate_test.go b/internal/service/apigateway/client_certificate_test.go index d2b465714fc..4d965404a0d 100644 --- a/internal/service/apigateway/client_certificate_test.go +++ b/internal/service/apigateway/client_certificate_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckClientCertificateDestroy(ctx context.Context) resource.TestChec _, err := tfapigateway.FindClientCertificateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/deployment.go b/internal/service/apigateway/deployment.go index a5b6cdfecad..9d2b91cb682 100644 --- a/internal/service/apigateway/deployment.go +++ b/internal/service/apigateway/deployment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +95,7 @@ func resourceDeploymentRead(ctx context.Context, d *schema.ResourceData, meta an restAPIID := d.Get("rest_api_id").(string) deployment, err := findDeploymentByTwoPartKey(ctx, conn, restAPIID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Deployment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/deployment_test.go b/internal/service/apigateway/deployment_test.go index e81038aeed7..78ff9f33603 100644 --- a/internal/service/apigateway/deployment_test.go +++ b/internal/service/apigateway/deployment_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -331,7 +331,7 @@ func testAccCheckDeploymentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindDeploymentByTwoPartKey(ctx, conn, rs.Primary.Attributes["rest_api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/documentation_part.go b/internal/service/apigateway/documentation_part.go index 408748a7e7d..a06ef2a95e9 100644 --- a/internal/service/apigateway/documentation_part.go +++ b/internal/service/apigateway/documentation_part.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +121,7 @@ func resourceDocumentationPartRead(ctx context.Context, d *schema.ResourceData, docPart, err := findDocumentationPartByTwoPartKey(ctx, conn, apiID, documentationPartID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Documentation Part (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/documentation_part_test.go b/internal/service/apigateway/documentation_part_test.go index 94470348c26..638d4b6cabf 100644 --- a/internal/service/apigateway/documentation_part_test.go +++ b/internal/service/apigateway/documentation_part_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -223,7 +223,7 @@ func testAccCheckDocumentationPartDestroy(ctx context.Context) resource.TestChec _, err := tfapigateway.FindDocumentationPartByTwoPartKey(ctx, conn, rs.Primary.Attributes["rest_api_id"], rs.Primary.Attributes["documentation_part_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/documentation_version.go b/internal/service/apigateway/documentation_version.go index d56aa243efd..1a0bf92197d 100644 --- a/internal/service/apigateway/documentation_version.go +++ b/internal/service/apigateway/documentation_version.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +90,7 @@ func resourceDocumentationVersionRead(ctx context.Context, d *schema.ResourceDat version, err := findDocumentationVersionByTwoPartKey(ctx, conn, apiID, documentationVersion) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Documentation Version (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/documentation_version_test.go b/internal/service/apigateway/documentation_version_test.go index 805e71e8b42..50b24b5fcec 100644 --- a/internal/service/apigateway/documentation_version_test.go +++ b/internal/service/apigateway/documentation_version_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -152,7 +152,7 @@ func testAccCheckDocumentationVersionDestroy(ctx context.Context) resource.TestC _, err := tfapigateway.FindDocumentationVersionByTwoPartKey(ctx, conn, rs.Primary.Attributes["rest_api_id"], rs.Primary.Attributes[names.AttrVersion]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/domain_name.go b/internal/service/apigateway/domain_name.go index a835a613d10..1f9a41d82d0 100644 --- a/internal/service/apigateway/domain_name.go +++ b/internal/service/apigateway/domain_name.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -275,7 +276,7 @@ func resourceDomainNameRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findDomainNameByTwoPartKey(ctx, conn, domainName, domainNameID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Domain Name (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -557,7 +558,7 @@ func statusDomainName(ctx context.Context, conn *apigateway.Client, domainName, return func() (any, string, error) { output, err := findDomainNameByTwoPartKey(ctx, conn, domainName, domainNameID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apigateway/domain_name_access_association.go b/internal/service/apigateway/domain_name_access_association.go index fcee8c97e93..2ae3a11fc4c 100644 --- a/internal/service/apigateway/domain_name_access_association.go +++ b/internal/service/apigateway/domain_name_access_association.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -121,7 +122,7 @@ func (r *domainNameAccessAssociationResource) Read(ctx context.Context, request output, err := findDomainNameAccessAssociationByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/apigateway/domain_name_access_association_test.go b/internal/service/apigateway/domain_name_access_association_test.go index 55634dccc53..caff5dc145a 100644 --- a/internal/service/apigateway/domain_name_access_association_test.go +++ b/internal/service/apigateway/domain_name_access_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckDomainNameAccessAssociationDestroy(ctx context.Context) resourc _, err := tfapigateway.FindDomainNameAccessAssociationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/domain_name_test.go b/internal/service/apigateway/domain_name_test.go index b149955e127..420f81decc7 100644 --- a/internal/service/apigateway/domain_name_test.go +++ b/internal/service/apigateway/domain_name_test.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -589,7 +589,7 @@ func testAccCheckDomainNameDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindDomainNameByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrDomainName], rs.Primary.Attributes["domain_name_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/gateway_response.go b/internal/service/apigateway/gateway_response.go index 85ac0f59454..9cbe9007b55 100644 --- a/internal/service/apigateway/gateway_response.go +++ b/internal/service/apigateway/gateway_response.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +116,7 @@ func resourceGatewayResponseRead(ctx context.Context, d *schema.ResourceData, me gatewayResponse, err := findGatewayResponseByTwoPartKey(ctx, conn, d.Get("response_type").(string), d.Get("rest_api_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Gateway Response (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/gateway_response_test.go b/internal/service/apigateway/gateway_response_test.go index 3e2c9d1992c..7f24bf39b60 100644 --- a/internal/service/apigateway/gateway_response_test.go +++ b/internal/service/apigateway/gateway_response_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckGatewayResponseDestroy(ctx context.Context) resource.TestCheckF _, err := tfapigateway.FindGatewayResponseByTwoPartKey(ctx, conn, rs.Primary.Attributes["response_type"], rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/integration.go b/internal/service/apigateway/integration.go index 34d686ba26a..5d87d2125b5 100644 --- a/internal/service/apigateway/integration.go +++ b/internal/service/apigateway/integration.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +242,7 @@ func resourceIntegrationRead(ctx context.Context, d *schema.ResourceData, meta a integration, err := findIntegrationByThreePartKey(ctx, conn, d.Get("http_method").(string), d.Get(names.AttrResourceID).(string), d.Get("rest_api_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Integration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/integration_response.go b/internal/service/apigateway/integration_response.go index f9aad0050d0..d60d516ebc8 100644 --- a/internal/service/apigateway/integration_response.go +++ b/internal/service/apigateway/integration_response.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +142,7 @@ func resourceIntegrationResponseRead(ctx context.Context, d *schema.ResourceData integrationResponse, err := findIntegrationResponseByFourPartKey(ctx, conn, d.Get("http_method").(string), d.Get(names.AttrResourceID).(string), d.Get("rest_api_id").(string), d.Get(names.AttrStatusCode).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Integration Response (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/integration_response_test.go b/internal/service/apigateway/integration_response_test.go index 2d3636ebcd6..7797773ec5f 100644 --- a/internal/service/apigateway/integration_response_test.go +++ b/internal/service/apigateway/integration_response_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func testAccCheckIntegrationResponseDestroy(ctx context.Context) resource.TestCh _, err := tfapigateway.FindIntegrationResponseByFourPartKey(ctx, conn, rs.Primary.Attributes["http_method"], rs.Primary.Attributes[names.AttrResourceID], rs.Primary.Attributes["rest_api_id"], rs.Primary.Attributes[names.AttrStatusCode]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/integration_test.go b/internal/service/apigateway/integration_test.go index 4fa68447567..a3350bd7b41 100644 --- a/internal/service/apigateway/integration_test.go +++ b/internal/service/apigateway/integration_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -638,7 +638,7 @@ func testAccCheckIntegrationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfapigateway.FindIntegrationByThreePartKey(ctx, conn, rs.Primary.Attributes["http_method"], rs.Primary.Attributes[names.AttrResourceID], rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/method.go b/internal/service/apigateway/method.go index 67e8fbb2d9d..aa2c3232ee5 100644 --- a/internal/service/apigateway/method.go +++ b/internal/service/apigateway/method.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +160,7 @@ func resourceMethodRead(ctx context.Context, d *schema.ResourceData, meta any) d method, err := findMethodByThreePartKey(ctx, conn, d.Get("http_method").(string), d.Get(names.AttrResourceID).(string), d.Get("rest_api_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Method (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/method_response.go b/internal/service/apigateway/method_response.go index 1843fda713d..514f33741b0 100644 --- a/internal/service/apigateway/method_response.go +++ b/internal/service/apigateway/method_response.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +132,7 @@ func resourceMethodResponseRead(ctx context.Context, d *schema.ResourceData, met methodResponse, err := findMethodResponseByFourPartKey(ctx, conn, d.Get("http_method").(string), d.Get(names.AttrResourceID).(string), d.Get("rest_api_id").(string), d.Get(names.AttrStatusCode).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Method Response (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/method_response_test.go b/internal/service/apigateway/method_response_test.go index 21adf52f7a9..1f9e5bb2590 100644 --- a/internal/service/apigateway/method_response_test.go +++ b/internal/service/apigateway/method_response_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckMethodResponseDestroy(ctx context.Context) resource.TestCheckFu _, err := tfapigateway.FindMethodResponseByFourPartKey(ctx, conn, rs.Primary.Attributes["http_method"], rs.Primary.Attributes[names.AttrResourceID], rs.Primary.Attributes["rest_api_id"], rs.Primary.Attributes[names.AttrStatusCode]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/method_settings.go b/internal/service/apigateway/method_settings.go index 048adbb4c0f..a6370a401e3 100644 --- a/internal/service/apigateway/method_settings.go +++ b/internal/service/apigateway/method_settings.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -147,7 +148,7 @@ func resourceMethodSettingsRead(ctx context.Context, d *schema.ResourceData, met settings, err := findMethodSettingsByThreePartKey(ctx, conn, d.Get("rest_api_id").(string), d.Get("stage_name").(string), d.Get("method_path").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Method Settings (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/method_settings_test.go b/internal/service/apigateway/method_settings_test.go index 4d6107b471f..026b51487a3 100644 --- a/internal/service/apigateway/method_settings_test.go +++ b/internal/service/apigateway/method_settings_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -597,7 +597,7 @@ func testAccCheckMethodSettingsDestroy(ctx context.Context) resource.TestCheckFu _, err := tfapigateway.FindMethodSettingsByThreePartKey(ctx, conn, rs.Primary.Attributes["rest_api_id"], rs.Primary.Attributes["stage_name"], rs.Primary.Attributes["method_path"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/method_test.go b/internal/service/apigateway/method_test.go index b9b2eaa0414..a6971eea5ec 100644 --- a/internal/service/apigateway/method_test.go +++ b/internal/service/apigateway/method_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -279,7 +279,7 @@ func testAccCheckMethodDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindMethodByThreePartKey(ctx, conn, rs.Primary.Attributes["http_method"], rs.Primary.Attributes[names.AttrResourceID], rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/model.go b/internal/service/apigateway/model.go index c7ae8bbc77a..f17d0a4ad50 100644 --- a/internal/service/apigateway/model.go +++ b/internal/service/apigateway/model.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -128,7 +129,7 @@ func resourceModelRead(ctx context.Context, d *schema.ResourceData, meta any) di model, err := findModelByTwoPartKey(ctx, conn, d.Get(names.AttrName).(string), d.Get("rest_api_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Model (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/model_test.go b/internal/service/apigateway/model_test.go index c96058b2a0b..a178bd07602 100644 --- a/internal/service/apigateway/model_test.go +++ b/internal/service/apigateway/model_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckModelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindModelByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/request_validator.go b/internal/service/apigateway/request_validator.go index e99afbde94f..98889637c04 100644 --- a/internal/service/apigateway/request_validator.go +++ b/internal/service/apigateway/request_validator.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +99,7 @@ func resourceRequestValidatorRead(ctx context.Context, d *schema.ResourceData, m output, err := findRequestValidatorByTwoPartKey(ctx, conn, d.Id(), d.Get("rest_api_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Request Validator (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/request_validator_test.go b/internal/service/apigateway/request_validator_test.go index 84ee46799ec..06154b8471e 100644 --- a/internal/service/apigateway/request_validator_test.go +++ b/internal/service/apigateway/request_validator_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +115,7 @@ func testAccCheckRequestValidatorDestroy(ctx context.Context) resource.TestCheck _, err := tfapigateway.FindRequestValidatorByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/resource.go b/internal/service/apigateway/resource.go index 40cd4c014fa..6728c1cef3c 100644 --- a/internal/service/apigateway/resource.go +++ b/internal/service/apigateway/resource.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +101,7 @@ func resourceResourceRead(ctx context.Context, d *schema.ResourceData, meta any) resource, err := findResourceByTwoPartKey(ctx, conn, d.Id(), d.Get("rest_api_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Resource (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/resource_test.go b/internal/service/apigateway/resource_test.go index 8aaee377bc5..675fe2a117c 100644 --- a/internal/service/apigateway/resource_test.go +++ b/internal/service/apigateway/resource_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -221,7 +221,7 @@ func testAccCheckResourceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindResourceByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["rest_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/rest_api.go b/internal/service/apigateway/rest_api.go index 0af540f7aed..8dabd5afb6a 100644 --- a/internal/service/apigateway/rest_api.go +++ b/internal/service/apigateway/rest_api.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -279,7 +280,7 @@ func resourceRestAPIRead(ctx context.Context, d *schema.ResourceData, meta any) api, err := findRestAPIByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway REST API (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -316,7 +317,7 @@ func resourceRestAPIRead(ctx context.Context, d *schema.ResourceData, meta any) switch { case err == nil: d.Set("root_resource_id", rootResource.Id) - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("root_resource_id", nil) default: return sdkdiag.AppendErrorf(diags, "reading API Gateway REST API (%s) root resource: %s", d.Id(), err) diff --git a/internal/service/apigateway/rest_api_data_source.go b/internal/service/apigateway/rest_api_data_source.go index 3d70e74ef44..67e9e21ba24 100644 --- a/internal/service/apigateway/rest_api_data_source.go +++ b/internal/service/apigateway/rest_api_data_source.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -134,7 +135,7 @@ func dataSourceRestAPIRead(ctx context.Context, d *schema.ResourceData, meta any switch { case err == nil: d.Set("root_resource_id", rootResource.Id) - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("root_resource_id", nil) default: return sdkdiag.AppendErrorf(diags, "reading API Gateway REST API (%s) root resource: %s", d.Id(), err) diff --git a/internal/service/apigateway/rest_api_policy.go b/internal/service/apigateway/rest_api_policy.go index d53e18ffcc3..178195de0da 100644 --- a/internal/service/apigateway/rest_api_policy.go +++ b/internal/service/apigateway/rest_api_policy.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func resourceRestAPIPolicyRead(ctx context.Context, d *schema.ResourceData, meta api, err := findRestAPIByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway REST API (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/rest_api_put.go b/internal/service/apigateway/rest_api_put.go index c56309b8ef2..f84ebbc017b 100644 --- a/internal/service/apigateway/rest_api_put.go +++ b/internal/service/apigateway/rest_api_put.go @@ -25,7 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func (r *restAPIPutResource) Read(ctx context.Context, req resource.ReadRequest, conn := r.Meta().APIGatewayClient(ctx) out, err := findRestAPIByID(ctx, conn, state.RestAPIID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -208,7 +208,7 @@ func waitRestAPIPutCreated(ctx context.Context, conn *apigateway.Client, id stri func statusRestAPIPut(ctx context.Context, conn *apigateway.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findRestAPIByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apigateway/rest_api_test.go b/internal/service/apigateway/rest_api_test.go index bb04ee7d939..47f7968bbc5 100644 --- a/internal/service/apigateway/rest_api_test.go +++ b/internal/service/apigateway/rest_api_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1575,7 +1575,7 @@ func testAccCheckRESTAPIDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindRestAPIByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/stage.go b/internal/service/apigateway/stage.go index 7ddf723d488..f60d8a7f7c3 100644 --- a/internal/service/apigateway/stage.go +++ b/internal/service/apigateway/stage.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -244,7 +245,7 @@ func resourceStageRead(ctx context.Context, d *schema.ResourceData, meta any) di stageName := d.Get("stage_name").(string) stage, err := findStageByTwoPartKey(ctx, conn, apiID, stageName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Stage (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -459,7 +460,7 @@ func stageCacheStatus(ctx context.Context, conn *apigateway.Client, restApiId, n return func() (any, string, error) { output, err := findStageByTwoPartKey(ctx, conn, restApiId, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/apigateway/stage_test.go b/internal/service/apigateway/stage_test.go index 1599468bc02..0995c141bc8 100644 --- a/internal/service/apigateway/stage_test.go +++ b/internal/service/apigateway/stage_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -525,7 +525,7 @@ func testAccCheckStageDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindStageByTwoPartKey(ctx, conn, rs.Primary.Attributes["rest_api_id"], rs.Primary.Attributes["stage_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/usage_plan.go b/internal/service/apigateway/usage_plan.go index 95d0ccca3ba..31a121b2691 100644 --- a/internal/service/apigateway/usage_plan.go +++ b/internal/service/apigateway/usage_plan.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -219,7 +220,7 @@ func resourceUsagePlanRead(ctx context.Context, d *schema.ResourceData, meta any up, err := findUsagePlanByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Usage Plan (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/usage_plan_key.go b/internal/service/apigateway/usage_plan_key.go index fe958a3f364..391023fde9f 100644 --- a/internal/service/apigateway/usage_plan_key.go +++ b/internal/service/apigateway/usage_plan_key.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +100,7 @@ func resourceUsagePlanKeyRead(ctx context.Context, d *schema.ResourceData, meta upk, err := findUsagePlanKeyByTwoPartKey(ctx, conn, d.Get("usage_plan_id").(string), d.Get(names.AttrKeyID).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway Usage Plan Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigateway/usage_plan_key_test.go b/internal/service/apigateway/usage_plan_key_test.go index f8e700d3275..7d40dc47d3d 100644 --- a/internal/service/apigateway/usage_plan_key_test.go +++ b/internal/service/apigateway/usage_plan_key_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func testAccCheckUsagePlanKeyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfapigateway.FindUsagePlanKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes["usage_plan_id"], rs.Primary.Attributes[names.AttrKeyID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/usage_plan_test.go b/internal/service/apigateway/usage_plan_test.go index e98486005c7..0f74a77cd83 100644 --- a/internal/service/apigateway/usage_plan_test.go +++ b/internal/service/apigateway/usage_plan_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -541,7 +541,7 @@ func testAccCheckUsagePlanDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindUsagePlanByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigateway/vpc_link.go b/internal/service/apigateway/vpc_link.go index 84134e21fad..cf39e43958f 100644 --- a/internal/service/apigateway/vpc_link.go +++ b/internal/service/apigateway/vpc_link.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -101,7 +102,7 @@ func resourceVPCLinkRead(ctx context.Context, d *schema.ResourceData, meta any) vpcLink, err := findVPCLinkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway VPC Link %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -217,7 +218,7 @@ func vpcLinkStatus(ctx context.Context, conn *apigateway.Client, id string) sdkr return func() (any, string, error) { output, err := findVPCLinkByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apigateway/vpc_link_test.go b/internal/service/apigateway/vpc_link_test.go index 9765f4440f2..5cc9af146e2 100644 --- a/internal/service/apigateway/vpc_link_test.go +++ b/internal/service/apigateway/vpc_link_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckVPCLinkDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigateway.FindVPCLinkByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 0f7a87b7a0c64808ac6b8b5a7fce4681022923b4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:30:59 -0800 Subject: [PATCH 008/227] `apigatewayv2` --- internal/service/apigatewayv2/api.go | 3 ++- internal/service/apigatewayv2/api_data_source.go | 4 ++-- internal/service/apigatewayv2/api_mapping.go | 3 ++- internal/service/apigatewayv2/api_mapping_test.go | 4 ++-- internal/service/apigatewayv2/api_test.go | 3 ++- internal/service/apigatewayv2/authorizer.go | 3 ++- internal/service/apigatewayv2/authorizer_test.go | 4 ++-- internal/service/apigatewayv2/deployment.go | 5 +++-- internal/service/apigatewayv2/deployment_test.go | 4 ++-- internal/service/apigatewayv2/domain_name.go | 5 +++-- internal/service/apigatewayv2/domain_name_test.go | 4 ++-- internal/service/apigatewayv2/integration.go | 3 ++- internal/service/apigatewayv2/integration_response.go | 3 ++- internal/service/apigatewayv2/integration_response_test.go | 4 ++-- internal/service/apigatewayv2/integration_test.go | 4 ++-- internal/service/apigatewayv2/model.go | 3 ++- internal/service/apigatewayv2/model_test.go | 4 ++-- internal/service/apigatewayv2/route.go | 3 ++- internal/service/apigatewayv2/route_response.go | 3 ++- internal/service/apigatewayv2/route_response_test.go | 4 ++-- internal/service/apigatewayv2/route_test.go | 4 ++-- internal/service/apigatewayv2/stage_test.go | 4 ++-- internal/service/apigatewayv2/vpc_link.go | 5 +++-- internal/service/apigatewayv2/vpc_link_test.go | 4 ++-- 24 files changed, 51 insertions(+), 39 deletions(-) diff --git a/internal/service/apigatewayv2/api.go b/internal/service/apigatewayv2/api.go index 41bf8068f6d..c7b7778bce2 100644 --- a/internal/service/apigatewayv2/api.go +++ b/internal/service/apigatewayv2/api.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfjson "github.com/hashicorp/terraform-provider-aws/internal/json" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -247,7 +248,7 @@ func resourceAPIRead(ctx context.Context, d *schema.ResourceData, meta any) diag output, err := findAPIByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 API (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/api_data_source.go b/internal/service/apigatewayv2/api_data_source.go index 49107692d52..4c2714204ed 100644 --- a/internal/service/apigatewayv2/api_data_source.go +++ b/internal/service/apigatewayv2/api_data_source.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func dataSourceAPIRead(ctx context.Context, d *schema.ResourceData, meta any) di apiID := d.Get("api_id").(string) api, err := findAPIByID(ctx, conn, apiID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "no API Gateway v2 API matched; change the search criteria and try again") } diff --git a/internal/service/apigatewayv2/api_mapping.go b/internal/service/apigatewayv2/api_mapping.go index 68efe0579e5..d9249327659 100644 --- a/internal/service/apigatewayv2/api_mapping.go +++ b/internal/service/apigatewayv2/api_mapping.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +89,7 @@ func resourceAPIMappingRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findAPIMappingByTwoPartKey(ctx, conn, d.Id(), d.Get(names.AttrDomainName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 API Mapping (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/api_mapping_test.go b/internal/service/apigatewayv2/api_mapping_test.go index 4a9807bb02d..1a773bba131 100644 --- a/internal/service/apigatewayv2/api_mapping_test.go +++ b/internal/service/apigatewayv2/api_mapping_test.go @@ -17,10 +17,10 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfacm "github.com/hashicorp/terraform-provider-aws/internal/service/acm" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -203,7 +203,7 @@ func testAccCheckAPIMappingDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindAPIMappingByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/api_test.go b/internal/service/apigatewayv2/api_test.go index ab8b1061225..15574177c78 100644 --- a/internal/service/apigatewayv2/api_test.go +++ b/internal/service/apigatewayv2/api_test.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -741,7 +742,7 @@ func testAccCheckAPIDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindAPIByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/authorizer.go b/internal/service/apigatewayv2/authorizer.go index 957d9a8f24f..379f1be6b68 100644 --- a/internal/service/apigatewayv2/authorizer.go +++ b/internal/service/apigatewayv2/authorizer.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -179,7 +180,7 @@ func resourceAuthorizerRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findAuthorizerByTwoPartKey(ctx, conn, d.Get("api_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Authorizer (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/authorizer_test.go b/internal/service/apigatewayv2/authorizer_test.go index 2aaa5ad04e3..0858c7a9452 100644 --- a/internal/service/apigatewayv2/authorizer_test.go +++ b/internal/service/apigatewayv2/authorizer_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -369,7 +369,7 @@ func testAccCheckAuthorizerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindAuthorizerByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/deployment.go b/internal/service/apigatewayv2/deployment.go index 991fff979e6..f36a009208d 100644 --- a/internal/service/apigatewayv2/deployment.go +++ b/internal/service/apigatewayv2/deployment.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +98,7 @@ func resourceDeploymentRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findDeploymentByTwoPartKey(ctx, conn, d.Get("api_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Deployment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -208,7 +209,7 @@ func statusDeployment(ctx context.Context, conn *apigatewayv2.Client, apiID, dep return func() (any, string, error) { output, err := findDeploymentByTwoPartKey(ctx, conn, apiID, deploymentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apigatewayv2/deployment_test.go b/internal/service/apigatewayv2/deployment_test.go index b0b795f89b1..60286051730 100644 --- a/internal/service/apigatewayv2/deployment_test.go +++ b/internal/service/apigatewayv2/deployment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckDeploymentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindDeploymentByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/domain_name.go b/internal/service/apigatewayv2/domain_name.go index 2c9f94edd0c..8b7cd27214e 100644 --- a/internal/service/apigatewayv2/domain_name.go +++ b/internal/service/apigatewayv2/domain_name.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -165,7 +166,7 @@ func resourceDomainNameRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findDomainName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Domain Name (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -285,7 +286,7 @@ func statusDomainName(ctx context.Context, conn *apigatewayv2.Client, name strin return func() (any, string, error) { output, err := findDomainName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apigatewayv2/domain_name_test.go b/internal/service/apigatewayv2/domain_name_test.go index 85c7fffc07d..dd45aaa736d 100644 --- a/internal/service/apigatewayv2/domain_name_test.go +++ b/internal/service/apigatewayv2/domain_name_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -424,7 +424,7 @@ func testAccCheckDomainNameDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindDomainName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/integration.go b/internal/service/apigatewayv2/integration.go index 92bc14cc5e1..69b13c7a6f4 100644 --- a/internal/service/apigatewayv2/integration.go +++ b/internal/service/apigatewayv2/integration.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -273,7 +274,7 @@ func resourceIntegrationRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findIntegrationByTwoPartKey(ctx, conn, d.Get("api_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 integration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/integration_response.go b/internal/service/apigatewayv2/integration_response.go index c916aba0d2a..facdc7e98c6 100644 --- a/internal/service/apigatewayv2/integration_response.go +++ b/internal/service/apigatewayv2/integration_response.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -107,7 +108,7 @@ func resourceIntegrationResponseRead(ctx context.Context, d *schema.ResourceData output, err := findIntegrationResponseByThreePartKey(ctx, conn, d.Get("api_id").(string), d.Get("integration_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Integration Response (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/integration_response_test.go b/internal/service/apigatewayv2/integration_response_test.go index 1c6d4172630..672af160ad5 100644 --- a/internal/service/apigatewayv2/integration_response_test.go +++ b/internal/service/apigatewayv2/integration_response_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -139,7 +139,7 @@ func testAccCheckIntegrationResponseDestroy(ctx context.Context) resource.TestCh _, err := tfapigatewayv2.FindIntegrationResponseByThreePartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes["integration_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/integration_test.go b/internal/service/apigatewayv2/integration_test.go index e18b779c4eb..b6e200bec52 100644 --- a/internal/service/apigatewayv2/integration_test.go +++ b/internal/service/apigatewayv2/integration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -619,7 +619,7 @@ func testAccCheckIntegrationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfapigatewayv2.FindIntegrationByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/model.go b/internal/service/apigatewayv2/model.go index 4e7054f94bf..b5e817d32de 100644 --- a/internal/service/apigatewayv2/model.go +++ b/internal/service/apigatewayv2/model.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceModelRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findModelByTwoPartKey(ctx, conn, d.Get("api_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Model (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/model_test.go b/internal/service/apigatewayv2/model_test.go index b656ef90088..3f1d01128b8 100644 --- a/internal/service/apigatewayv2/model_test.go +++ b/internal/service/apigatewayv2/model_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckModelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindModelByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/route.go b/internal/service/apigatewayv2/route.go index dbe4855f20c..89d1ab749fa 100644 --- a/internal/service/apigatewayv2/route.go +++ b/internal/service/apigatewayv2/route.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +172,7 @@ func resourceRouteRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findRouteByTwoPartKey(ctx, conn, d.Get("api_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Route (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/route_response.go b/internal/service/apigatewayv2/route_response.go index 1ae1732180a..dbaf43b7ad3 100644 --- a/internal/service/apigatewayv2/route_response.go +++ b/internal/service/apigatewayv2/route_response.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -97,7 +98,7 @@ func resourceRouteResponseRead(ctx context.Context, d *schema.ResourceData, meta output, err := findRouteResponseByThreePartKey(ctx, conn, d.Get("api_id").(string), d.Get("route_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 Route Response (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/apigatewayv2/route_response_test.go b/internal/service/apigatewayv2/route_response_test.go index 23b76be1659..5fe4d96a53e 100644 --- a/internal/service/apigatewayv2/route_response_test.go +++ b/internal/service/apigatewayv2/route_response_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -127,7 +127,7 @@ func testAccCheckRouteResponseDestroy(ctx context.Context) resource.TestCheckFun _, err := tfapigatewayv2.FindRouteResponseByThreePartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes["route_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/route_test.go b/internal/service/apigatewayv2/route_test.go index 9948d2ce212..7bddc471d0a 100644 --- a/internal/service/apigatewayv2/route_test.go +++ b/internal/service/apigatewayv2/route_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -502,7 +502,7 @@ func testAccCheckRouteDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindRouteByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/stage_test.go b/internal/service/apigatewayv2/stage_test.go index 80ee809914c..48063c3f79c 100644 --- a/internal/service/apigatewayv2/stage_test.go +++ b/internal/service/apigatewayv2/stage_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1079,7 +1079,7 @@ func testAccCheckStageDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindStageByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apigatewayv2/vpc_link.go b/internal/service/apigatewayv2/vpc_link.go index 8d22a23987c..63466ebab6a 100644 --- a/internal/service/apigatewayv2/vpc_link.go +++ b/internal/service/apigatewayv2/vpc_link.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -101,7 +102,7 @@ func resourceVPCLinkRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findVPCLinkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] API Gateway v2 VPC Link (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -199,7 +200,7 @@ func statusVPCLink(ctx context.Context, conn *apigatewayv2.Client, id string) sd return func() (any, string, error) { output, err := findVPCLinkByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apigatewayv2/vpc_link_test.go b/internal/service/apigatewayv2/vpc_link_test.go index cb1816e0a8d..52411f40a8c 100644 --- a/internal/service/apigatewayv2/vpc_link_test.go +++ b/internal/service/apigatewayv2/vpc_link_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckVPCLinkDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapigatewayv2.FindVPCLinkByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 731c004ee1a93a21e30c58ca35947b632ca140a7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:00 -0800 Subject: [PATCH 009/227] `appautoscaling` --- internal/service/appautoscaling/policy.go | 3 ++- internal/service/appautoscaling/policy_test.go | 4 ++-- internal/service/appautoscaling/scheduled_action.go | 3 ++- internal/service/appautoscaling/scheduled_action_test.go | 4 ++-- internal/service/appautoscaling/target.go | 3 ++- internal/service/appautoscaling/target_test.go | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/internal/service/appautoscaling/policy.go b/internal/service/appautoscaling/policy.go index a32c82d5320..184f5eec1e3 100644 --- a/internal/service/appautoscaling/policy.go +++ b/internal/service/appautoscaling/policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -555,7 +556,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d return findScalingPolicyByFourPartKey(ctx, conn, d.Get(names.AttrName).(string), d.Get("service_namespace").(string), d.Get(names.AttrResourceID).(string), d.Get("scalable_dimension").(string)) }) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] Application Auto Scaling Scaling Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appautoscaling/policy_test.go b/internal/service/appautoscaling/policy_test.go index b33215f2448..a88fc39e811 100644 --- a/internal/service/appautoscaling/policy_test.go +++ b/internal/service/appautoscaling/policy_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -611,7 +611,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappautoscaling.FindScalingPolicyByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes["service_namespace"], rs.Primary.Attributes[names.AttrResourceID], rs.Primary.Attributes["scalable_dimension"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appautoscaling/scheduled_action.go b/internal/service/appautoscaling/scheduled_action.go index d1dcd3a15b4..f0e61c282d4 100644 --- a/internal/service/appautoscaling/scheduled_action.go +++ b/internal/service/appautoscaling/scheduled_action.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" @@ -182,7 +183,7 @@ func resourceScheduledActionRead(ctx context.Context, d *schema.ResourceData, me scheduledAction, err := findScheduledActionByFourPartKey(ctx, conn, d.Get(names.AttrName).(string), d.Get("service_namespace").(string), d.Get(names.AttrResourceID).(string), d.Get("scalable_dimension").(string)) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] Application Auto Scaling Scheduled Action (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appautoscaling/scheduled_action_test.go b/internal/service/appautoscaling/scheduled_action_test.go index 76cba562029..4f203ab67ac 100644 --- a/internal/service/appautoscaling/scheduled_action_test.go +++ b/internal/service/appautoscaling/scheduled_action_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -777,7 +777,7 @@ func testAccCheckScheduledActionDestroy(ctx context.Context) resource.TestCheckF _, err := tfappautoscaling.FindScheduledActionByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes["service_namespace"], rs.Primary.Attributes[names.AttrResourceID], rs.Primary.Attributes["scalable_dimension"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appautoscaling/target.go b/internal/service/appautoscaling/target.go index 781e3f6a7b6..05f0d111450 100644 --- a/internal/service/appautoscaling/target.go +++ b/internal/service/appautoscaling/target.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -148,7 +149,7 @@ func resourceTargetRead(ctx context.Context, d *schema.ResourceData, meta any) d d.IsNewResource(), ) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Application AutoScaling Target (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appautoscaling/target_test.go b/internal/service/appautoscaling/target_test.go index a5b86ef6f4e..88d0e31866f 100644 --- a/internal/service/appautoscaling/target_test.go +++ b/internal/service/appautoscaling/target_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -309,7 +309,7 @@ func testAccCheckTargetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappautoscaling.FindTargetByThreePartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["service_namespace"], rs.Primary.Attributes["scalable_dimension"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 3f67948f55f4c3e68d55664a0a0e6404a7ea61c8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:01 -0800 Subject: [PATCH 010/227] `appconfig` --- internal/service/appconfig/application.go | 3 ++- internal/service/appconfig/application_test.go | 4 ++-- internal/service/appconfig/configuration_profile.go | 3 ++- internal/service/appconfig/configuration_profile_test.go | 4 ++-- internal/service/appconfig/deployment.go | 3 ++- internal/service/appconfig/deployment_strategy.go | 3 ++- internal/service/appconfig/deployment_strategy_test.go | 4 ++-- internal/service/appconfig/environment.go | 3 ++- internal/service/appconfig/environment_test.go | 4 ++-- internal/service/appconfig/extension.go | 3 ++- internal/service/appconfig/extension_association.go | 3 ++- internal/service/appconfig/extension_association_test.go | 4 ++-- internal/service/appconfig/extension_test.go | 4 ++-- internal/service/appconfig/hosted_configuration_version.go | 3 ++- .../service/appconfig/hosted_configuration_version_test.go | 4 ++-- 15 files changed, 30 insertions(+), 22 deletions(-) diff --git a/internal/service/appconfig/application.go b/internal/service/appconfig/application.go index ff5765acbdb..678120662d1 100644 --- a/internal/service/appconfig/application.go +++ b/internal/service/appconfig/application.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -87,7 +88,7 @@ func resourceApplicationRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findApplicationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/application_test.go b/internal/service/appconfig/application_test.go index 630372f6247..76208c3f96e 100644 --- a/internal/service/appconfig/application_test.go +++ b/internal/service/appconfig/application_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -163,7 +163,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfappconfig.FindApplicationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appconfig/configuration_profile.go b/internal/service/appconfig/configuration_profile.go index 4dc36cfe0b9..93caf22bca3 100644 --- a/internal/service/appconfig/configuration_profile.go +++ b/internal/service/appconfig/configuration_profile.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -189,7 +190,7 @@ func resourceConfigurationProfileRead(ctx context.Context, d *schema.ResourceDat output, err := findConfigurationProfileByTwoPartKey(ctx, conn, applicationID, configurationProfileID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Configuration Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/configuration_profile_test.go b/internal/service/appconfig/configuration_profile_test.go index da6d045d812..7637165b2c4 100644 --- a/internal/service/appconfig/configuration_profile_test.go +++ b/internal/service/appconfig/configuration_profile_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -314,7 +314,7 @@ func testAccCheckConfigurationProfileDestroy(ctx context.Context) resource.TestC _, err := tfappconfig.FindConfigurationProfileByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrApplicationID], rs.Primary.Attributes["configuration_profile_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appconfig/deployment.go b/internal/service/appconfig/deployment.go index cd67e939187..2c86d545926 100644 --- a/internal/service/appconfig/deployment.go +++ b/internal/service/appconfig/deployment.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -157,7 +158,7 @@ func resourceDeploymentRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findDeploymentByThreePartKey(ctx, conn, applicationID, environmentID, deploymentNumber) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Deployment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/deployment_strategy.go b/internal/service/appconfig/deployment_strategy.go index 6ccb8fdf4c8..9cf5e4bf19a 100644 --- a/internal/service/appconfig/deployment_strategy.go +++ b/internal/service/appconfig/deployment_strategy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -124,7 +125,7 @@ func resourceDeploymentStrategyRead(ctx context.Context, d *schema.ResourceData, output, err := findDeploymentStrategyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Deployment Strategy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/deployment_strategy_test.go b/internal/service/appconfig/deployment_strategy_test.go index ccadf32bf4c..bde1737f080 100644 --- a/internal/service/appconfig/deployment_strategy_test.go +++ b/internal/service/appconfig/deployment_strategy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckDeploymentStrategyDestroy(ctx context.Context) resource.TestChe _, err := tfappconfig.FindDeploymentStrategyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appconfig/environment.go b/internal/service/appconfig/environment.go index 9fbc2041d4e..493ab62dfac 100644 --- a/internal/service/appconfig/environment.go +++ b/internal/service/appconfig/environment.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -163,7 +164,7 @@ func (r *environmentResource) Read(ctx context.Context, request resource.ReadReq output, err := findEnvironmentByTwoPartKey(ctx, conn, data.ApplicationID.ValueString(), data.EnvironmentID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/appconfig/environment_test.go b/internal/service/appconfig/environment_test.go index fd60abf6d44..0c6fda85080 100644 --- a/internal/service/appconfig/environment_test.go +++ b/internal/service/appconfig/environment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -364,7 +364,7 @@ func testAccCheckEnvironmentDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfappconfig.FindEnvironmentByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrApplicationID], rs.Primary.Attributes["environment_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appconfig/extension.go b/internal/service/appconfig/extension.go index 4796d5c2357..f09c8e517bf 100644 --- a/internal/service/appconfig/extension.go +++ b/internal/service/appconfig/extension.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -156,7 +157,7 @@ func resourceExtensionRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findExtensionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Extension (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/extension_association.go b/internal/service/appconfig/extension_association.go index 193e44bc4ad..4e3a0e58709 100644 --- a/internal/service/appconfig/extension_association.go +++ b/internal/service/appconfig/extension_association.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -94,7 +95,7 @@ func resourceExtensionAssociationRead(ctx context.Context, d *schema.ResourceDat output, err := findExtensionAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Extension Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/extension_association_test.go b/internal/service/appconfig/extension_association_test.go index d9186b06763..6451a105e52 100644 --- a/internal/service/appconfig/extension_association_test.go +++ b/internal/service/appconfig/extension_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -139,7 +139,7 @@ func testAccCheckExtensionAssociationDestroy(ctx context.Context) resource.TestC _, err := tfappconfig.FindExtensionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appconfig/extension_test.go b/internal/service/appconfig/extension_test.go index bbc245ab9ba..38233a2bc99 100644 --- a/internal/service/appconfig/extension_test.go +++ b/internal/service/appconfig/extension_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -286,7 +286,7 @@ func testAccCheckExtensionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappconfig.FindExtensionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appconfig/hosted_configuration_version.go b/internal/service/appconfig/hosted_configuration_version.go index 5d3e5d0f965..d10a268b755 100644 --- a/internal/service/appconfig/hosted_configuration_version.go +++ b/internal/service/appconfig/hosted_configuration_version.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -118,7 +119,7 @@ func resourceHostedConfigurationVersionRead(ctx context.Context, d *schema.Resou output, err := findHostedConfigurationVersionByThreePartKey(ctx, conn, applicationID, configurationProfileID, versionNumber) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppConfig Hosted Configuration Version (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appconfig/hosted_configuration_version_test.go b/internal/service/appconfig/hosted_configuration_version_test.go index 066d6328492..4a3186c93c1 100644 --- a/internal/service/appconfig/hosted_configuration_version_test.go +++ b/internal/service/appconfig/hosted_configuration_version_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +87,7 @@ func testAccCheckHostedConfigurationVersionDestroy(ctx context.Context) resource _, err := tfappconfig.FindHostedConfigurationVersionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrApplicationID], rs.Primary.Attributes["configuration_profile_id"], flex.StringValueToInt32Value(rs.Primary.Attributes["version_number"])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 01142062bcef06eca0bcb1a6d552e22ec1522fbb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:03 -0800 Subject: [PATCH 011/227] `appfabric` --- internal/service/appfabric/app_authorization.go | 5 +++-- internal/service/appfabric/app_authorization_connection.go | 5 +++-- internal/service/appfabric/app_authorization_test.go | 4 ++-- internal/service/appfabric/app_bundle.go | 3 ++- internal/service/appfabric/app_bundle_test.go | 4 ++-- internal/service/appfabric/ingestion.go | 3 ++- internal/service/appfabric/ingestion_destination.go | 5 +++-- internal/service/appfabric/ingestion_destination_test.go | 4 ++-- internal/service/appfabric/ingestion_test.go | 4 ++-- 9 files changed, 21 insertions(+), 16 deletions(-) diff --git a/internal/service/appfabric/app_authorization.go b/internal/service/appfabric/app_authorization.go index f05eab8182a..a5635893436 100644 --- a/internal/service/appfabric/app_authorization.go +++ b/internal/service/appfabric/app_authorization.go @@ -33,6 +33,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -279,7 +280,7 @@ func (r *appAuthorizationResource) Read(ctx context.Context, request resource.Re output, err := findAppAuthorizationByTwoPartKey(ctx, conn, data.AppAuthorizationARN.ValueString(), data.AppBundleARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -432,7 +433,7 @@ func statusAppAuthorization(ctx context.Context, conn *appfabric.Client, appAuth return func() (any, string, error) { output, err := findAppAuthorizationByTwoPartKey(ctx, conn, appAuthorizationARN, appBundleIdentifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/appfabric/app_authorization_connection.go b/internal/service/appfabric/app_authorization_connection.go index e8fd925bd30..65e6a96b84f 100644 --- a/internal/service/appfabric/app_authorization_connection.go +++ b/internal/service/appfabric/app_authorization_connection.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +178,7 @@ func (r *appAuthorizationConnectionResource) Read(ctx context.Context, request r output, err := findAppAuthorizationConnectionByTwoPartKey(ctx, conn, data.AppAuthorizationARN.ValueString(), data.AppBundleARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -229,7 +230,7 @@ func statusConnectAppAuthorization(ctx context.Context, conn *appfabric.Client, return func() (any, string, error) { output, err := findAppAuthorizationConnectionByTwoPartKey(ctx, conn, appAuthorizationARN, appBundleArn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/appfabric/app_authorization_test.go b/internal/service/appfabric/app_authorization_test.go index f926e3cbe6d..51cca682cb8 100644 --- a/internal/service/appfabric/app_authorization_test.go +++ b/internal/service/appfabric/app_authorization_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappfabric "github.com/hashicorp/terraform-provider-aws/internal/service/appfabric" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -229,7 +229,7 @@ func testAccCheckAppAuthorizationDestroy(ctx context.Context) resource.TestCheck _, err := tfappfabric.FindAppAuthorizationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrARN], rs.Primary.Attributes["app_bundle_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appfabric/app_bundle.go b/internal/service/appfabric/app_bundle.go index 50846bf623b..702e2add66a 100644 --- a/internal/service/appfabric/app_bundle.go +++ b/internal/service/appfabric/app_bundle.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -110,7 +111,7 @@ func (r *appBundleResource) Read(ctx context.Context, request resource.ReadReque appBundle, err := findAppBundleByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/appfabric/app_bundle_test.go b/internal/service/appfabric/app_bundle_test.go index 19f098a9beb..92b17f085b0 100644 --- a/internal/service/appfabric/app_bundle_test.go +++ b/internal/service/appfabric/app_bundle_test.go @@ -22,8 +22,8 @@ import ( tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappfabric "github.com/hashicorp/terraform-provider-aws/internal/service/appfabric" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -606,7 +606,7 @@ func testAccCheckAppBundleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappfabric.FindAppBundleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appfabric/ingestion.go b/internal/service/appfabric/ingestion.go index 5fd89387721..4570a6b83d7 100644 --- a/internal/service/appfabric/ingestion.go +++ b/internal/service/appfabric/ingestion.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -156,7 +157,7 @@ func (r *ingestionResource) Read(ctx context.Context, request resource.ReadReque ingestion, err := findIngestionByTwoPartKey(ctx, conn, data.AppBundleARN.ValueString(), data.ARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/appfabric/ingestion_destination.go b/internal/service/appfabric/ingestion_destination.go index 3fb2fc36836..1453160e396 100644 --- a/internal/service/appfabric/ingestion_destination.go +++ b/internal/service/appfabric/ingestion_destination.go @@ -34,6 +34,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -276,7 +277,7 @@ func (r *ingestionDestinationResource) Read(ctx context.Context, request resourc output, err := findIngestionDestinationByThreePartKey(ctx, conn, data.AppBundleARN.ValueString(), data.IngestionARN.ValueString(), data.ARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -414,7 +415,7 @@ func statusIngestionDestination(ctx context.Context, conn *appfabric.Client, app return func() (any, string, error) { output, err := findIngestionDestinationByThreePartKey(ctx, conn, appBundleARN, ingestionARN, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/appfabric/ingestion_destination_test.go b/internal/service/appfabric/ingestion_destination_test.go index b0651df2165..c17d42aaeec 100644 --- a/internal/service/appfabric/ingestion_destination_test.go +++ b/internal/service/appfabric/ingestion_destination_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappfabric "github.com/hashicorp/terraform-provider-aws/internal/service/appfabric" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -258,7 +258,7 @@ func testAccCheckIngestionDestinationDestroy(ctx context.Context) resource.TestC _, err := tfappfabric.FindIngestionDestinationByThreePartKey(ctx, conn, rs.Primary.Attributes["app_bundle_arn"], rs.Primary.Attributes["ingestion_arn"], rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appfabric/ingestion_test.go b/internal/service/appfabric/ingestion_test.go index 769b952e2b1..686ea3343cf 100644 --- a/internal/service/appfabric/ingestion_test.go +++ b/internal/service/appfabric/ingestion_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappfabric "github.com/hashicorp/terraform-provider-aws/internal/service/appfabric" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -153,7 +153,7 @@ func testAccCheckIngestionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappfabric.FindIngestionByTwoPartKey(ctx, conn, rs.Primary.Attributes["app_bundle_arn"], rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7f9bfe624d2e943ac3516755a940ff13a8201222 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:04 -0800 Subject: [PATCH 012/227] `appflow` --- internal/service/appflow/connector_profile.go | 3 ++- internal/service/appflow/connector_profile_test.go | 4 ++-- internal/service/appflow/flow.go | 5 +++-- internal/service/appflow/flow_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/appflow/connector_profile.go b/internal/service/appflow/connector_profile.go index 989a45dabbb..22fae34ff9e 100644 --- a/internal/service/appflow/connector_profile.go +++ b/internal/service/appflow/connector_profile.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -1476,7 +1477,7 @@ func resourceConnectorProfileRead(ctx context.Context, d *schema.ResourceData, m connectorProfile, err := findConnectorProfileByName(ctx, conn, d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppFlow Connector Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appflow/connector_profile_test.go b/internal/service/appflow/connector_profile_test.go index 4091371978f..277da6f8716 100644 --- a/internal/service/appflow/connector_profile_test.go +++ b/internal/service/appflow/connector_profile_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappflow "github.com/hashicorp/terraform-provider-aws/internal/service/appflow" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func testAccCheckConnectorProfileDestroy(ctx context.Context) resource.TestCheck _, err := tfappflow.FindConnectorProfileByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appflow/flow.go b/internal/service/appflow/flow.go index e44285030d2..4358bdf71e9 100644 --- a/internal/service/appflow/flow.go +++ b/internal/service/appflow/flow.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -1384,7 +1385,7 @@ func resourceFlowRead(ctx context.Context, d *schema.ResourceData, meta any) dia flowDefinition, err := findFlowByName(ctx, conn, d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppFlow Flow (%s) not found, removing from state", d.Get(names.AttrName)) d.SetId("") return diags @@ -1534,7 +1535,7 @@ func statusFlow(ctx context.Context, conn *appflow.Client, name string) sdkretry return func() (any, string, error) { output, err := findFlowByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/appflow/flow_test.go b/internal/service/appflow/flow_test.go index 8476ad7610b..67e7fb405b2 100644 --- a/internal/service/appflow/flow_test.go +++ b/internal/service/appflow/flow_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappflow "github.com/hashicorp/terraform-provider-aws/internal/service/appflow" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -898,7 +898,7 @@ func testAccCheckFlowDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappflow.FindFlowByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8605972dafcb0da0f54f19d75bc3cffc8cd3f553 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:05 -0800 Subject: [PATCH 013/227] `applicationinsights` --- internal/service/applicationinsights/application.go | 5 +++-- internal/service/applicationinsights/application_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/applicationinsights/application.go b/internal/service/applicationinsights/application.go index 689a2d70e80..3c313ad6cba 100644 --- a/internal/service/applicationinsights/application.go +++ b/internal/service/applicationinsights/application.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -126,7 +127,7 @@ func resourceApplicationRead(ctx context.Context, d *schema.ResourceData, meta a application, err := findApplicationByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ApplicationInsights Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -247,7 +248,7 @@ func statusApplication(ctx context.Context, conn *applicationinsights.Client, na return func() (any, string, error) { output, err := findApplicationByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/applicationinsights/application_test.go b/internal/service/applicationinsights/application_test.go index 7bc028b4a1b..1a51ebd36e1 100644 --- a/internal/service/applicationinsights/application_test.go +++ b/internal/service/applicationinsights/application_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapplicationinsights "github.com/hashicorp/terraform-provider-aws/internal/service/applicationinsights" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +133,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfapplicationinsights.FindApplicationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5d9037d62a9c5d9980af0497c26e319f72498703 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:06 -0800 Subject: [PATCH 014/227] `appmesh` --- internal/service/appmesh/gateway_route.go | 3 ++- internal/service/appmesh/gateway_route_test.go | 4 ++-- internal/service/appmesh/mesh.go | 3 ++- internal/service/appmesh/mesh_test.go | 4 ++-- internal/service/appmesh/route.go | 3 ++- internal/service/appmesh/route_test.go | 4 ++-- internal/service/appmesh/virtual_gateway.go | 3 ++- internal/service/appmesh/virtual_gateway_test.go | 4 ++-- internal/service/appmesh/virtual_node.go | 3 ++- internal/service/appmesh/virtual_node_test.go | 4 ++-- internal/service/appmesh/virtual_router.go | 3 ++- internal/service/appmesh/virtual_router_test.go | 4 ++-- internal/service/appmesh/virtual_service.go | 3 ++- internal/service/appmesh/virtual_service_test.go | 4 ++-- 14 files changed, 28 insertions(+), 21 deletions(-) diff --git a/internal/service/appmesh/gateway_route.go b/internal/service/appmesh/gateway_route.go index e7b5bcd94c1..293e3b69b74 100644 --- a/internal/service/appmesh/gateway_route.go +++ b/internal/service/appmesh/gateway_route.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -543,7 +544,7 @@ func resourceGatewayRouteRead(ctx context.Context, d *schema.ResourceData, meta return findGatewayRouteByFourPartKey(ctx, conn, d.Get("mesh_name").(string), d.Get("mesh_owner").(string), d.Get("virtual_gateway_name").(string), d.Get(names.AttrName).(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Gateway Route (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/gateway_route_test.go b/internal/service/appmesh/gateway_route_test.go index e3f58685ea1..a8ba0da78d0 100644 --- a/internal/service/appmesh/gateway_route_test.go +++ b/internal/service/appmesh/gateway_route_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1321,7 +1321,7 @@ func testAccCheckGatewayRouteDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfappmesh.FindGatewayRouteByFourPartKey(ctx, conn, rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["mesh_owner"], rs.Primary.Attributes["virtual_gateway_name"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appmesh/mesh.go b/internal/service/appmesh/mesh.go index 71843540e82..b280fadaad3 100644 --- a/internal/service/appmesh/mesh.go +++ b/internal/service/appmesh/mesh.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -151,7 +152,7 @@ func resourceMeshRead(ctx context.Context, d *schema.ResourceData, meta any) dia return findMeshByTwoPartKey(ctx, conn, d.Id(), d.Get("mesh_owner").(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Service Mesh (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/mesh_test.go b/internal/service/appmesh/mesh_test.go index 2f9184b4f61..80cbf60870e 100644 --- a/internal/service/appmesh/mesh_test.go +++ b/internal/service/appmesh/mesh_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func testAccCheckServiceMeshDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfappmesh.FindMeshByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["mesh_owner"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appmesh/route.go b/internal/service/appmesh/route.go index 01322aea6b9..c72aae031ed 100644 --- a/internal/service/appmesh/route.go +++ b/internal/service/appmesh/route.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -782,7 +783,7 @@ func resourceRouteRead(ctx context.Context, d *schema.ResourceData, meta any) di return findRouteByFourPartKey(ctx, conn, d.Get("mesh_name").(string), d.Get("mesh_owner").(string), d.Get("virtual_router_name").(string), d.Get(names.AttrName).(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Route (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/route_test.go b/internal/service/appmesh/route_test.go index 6ac09bb5343..508f829c3ff 100644 --- a/internal/service/appmesh/route_test.go +++ b/internal/service/appmesh/route_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2062,7 +2062,7 @@ func testAccCheckRouteDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappmesh.FindRouteByFourPartKey(ctx, conn, rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["mesh_owner"], rs.Primary.Attributes["virtual_router_name"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appmesh/virtual_gateway.go b/internal/service/appmesh/virtual_gateway.go index e750fc88bb2..20908fa005e 100644 --- a/internal/service/appmesh/virtual_gateway.go +++ b/internal/service/appmesh/virtual_gateway.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -691,7 +692,7 @@ func resourceVirtualGatewayRead(ctx context.Context, d *schema.ResourceData, met return findVirtualGatewayByThreePartKey(ctx, conn, d.Get("mesh_name").(string), d.Get("mesh_owner").(string), d.Get(names.AttrName).(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Virtual Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/virtual_gateway_test.go b/internal/service/appmesh/virtual_gateway_test.go index 8f4fd239577..80d5dd596f5 100644 --- a/internal/service/appmesh/virtual_gateway_test.go +++ b/internal/service/appmesh/virtual_gateway_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -884,7 +884,7 @@ func testAccCheckVirtualGatewayDestroy(ctx context.Context) resource.TestCheckFu _, err := tfappmesh.FindVirtualGatewayByThreePartKey(ctx, conn, rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["mesh_owner"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appmesh/virtual_node.go b/internal/service/appmesh/virtual_node.go index 29ac0121ba9..b63e3f41249 100644 --- a/internal/service/appmesh/virtual_node.go +++ b/internal/service/appmesh/virtual_node.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -1008,7 +1009,7 @@ func resourceVirtualNodeRead(ctx context.Context, d *schema.ResourceData, meta a return findVirtualNodeByThreePartKey(ctx, conn, d.Get("mesh_name").(string), d.Get("mesh_owner").(string), d.Get(names.AttrName).(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Virtual Node (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/virtual_node_test.go b/internal/service/appmesh/virtual_node_test.go index a4e2364a501..94047e5cdc0 100644 --- a/internal/service/appmesh/virtual_node_test.go +++ b/internal/service/appmesh/virtual_node_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1425,7 +1425,7 @@ func testAccCheckVirtualNodeDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfappmesh.FindVirtualNodeByThreePartKey(ctx, conn, rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["mesh_owner"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appmesh/virtual_router.go b/internal/service/appmesh/virtual_router.go index bc79230e2fd..c48baa3c34c 100644 --- a/internal/service/appmesh/virtual_router.go +++ b/internal/service/appmesh/virtual_router.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -169,7 +170,7 @@ func resourceVirtualRouterRead(ctx context.Context, d *schema.ResourceData, meta return findVirtualRouterByThreePartKey(ctx, conn, d.Get("mesh_name").(string), d.Get("mesh_owner").(string), d.Get(names.AttrName).(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Virtual Router (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/virtual_router_test.go b/internal/service/appmesh/virtual_router_test.go index b773f835c59..5bdc5232eb5 100644 --- a/internal/service/appmesh/virtual_router_test.go +++ b/internal/service/appmesh/virtual_router_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -178,7 +178,7 @@ func testAccCheckVirtualRouterDestroy(ctx context.Context) resource.TestCheckFun _, err := tfappmesh.FindVirtualRouterByThreePartKey(ctx, conn, rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["mesh_owner"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appmesh/virtual_service.go b/internal/service/appmesh/virtual_service.go index 12d434bedfd..cb66c1c207c 100644 --- a/internal/service/appmesh/virtual_service.go +++ b/internal/service/appmesh/virtual_service.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -177,7 +178,7 @@ func resourceVirtualServiceRead(ctx context.Context, d *schema.ResourceData, met return findVirtualServiceByThreePartKey(ctx, conn, d.Get("mesh_name").(string), d.Get("mesh_owner").(string), d.Get(names.AttrName).(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Mesh Virtual Service (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appmesh/virtual_service_test.go b/internal/service/appmesh/virtual_service_test.go index e3fed27749c..406732dabde 100644 --- a/internal/service/appmesh/virtual_service_test.go +++ b/internal/service/appmesh/virtual_service_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckVirtualServiceDestroy(ctx context.Context) resource.TestCheckFu _, err := tfappmesh.FindVirtualServiceByThreePartKey(ctx, conn, rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["mesh_owner"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 75cbd8bb40784e40ad7e4ebc11b0512b41ed4101 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:07 -0800 Subject: [PATCH 015/227] `apprunner` --- .../service/apprunner/auto_scaling_configuration_version.go | 5 +++-- .../apprunner/auto_scaling_configuration_version_test.go | 4 ++-- internal/service/apprunner/connection.go | 5 +++-- internal/service/apprunner/connection_test.go | 4 ++-- internal/service/apprunner/custom_domain_association.go | 5 +++-- internal/service/apprunner/custom_domain_association_test.go | 4 ++-- .../apprunner/default_auto_scaling_configuration_version.go | 4 ++-- internal/service/apprunner/deployment.go | 5 +++-- internal/service/apprunner/observability_configuration.go | 5 +++-- .../service/apprunner/observability_configuration_test.go | 4 ++-- internal/service/apprunner/service.go | 5 +++-- internal/service/apprunner/service_test.go | 4 ++-- internal/service/apprunner/vpc_connector.go | 5 +++-- internal/service/apprunner/vpc_connector_test.go | 4 ++-- internal/service/apprunner/vpc_ingress_connection.go | 5 +++-- internal/service/apprunner/vpc_ingress_connection_test.go | 4 ++-- 16 files changed, 40 insertions(+), 32 deletions(-) diff --git a/internal/service/apprunner/auto_scaling_configuration_version.go b/internal/service/apprunner/auto_scaling_configuration_version.go index dcc91674499..80f122d98fb 100644 --- a/internal/service/apprunner/auto_scaling_configuration_version.go +++ b/internal/service/apprunner/auto_scaling_configuration_version.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -137,7 +138,7 @@ func resourceAutoScalingConfigurationRead(ctx context.Context, d *schema.Resourc config, err := findAutoScalingConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner AutoScaling Configuration Version (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -264,7 +265,7 @@ func statusAutoScalingConfiguration(ctx context.Context, conn *apprunner.Client, return func() (any, string, error) { output, err := findAutoScalingConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/auto_scaling_configuration_version_test.go b/internal/service/apprunner/auto_scaling_configuration_version_test.go index 845bc7df616..46667b6cebf 100644 --- a/internal/service/apprunner/auto_scaling_configuration_version_test.go +++ b/internal/service/apprunner/auto_scaling_configuration_version_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -273,7 +273,7 @@ func testAccCheckAutoScalingConfigurationVersionDestroy(ctx context.Context) res _, err := tfapprunner.FindAutoScalingConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apprunner/connection.go b/internal/service/apprunner/connection.go index 38fd3be9902..a058b7edca7 100644 --- a/internal/service/apprunner/connection.go +++ b/internal/service/apprunner/connection.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -92,7 +93,7 @@ func resourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta an c, err := findConnectionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -200,7 +201,7 @@ func statusConnection(ctx context.Context, conn *apprunner.Client, name string) return func() (any, string, error) { output, err := findConnectionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/connection_test.go b/internal/service/apprunner/connection_test.go index 17332533d42..a94449164c4 100644 --- a/internal/service/apprunner/connection_test.go +++ b/internal/service/apprunner/connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +85,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapprunner.FindConnectionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apprunner/custom_domain_association.go b/internal/service/apprunner/custom_domain_association.go index 5e653bbc5b1..3495e0162db 100644 --- a/internal/service/apprunner/custom_domain_association.go +++ b/internal/service/apprunner/custom_domain_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -134,7 +135,7 @@ func resourceCustomDomainAssociationRead(ctx context.Context, d *schema.Resource customDomain, err := findCustomDomainByTwoPartKey(ctx, conn, domainName, serviceArn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner Custom Domain Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -278,7 +279,7 @@ func statusCustomDomain(ctx context.Context, conn *apprunner.Client, domainName, return func() (any, string, error) { output, err := findCustomDomainByTwoPartKey(ctx, conn, domainName, serviceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/custom_domain_association_test.go b/internal/service/apprunner/custom_domain_association_test.go index 38b780e0ab2..f8e9589c6b8 100644 --- a/internal/service/apprunner/custom_domain_association_test.go +++ b/internal/service/apprunner/custom_domain_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func testAccCheckCustomDomainAssociationDestroy(ctx context.Context) resource.Te _, err := tfapprunner.FindCustomDomainByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrDomainName], rs.Primary.Attributes["service_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apprunner/default_auto_scaling_configuration_version.go b/internal/service/apprunner/default_auto_scaling_configuration_version.go index 30b42d35771..b60fcf448f6 100644 --- a/internal/service/apprunner/default_auto_scaling_configuration_version.go +++ b/internal/service/apprunner/default_auto_scaling_configuration_version.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +78,7 @@ func (r *defaultAutoScalingConfigurationVersionResource) Read(ctx context.Contex output, err := findDefaultAutoScalingConfigurationSummary(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/apprunner/deployment.go b/internal/service/apprunner/deployment.go index f718b9ed520..9c5f3a86f3e 100644 --- a/internal/service/apprunner/deployment.go +++ b/internal/service/apprunner/deployment.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -129,7 +130,7 @@ func (r *deploymentResource) Read(ctx context.Context, req resource.ReadRequest, serviceARN, operationID := data.ServiceARN.ValueString(), data.OperationID.ValueString() output, err := findOperationByTwoPartKey(ctx, conn, serviceARN, operationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) @@ -199,7 +200,7 @@ func statusOperation(ctx context.Context, conn *apprunner.Client, serviceARN, op return func() (any, string, error) { output, err := findOperationByTwoPartKey(ctx, conn, serviceARN, operationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/observability_configuration.go b/internal/service/apprunner/observability_configuration.go index b4af70ebe1a..5630ab4eb49 100644 --- a/internal/service/apprunner/observability_configuration.go +++ b/internal/service/apprunner/observability_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceObservabilityConfigurationRead(ctx context.Context, d *schema.Resou config, err := findObservabilityConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner Observability Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -201,7 +202,7 @@ func statusObservabilityConfiguration(ctx context.Context, conn *apprunner.Clien return func() (any, string, error) { output, err := findObservabilityConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/observability_configuration_test.go b/internal/service/apprunner/observability_configuration_test.go index adbd2df0128..955eaf91530 100644 --- a/internal/service/apprunner/observability_configuration_test.go +++ b/internal/service/apprunner/observability_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -116,7 +116,7 @@ func testAccCheckObservabilityConfigurationDestroy(ctx context.Context) resource _, err := tfapprunner.FindObservabilityConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apprunner/service.go b/internal/service/apprunner/service.go index e70c2774355..fb53397e59c 100644 --- a/internal/service/apprunner/service.go +++ b/internal/service/apprunner/service.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -487,7 +488,7 @@ func resourceServiceRead(ctx context.Context, d *schema.ResourceData, meta any) service, err := findServiceByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner Service (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -656,7 +657,7 @@ func statusService(ctx context.Context, conn *apprunner.Client, arn string) sdkr return func() (any, string, error) { output, err := findServiceByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/service_test.go b/internal/service/apprunner/service_test.go index 9bfc9a51adf..623ff42bc8f 100644 --- a/internal/service/apprunner/service_test.go +++ b/internal/service/apprunner/service_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -519,7 +519,7 @@ func testAccCheckServiceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfapprunner.FindServiceByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apprunner/vpc_connector.go b/internal/service/apprunner/vpc_connector.go index 1cb017e3136..fec5f2627a4 100644 --- a/internal/service/apprunner/vpc_connector.go +++ b/internal/service/apprunner/vpc_connector.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -108,7 +109,7 @@ func resourceVPCConnectorRead(ctx context.Context, d *schema.ResourceData, meta vpcConnector, err := findVPCConnectorByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner VPC Connector (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -195,7 +196,7 @@ func statusVPCConnector(ctx context.Context, conn *apprunner.Client, arn string) return func() (any, string, error) { output, err := findVPCConnectorByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/vpc_connector_test.go b/internal/service/apprunner/vpc_connector_test.go index f2839134458..e801f8b9506 100644 --- a/internal/service/apprunner/vpc_connector_test.go +++ b/internal/service/apprunner/vpc_connector_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +85,7 @@ func testAccCheckVPCConnectorDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfapprunner.FindVPCConnectorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/apprunner/vpc_ingress_connection.go b/internal/service/apprunner/vpc_ingress_connection.go index 47eabe6fe96..ae21be4f37a 100644 --- a/internal/service/apprunner/vpc_ingress_connection.go +++ b/internal/service/apprunner/vpc_ingress_connection.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -123,7 +124,7 @@ func resourceVPCIngressConnectionRead(ctx context.Context, d *schema.ResourceDat connection, err := findVPCIngressConnectionByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] App Runner VPC Ingress Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -212,7 +213,7 @@ func statusVPCIngressConnection(ctx context.Context, conn *apprunner.Client, arn return func() (any, string, error) { output, err := findVPCIngressConnectionByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/apprunner/vpc_ingress_connection_test.go b/internal/service/apprunner/vpc_ingress_connection_test.go index db17da6f564..9ab1757ccbc 100644 --- a/internal/service/apprunner/vpc_ingress_connection_test.go +++ b/internal/service/apprunner/vpc_ingress_connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -90,7 +90,7 @@ func testAccCheckVPCIngressConnectionDestroy(ctx context.Context) resource.TestC _, err := tfapprunner.FindVPCIngressConnectionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From b28b8104e88d4e5c305bdde08be6e4fc96359f78 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:08 -0800 Subject: [PATCH 016/227] `appstream` --- internal/service/appstream/directory_config.go | 3 ++- internal/service/appstream/directory_config_test.go | 4 ++-- internal/service/appstream/fleet.go | 5 +++-- internal/service/appstream/fleet_stack_association.go | 3 ++- internal/service/appstream/fleet_stack_association_test.go | 4 ++-- internal/service/appstream/fleet_test.go | 4 ++-- internal/service/appstream/image_builder.go | 5 +++-- internal/service/appstream/image_builder_test.go | 4 ++-- internal/service/appstream/stack.go | 3 ++- internal/service/appstream/stack_test.go | 4 ++-- internal/service/appstream/user.go | 3 ++- internal/service/appstream/user_stack_association.go | 3 ++- internal/service/appstream/user_stack_association_test.go | 4 ++-- internal/service/appstream/user_test.go | 4 ++-- 14 files changed, 30 insertions(+), 23 deletions(-) diff --git a/internal/service/appstream/directory_config.go b/internal/service/appstream/directory_config.go index e6396b18169..824bc33e5f1 100644 --- a/internal/service/appstream/directory_config.go +++ b/internal/service/appstream/directory_config.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -125,7 +126,7 @@ func resourceDirectoryConfigRead(ctx context.Context, d *schema.ResourceData, me directoryConfig, err := findDirectoryConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppStream Directory Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appstream/directory_config_test.go b/internal/service/appstream/directory_config_test.go index 56d52695644..773845f9b4d 100644 --- a/internal/service/appstream/directory_config_test.go +++ b/internal/service/appstream/directory_config_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -223,7 +223,7 @@ func testAccCheckDirectoryConfigDestroy(ctx context.Context) resource.TestCheckF _, err := tfappstream.FindDirectoryConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appstream/fleet.go b/internal/service/appstream/fleet.go index d637f86ec75..a5cf53b3a7f 100644 --- a/internal/service/appstream/fleet.go +++ b/internal/service/appstream/fleet.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -329,7 +330,7 @@ func resourceFleetRead(ctx context.Context, d *schema.ResourceData, meta any) di fleet, err := findFleetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppStream Fleet (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -606,7 +607,7 @@ func statusFleet(ctx context.Context, conn *appstream.Client, id string) sdkretr return func() (any, string, error) { output, err := findFleetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/appstream/fleet_stack_association.go b/internal/service/appstream/fleet_stack_association.go index 046ea505772..6c343d1bcb3 100644 --- a/internal/service/appstream/fleet_stack_association.go +++ b/internal/service/appstream/fleet_stack_association.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -87,7 +88,7 @@ func resourceFleetStackAssociationRead(ctx context.Context, d *schema.ResourceDa err = findFleetStackAssociationByTwoPartKey(ctx, conn, fleetName, stackName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppStream Fleet Stack Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appstream/fleet_stack_association_test.go b/internal/service/appstream/fleet_stack_association_test.go index 82e846b5bc8..9fb94f43529 100644 --- a/internal/service/appstream/fleet_stack_association_test.go +++ b/internal/service/appstream/fleet_stack_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -86,7 +86,7 @@ func testAccCheckFleetStackAssociationDestroy(ctx context.Context) resource.Test err := tfappstream.FindFleetStackAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["fleet_name"], rs.Primary.Attributes["stack_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appstream/fleet_test.go b/internal/service/appstream/fleet_test.go index 12ed20d01e3..cec86e33801 100644 --- a/internal/service/appstream/fleet_test.go +++ b/internal/service/appstream/fleet_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -364,7 +364,7 @@ func testAccCheckFleetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappstream.FindFleetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appstream/image_builder.go b/internal/service/appstream/image_builder.go index a7d94bb5b43..7b32a8a11ee 100644 --- a/internal/service/appstream/image_builder.go +++ b/internal/service/appstream/image_builder.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -255,7 +256,7 @@ func resourceImageBuilderRead(ctx context.Context, d *schema.ResourceData, meta imageBuilder, err := findImageBuilderByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppStream ImageBuilder (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -377,7 +378,7 @@ func statusImageBuilder(ctx context.Context, conn *appstream.Client, id string) return func() (any, string, error) { output, err := findImageBuilderByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/appstream/image_builder_test.go b/internal/service/appstream/image_builder_test.go index d96e052d5a4..40c1ccc57a3 100644 --- a/internal/service/appstream/image_builder_test.go +++ b/internal/service/appstream/image_builder_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +238,7 @@ func testAccCheckImageBuilderDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfappstream.FindImageBuilderByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appstream/stack.go b/internal/service/appstream/stack.go index 168368dc7dc..b54d7efd2af 100644 --- a/internal/service/appstream/stack.go +++ b/internal/service/appstream/stack.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -320,7 +321,7 @@ func resourceStackRead(ctx context.Context, d *schema.ResourceData, meta any) di stack, err := findStackByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppStream Stack (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appstream/stack_test.go b/internal/service/appstream/stack_test.go index 061eb667c58..ffa4143be01 100644 --- a/internal/service/appstream/stack_test.go +++ b/internal/service/appstream/stack_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -377,7 +377,7 @@ func testAccCheckStackDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappstream.FindStackByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appstream/user.go b/internal/service/appstream/user.go index 2af0e65ed7e..f60192b77b7 100644 --- a/internal/service/appstream/user.go +++ b/internal/service/appstream/user.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -147,7 +148,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia user, err := findUserByTwoPartKey(ctx, conn, userName, authType) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] AppStream User (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appstream/user_stack_association.go b/internal/service/appstream/user_stack_association.go index 5e2e9c1e6e5..1a5d3785b86 100644 --- a/internal/service/appstream/user_stack_association.go +++ b/internal/service/appstream/user_stack_association.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +109,7 @@ func resourceUserStackAssociationRead(ctx context.Context, d *schema.ResourceDat association, err := findUserStackAssociationByThreePartKey(ctx, conn, userName, authType, stackName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AppStream User Stack Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/appstream/user_stack_association_test.go b/internal/service/appstream/user_stack_association_test.go index 37f1b9dc8b1..7c73aba3e6f 100644 --- a/internal/service/appstream/user_stack_association_test.go +++ b/internal/service/appstream/user_stack_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func testAccCheckUserStackAssociationDestroy(ctx context.Context) resource.TestC _, err := tfappstream.FindUserStackAssociationByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserName], awstypes.AuthenticationType(rs.Primary.Attributes["authentication_type"]), rs.Primary.Attributes["stack_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appstream/user_test.go b/internal/service/appstream/user_test.go index 255cebe38f9..1ce4b13c448 100644 --- a/internal/service/appstream/user_test.go +++ b/internal/service/appstream/user_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -151,7 +151,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappstream.FindUserByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserName], awstypes.AuthenticationType(rs.Primary.Attributes["authentication_type"])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 512c0e42ed10accc5f0b64e4a9eb2507118f7454 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:09 -0800 Subject: [PATCH 017/227] `appsync` --- internal/service/appsync/api_cache_test.go | 4 ++-- internal/service/appsync/api_key_test.go | 4 ++-- internal/service/appsync/api_test.go | 4 ++-- internal/service/appsync/channel_namespace_test.go | 4 ++-- internal/service/appsync/datasource_test.go | 4 ++-- internal/service/appsync/domain_name_api_association_test.go | 4 ++-- internal/service/appsync/domain_name_test.go | 4 ++-- internal/service/appsync/function_test.go | 4 ++-- internal/service/appsync/graphql_api_test.go | 4 ++-- internal/service/appsync/resolver_test.go | 4 ++-- internal/service/appsync/source_api_association_test.go | 4 ++-- internal/service/appsync/type_test.go | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/service/appsync/api_cache_test.go b/internal/service/appsync/api_cache_test.go index 0e73cb9b59e..aa07a6016e5 100644 --- a/internal/service/appsync/api_cache_test.go +++ b/internal/service/appsync/api_cache_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func testAccCheckAPICacheDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindAPICacheByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/api_key_test.go b/internal/service/appsync/api_key_test.go index b7331674857..b7ea5308b1d 100644 --- a/internal/service/appsync/api_key_test.go +++ b/internal/service/appsync/api_key_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +135,7 @@ func testAccCheckAPIKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindAPIKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes["api_key_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/api_test.go b/internal/service/appsync/api_test.go index a85bc435597..b3505635d49 100644 --- a/internal/service/appsync/api_test.go +++ b/internal/service/appsync/api_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -230,7 +230,7 @@ func testAccCheckAPIDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindAPIByID(ctx, conn, rs.Primary.Attributes["api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/channel_namespace_test.go b/internal/service/appsync/channel_namespace_test.go index 37ae0c7fd1e..2b5f734e6fe 100644 --- a/internal/service/appsync/channel_namespace_test.go +++ b/internal/service/appsync/channel_namespace_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -260,7 +260,7 @@ func testAccCheckChannelNamespaceDestroy(ctx context.Context) resource.TestCheck _, err := tfappsync.FindChannelNamespaceByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/datasource_test.go b/internal/service/appsync/datasource_test.go index cdee0bef689..1adc8fa89f1 100644 --- a/internal/service/appsync/datasource_test.go +++ b/internal/service/appsync/datasource_test.go @@ -14,9 +14,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -628,7 +628,7 @@ func testAccCheckDataSourceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindDataSourceByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/domain_name_api_association_test.go b/internal/service/appsync/domain_name_api_association_test.go index f7a1b6d1c89..786c252465d 100644 --- a/internal/service/appsync/domain_name_api_association_test.go +++ b/internal/service/appsync/domain_name_api_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckDomainNameAPIAssociationDestroy(ctx context.Context) resource.T _, err := tfappsync.FindDomainNameAPIAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/domain_name_test.go b/internal/service/appsync/domain_name_test.go index 36710ed83f7..3cb803926b7 100644 --- a/internal/service/appsync/domain_name_test.go +++ b/internal/service/appsync/domain_name_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func testAccCheckDomainNameDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindDomainNameByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/function_test.go b/internal/service/appsync/function_test.go index 9162e44053f..64b99deddca 100644 --- a/internal/service/appsync/function_test.go +++ b/internal/service/appsync/function_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +238,7 @@ func testAccCheckFunctionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindFunctionByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes["function_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/graphql_api_test.go b/internal/service/appsync/graphql_api_test.go index 66273a3400b..fb766890811 100644 --- a/internal/service/appsync/graphql_api_test.go +++ b/internal/service/appsync/graphql_api_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1307,7 +1307,7 @@ func testAccCheckGraphQLAPIDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindGraphQLAPIByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/resolver_test.go b/internal/service/appsync/resolver_test.go index 91074bc76f5..2639bd7ab3f 100644 --- a/internal/service/appsync/resolver_test.go +++ b/internal/service/appsync/resolver_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -370,7 +370,7 @@ func testAccCheckResolverDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindResolverByThreePartKey(ctx, conn, rs.Primary.Attributes["api_id"], rs.Primary.Attributes[names.AttrType], rs.Primary.Attributes[names.AttrField]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/source_api_association_test.go b/internal/service/appsync/source_api_association_test.go index 95d46fe4e13..4e17525b79f 100644 --- a/internal/service/appsync/source_api_association_test.go +++ b/internal/service/appsync/source_api_association_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -151,7 +151,7 @@ func testAccCheckSourceAPIAssociationDestroy(ctx context.Context) resource.TestC _, err := tfappsync.FindSourceAPIAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAssociationID], rs.Primary.Attributes["merged_api_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/appsync/type_test.go b/internal/service/appsync/type_test.go index 05c7ce1acf2..179f7236236 100644 --- a/internal/service/appsync/type_test.go +++ b/internal/service/appsync/type_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -86,7 +86,7 @@ func testAccCheckTypeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfappsync.FindTypeByThreePartKey(ctx, conn, rs.Primary.Attributes["api_id"], awstypes.TypeDefinitionFormat(rs.Primary.Attributes[names.AttrFormat]), rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From ae06ea14668599cf7e26bd3df06c1fc509e98fcb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:10 -0800 Subject: [PATCH 018/227] `athena` --- internal/service/athena/capacity_reservation.go | 5 +++-- internal/service/athena/capacity_reservation_test.go | 4 ++-- internal/service/athena/data_catalog.go | 3 ++- internal/service/athena/data_catalog_test.go | 4 ++-- internal/service/athena/database.go | 3 ++- internal/service/athena/database_test.go | 4 ++-- internal/service/athena/named_query.go | 3 ++- internal/service/athena/named_query_test.go | 4 ++-- internal/service/athena/prepared_statement.go | 3 ++- internal/service/athena/prepared_statement_test.go | 4 ++-- internal/service/athena/workgroup.go | 3 ++- internal/service/athena/workgroup_test.go | 4 ++-- 12 files changed, 25 insertions(+), 19 deletions(-) diff --git a/internal/service/athena/capacity_reservation.go b/internal/service/athena/capacity_reservation.go index 79a2f22680e..73352e93c26 100644 --- a/internal/service/athena/capacity_reservation.go +++ b/internal/service/athena/capacity_reservation.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -139,7 +140,7 @@ func (r *capacityReservationResource) Read(ctx context.Context, req resource.Rea } out, err := findCapacityReservationByName(ctx, conn, state.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -302,7 +303,7 @@ func waitCapacityReservationCancelled(ctx context.Context, conn *athena.Client, func statusCapacityReservation(ctx context.Context, conn *athena.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findCapacityReservationByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/athena/capacity_reservation_test.go b/internal/service/athena/capacity_reservation_test.go index b5229019573..dae0e8c671e 100644 --- a/internal/service/athena/capacity_reservation_test.go +++ b/internal/service/athena/capacity_reservation_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -202,7 +202,7 @@ func testAccCheckCapacityReservationDestroy(ctx context.Context) resource.TestCh name := rs.Primary.Attributes[names.AttrName] _, err := tfathena.FindCapacityReservationByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/athena/data_catalog.go b/internal/service/athena/data_catalog.go index ce3108652cc..805b2a39121 100644 --- a/internal/service/athena/data_catalog.go +++ b/internal/service/athena/data_catalog.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceDataCatalogRead(ctx context.Context, d *schema.ResourceData, meta a dataCatalog, err := findDataCatalogByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Athena Data Catalog (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/athena/data_catalog_test.go b/internal/service/athena/data_catalog_test.go index e84079e72a2..697965c5214 100644 --- a/internal/service/athena/data_catalog_test.go +++ b/internal/service/athena/data_catalog_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -279,7 +279,7 @@ func testAccCheckDataCatalogDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfathena.FindDataCatalogByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/athena/database.go b/internal/service/athena/database.go index 680acf92ee1..1581faef794 100644 --- a/internal/service/athena/database.go +++ b/internal/service/athena/database.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -174,7 +175,7 @@ func resourceDatabaseRead(ctx context.Context, d *schema.ResourceData, meta any) db, err := findDatabaseByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Athena Database (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/athena/database_test.go b/internal/service/athena/database_test.go index 8facb035dd5..1613d059760 100644 --- a/internal/service/athena/database_test.go +++ b/internal/service/athena/database_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -412,7 +412,7 @@ func testAccCheckDatabaseDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfathena.FindDatabaseByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/athena/named_query.go b/internal/service/athena/named_query.go index 14a12582a08..418089ce0f6 100644 --- a/internal/service/athena/named_query.go +++ b/internal/service/athena/named_query.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +99,7 @@ func resourceNamedQueryRead(ctx context.Context, d *schema.ResourceData, meta an namedQuery, err := findNamedQueryByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Athena Named Query (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/athena/named_query_test.go b/internal/service/athena/named_query_test.go index 278aacae2d2..a5e678e4c9a 100644 --- a/internal/service/athena/named_query_test.go +++ b/internal/service/athena/named_query_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +78,7 @@ func testAccCheckNamedQueryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfathena.FindNamedQueryByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/athena/prepared_statement.go b/internal/service/athena/prepared_statement.go index 095f43d94a2..f86d845cd9d 100644 --- a/internal/service/athena/prepared_statement.go +++ b/internal/service/athena/prepared_statement.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +109,7 @@ func resourcePreparedStatementRead(ctx context.Context, d *schema.ResourceData, preparedStatement, err := findPreparedStatementByTwoPartKey(ctx, conn, workGroupName, statementName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Athena Prepared Statement (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/athena/prepared_statement_test.go b/internal/service/athena/prepared_statement_test.go index ea832d17e21..1cdb615b751 100644 --- a/internal/service/athena/prepared_statement_test.go +++ b/internal/service/athena/prepared_statement_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +133,7 @@ func testAccCheckPreparedStatementDestroy(ctx context.Context) resource.TestChec _, err := tfathena.FindPreparedStatementByTwoPartKey(ctx, conn, rs.Primary.Attributes["workgroup"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/athena/workgroup.go b/internal/service/athena/workgroup.go index bde87b89380..a0cb63f5099 100644 --- a/internal/service/athena/workgroup.go +++ b/internal/service/athena/workgroup.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -245,7 +246,7 @@ func resourceWorkGroupRead(ctx context.Context, d *schema.ResourceData, meta any wg, err := findWorkGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Athena WorkGroup (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/athena/workgroup_test.go b/internal/service/athena/workgroup_test.go index 153fe5677ff..e2b190929b6 100644 --- a/internal/service/athena/workgroup_test.go +++ b/internal/service/athena/workgroup_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -717,7 +717,7 @@ func testAccCheckWorkGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfathena.FindWorkGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5292c92f4031583462a8fac22f334dacf213298d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:11 -0800 Subject: [PATCH 019/227] `auditmanager` --- internal/service/auditmanager/account_registration.go | 5 +++-- internal/service/auditmanager/assessment.go | 3 ++- internal/service/auditmanager/assessment_delegation.go | 3 ++- internal/service/auditmanager/assessment_delegation_test.go | 4 ++-- internal/service/auditmanager/assessment_report.go | 3 ++- internal/service/auditmanager/assessment_report_test.go | 4 ++-- internal/service/auditmanager/assessment_test.go | 4 ++-- internal/service/auditmanager/control.go | 3 ++- internal/service/auditmanager/control_test.go | 4 ++-- internal/service/auditmanager/framework.go | 3 ++- internal/service/auditmanager/framework_share.go | 6 +++--- internal/service/auditmanager/framework_share_test.go | 4 ++-- internal/service/auditmanager/framework_test.go | 4 ++-- .../auditmanager/organization_admin_account_registration.go | 3 ++- .../organization_admin_account_registration_test.go | 4 ++-- 15 files changed, 32 insertions(+), 25 deletions(-) diff --git a/internal/service/auditmanager/account_registration.go b/internal/service/auditmanager/account_registration.go index 8fbc4c786e9..3ce8bab126d 100644 --- a/internal/service/auditmanager/account_registration.go +++ b/internal/service/auditmanager/account_registration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +93,7 @@ func (r *accountRegistrationResource) Read(ctx context.Context, request resource // account status. output, err := findAccountRegistration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -218,7 +219,7 @@ func statusAccountRegistration(ctx context.Context, conn *auditmanager.Client) s return func() (any, string, error) { output, err := findAccountRegistration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/auditmanager/assessment.go b/internal/service/auditmanager/assessment.go index 5de711518bd..cb16a055230 100644 --- a/internal/service/auditmanager/assessment.go +++ b/internal/service/auditmanager/assessment.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -212,7 +213,7 @@ func (r *assessmentResource) Read(ctx context.Context, request resource.ReadRequ output, err := findAssessmentByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/auditmanager/assessment_delegation.go b/internal/service/auditmanager/assessment_delegation.go index ba1b32858b3..4abb1e56592 100644 --- a/internal/service/auditmanager/assessment_delegation.go +++ b/internal/service/auditmanager/assessment_delegation.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -192,7 +193,7 @@ func (r *assessmentDelegationResource) Read(ctx context.Context, request resourc assessmentID, roleARN, controlSetID := parts[0], parts[1], parts[2] output, err := findAssessmentDelegationByThreePartKey(ctx, conn, assessmentID, roleARN, controlSetID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/auditmanager/assessment_delegation_test.go b/internal/service/auditmanager/assessment_delegation_test.go index cd9c76e32fa..c915127eb54 100644 --- a/internal/service/auditmanager/assessment_delegation_test.go +++ b/internal/service/auditmanager/assessment_delegation_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckAssessmentDelegationDestroy(ctx context.Context) resource.TestC _, err := tfauditmanager.FindAssessmentDelegationByThreePartKey(ctx, conn, rs.Primary.Attributes["assessment_id"], rs.Primary.Attributes[names.AttrRoleARN], rs.Primary.Attributes["control_set_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/auditmanager/assessment_report.go b/internal/service/auditmanager/assessment_report.go index e227587f3f0..c5b7d32d2dc 100644 --- a/internal/service/auditmanager/assessment_report.go +++ b/internal/service/auditmanager/assessment_report.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +113,7 @@ func (r *assessmentReportResource) Read(ctx context.Context, request resource.Re output, err := findAssessmentReportByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/auditmanager/assessment_report_test.go b/internal/service/auditmanager/assessment_report_test.go index a28ab29b3da..75ac8e06575 100644 --- a/internal/service/auditmanager/assessment_report_test.go +++ b/internal/service/auditmanager/assessment_report_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckAssessmentReportDestroy(ctx context.Context) resource.TestCheck _, err := tfauditmanager.FindAssessmentReportByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/auditmanager/assessment_test.go b/internal/service/auditmanager/assessment_test.go index 098dc687106..ae206e10256 100644 --- a/internal/service/auditmanager/assessment_test.go +++ b/internal/service/auditmanager/assessment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -191,7 +191,7 @@ func testAccCheckAssessmentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfauditmanager.FindAssessmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/auditmanager/control.go b/internal/service/auditmanager/control.go index 7204adbbab4..f2915eca773 100644 --- a/internal/service/auditmanager/control.go +++ b/internal/service/auditmanager/control.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -159,7 +160,7 @@ func (r *controlResource) Read(ctx context.Context, request resource.ReadRequest output, err := findControlByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/auditmanager/control_test.go b/internal/service/auditmanager/control_test.go index 3ccef121ed8..5517460b688 100644 --- a/internal/service/auditmanager/control_test.go +++ b/internal/service/auditmanager/control_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -266,7 +266,7 @@ func testAccCheckControlDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfauditmanager.FindControlByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/auditmanager/framework.go b/internal/service/auditmanager/framework.go index f62d4c6b065..7bffb623699 100644 --- a/internal/service/auditmanager/framework.go +++ b/internal/service/auditmanager/framework.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -148,7 +149,7 @@ func (r *frameworkResource) Read(ctx context.Context, request resource.ReadReque output, err := findFrameworkByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/auditmanager/framework_share.go b/internal/service/auditmanager/framework_share.go index 48c219a251d..b9590b8c51b 100644 --- a/internal/service/auditmanager/framework_share.go +++ b/internal/service/auditmanager/framework_share.go @@ -24,7 +24,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func (r *frameworkShareResource) Read(ctx context.Context, request resource.Read output, err := findFrameworkShareByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -155,7 +155,7 @@ func (r *frameworkShareResource) Delete(ctx context.Context, request resource.De id := fwflex.StringValueFromFramework(ctx, data.ID) output, err := findFrameworkShareByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } diff --git a/internal/service/auditmanager/framework_share_test.go b/internal/service/auditmanager/framework_share_test.go index 7b2d5b731b0..76c553f008a 100644 --- a/internal/service/auditmanager/framework_share_test.go +++ b/internal/service/auditmanager/framework_share_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -149,7 +149,7 @@ func testAccCheckFrameworkShareDestroy(ctx context.Context) resource.TestCheckFu _, err := tfauditmanager.FindFrameworkShareByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/auditmanager/framework_test.go b/internal/service/auditmanager/framework_test.go index c553c95ade2..53b96d2898b 100644 --- a/internal/service/auditmanager/framework_test.go +++ b/internal/service/auditmanager/framework_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -187,7 +187,7 @@ func testAccCheckFrameworkDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfauditmanager.FindFrameworkByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/auditmanager/organization_admin_account_registration.go b/internal/service/auditmanager/organization_admin_account_registration.go index 3d8b4479be1..befc6f5bcea 100644 --- a/internal/service/auditmanager/organization_admin_account_registration.go +++ b/internal/service/auditmanager/organization_admin_account_registration.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +97,7 @@ func (r *organizationAdminAccountRegistrationResource) Read(ctx context.Context, output, err := conn.GetOrganizationAdminAccount(ctx, &auditmanager.GetOrganizationAdminAccountInput{}) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/auditmanager/organization_admin_account_registration_test.go b/internal/service/auditmanager/organization_admin_account_registration_test.go index b11f71cc68f..659ab85ae37 100644 --- a/internal/service/auditmanager/organization_admin_account_registration_test.go +++ b/internal/service/auditmanager/organization_admin_account_registration_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfauditmanager "github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckOrganizationAdminAccountRegistrationDestroy(ctx context.Context _, err := tfauditmanager.FindOrganizationAdminAccount(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From e6d75ea4f7feba8250f69b37da6a29fbdf93fd72 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:12 -0800 Subject: [PATCH 020/227] `autoscaling` --- internal/service/autoscaling/attachment.go | 3 ++- .../service/autoscaling/attachment_test.go | 4 ++-- internal/service/autoscaling/group.go | 19 ++++++++++--------- internal/service/autoscaling/group_tag.go | 4 ++-- .../service/autoscaling/group_tag_test.go | 4 ++-- internal/service/autoscaling/group_test.go | 4 ++-- .../autoscaling/launch_configuration.go | 5 +++-- .../autoscaling/launch_configuration_test.go | 4 ++-- .../service/autoscaling/lifecycle_hook.go | 3 ++- .../autoscaling/lifecycle_hook_test.go | 4 ++-- internal/service/autoscaling/notification.go | 3 ++- .../service/autoscaling/notification_test.go | 3 ++- internal/service/autoscaling/policy.go | 3 ++- internal/service/autoscaling/policy_test.go | 4 ++-- internal/service/autoscaling/schedule.go | 3 ++- internal/service/autoscaling/schedule_test.go | 4 ++-- .../autoscaling/traffic_source_attachment.go | 5 +++-- .../traffic_source_attachment_test.go | 4 ++-- 18 files changed, 46 insertions(+), 37 deletions(-) diff --git a/internal/service/autoscaling/attachment.go b/internal/service/autoscaling/attachment.go index 5377073cbf8..97e95849385 100644 --- a/internal/service/autoscaling/attachment.go +++ b/internal/service/autoscaling/attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -109,7 +110,7 @@ func resourceAttachmentRead(ctx context.Context, d *schema.ResourceData, meta an err = findAttachmentByTargetGroupARN(ctx, conn, asgName, d.Get("lb_target_group_arn").(string)) } - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Group Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/autoscaling/attachment_test.go b/internal/service/autoscaling/attachment_test.go index 4896d59ac72..8ffd60a4086 100644 --- a/internal/service/autoscaling/attachment_test.go +++ b/internal/service/autoscaling/attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckAttachmentDestroy(ctx context.Context) resource.TestCheckFunc { err = tfautoscaling.FindAttachmentByTargetGroupARN(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.Attributes["lb_target_group_arn"]) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/group.go b/internal/service/autoscaling/group.go index d0fced0aa32..e54d24057c8 100644 --- a/internal/service/autoscaling/group.go +++ b/internal/service/autoscaling/group.go @@ -34,6 +34,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -1328,7 +1329,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di g, err := findGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Group %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -1865,7 +1866,7 @@ func resourceGroupDelete(ctx context.Context, d *schema.ResourceData, meta any) group, err := findGroupByName(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -2454,7 +2455,7 @@ func statusGroupInstanceCount(ctx context.Context, conn *autoscaling.Client, nam return func() (any, string, error) { output, err := findGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2475,7 +2476,7 @@ func statusInstanceRefresh(ctx context.Context, conn *autoscaling.Client, name, output, err := findInstanceRefresh(ctx, conn, &input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2491,7 +2492,7 @@ func statusLoadBalancerInStateCount(ctx context.Context, conn *autoscaling.Clien return func() (any, string, error) { output, err := findLoadBalancerStates(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2515,7 +2516,7 @@ func statusLoadBalancerTargetGroupInStateCount(ctx context.Context, conn *autosc return func() (any, string, error) { output, err := findLoadBalancerTargetGroupStates(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2539,7 +2540,7 @@ func statusTrafficSourcesInStateCount(ctx context.Context, conn *autoscaling.Cli return func() (any, string, error) { output, err := findTrafficSourceStatesByTwoPartKey(ctx, conn, asgName, trafficSourceType) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2563,7 +2564,7 @@ func statusWarmPool(ctx context.Context, conn *autoscaling.Client, name string) return func() (any, string, error) { output, err := findWarmPoolByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2579,7 +2580,7 @@ func statusWarmPoolInstanceCount(ctx context.Context, conn *autoscaling.Client, return func() (any, string, error) { output, err := findWarmPoolByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/autoscaling/group_tag.go b/internal/service/autoscaling/group_tag.go index 722c4a976bb..dfd2766456e 100644 --- a/internal/service/autoscaling/group_tag.go +++ b/internal/service/autoscaling/group_tag.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func resourceGroupTagRead(ctx context.Context, d *schema.ResourceData, meta any) value, err := findTag(ctx, conn, identifier, TagResourceTypeGroup, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AutoScaling Group (%s) tag (%s), removing from state", identifier, key) d.SetId("") return diags diff --git a/internal/service/autoscaling/group_tag_test.go b/internal/service/autoscaling/group_tag_test.go index e118c5a797a..5ce6a48b703 100644 --- a/internal/service/autoscaling/group_tag_test.go +++ b/internal/service/autoscaling/group_tag_test.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func testAccCheckGroupTagDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfautoscaling.FindTag(ctx, conn, identifier, tfautoscaling.TagResourceTypeGroup, key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/group_test.go b/internal/service/autoscaling/group_test.go index fef7b79d75e..eb4e369d190 100644 --- a/internal/service/autoscaling/group_test.go +++ b/internal/service/autoscaling/group_test.go @@ -22,9 +22,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" tfelasticloadbalancingv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -4273,7 +4273,7 @@ func testAccCheckGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfautoscaling.FindGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/launch_configuration.go b/internal/service/autoscaling/launch_configuration.go index 26dd2a31307..7b46f2863cc 100644 --- a/internal/service/autoscaling/launch_configuration.go +++ b/internal/service/autoscaling/launch_configuration.go @@ -26,6 +26,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -431,7 +432,7 @@ func resourceLaunchConfigurationRead(ctx context.Context, d *schema.ResourceData lc, err := findLaunchConfigurationByName(ctx, autoscalingconn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Launch Configuration %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -475,7 +476,7 @@ func resourceLaunchConfigurationRead(ctx context.Context, d *schema.ResourceData rootDeviceName, err := findImageRootDeviceName(ctx, ec2conn, d.Get("image_id").(string)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Don't block a refresh for a bad image. rootDeviceName = "" } else if err != nil { diff --git a/internal/service/autoscaling/launch_configuration_test.go b/internal/service/autoscaling/launch_configuration_test.go index 3161ab693ec..8112f8eb4d8 100644 --- a/internal/service/autoscaling/launch_configuration_test.go +++ b/internal/service/autoscaling/launch_configuration_test.go @@ -17,9 +17,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -753,7 +753,7 @@ func testAccCheckLaunchConfigurationDestroy(ctx context.Context) resource.TestCh _, err := tfautoscaling.FindLaunchConfigurationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/lifecycle_hook.go b/internal/service/autoscaling/lifecycle_hook.go index ac48e22768b..ff1eab2790c 100644 --- a/internal/service/autoscaling/lifecycle_hook.go +++ b/internal/service/autoscaling/lifecycle_hook.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -143,7 +144,7 @@ func resourceLifecycleHookRead(ctx context.Context, d *schema.ResourceData, meta p, err := findLifecycleHookByTwoPartKey(ctx, conn, d.Get("autoscaling_group_name").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Lifecycle Hook %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/autoscaling/lifecycle_hook_test.go b/internal/service/autoscaling/lifecycle_hook_test.go index e76791ba9d2..7df50aa79c9 100644 --- a/internal/service/autoscaling/lifecycle_hook_test.go +++ b/internal/service/autoscaling/lifecycle_hook_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func testAccCheckLifecycleHookDestroy(ctx context.Context) resource.TestCheckFun _, err := tfautoscaling.FindLifecycleHookByTwoPartKey(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/notification.go b/internal/service/autoscaling/notification.go index 71a453a1fce..7c4eb617a58 100644 --- a/internal/service/autoscaling/notification.go +++ b/internal/service/autoscaling/notification.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -76,7 +77,7 @@ func resourceNotificationRead(ctx context.Context, d *schema.ResourceData, meta err = tfresource.NewEmptyResultError(nil) } - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Notification %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/autoscaling/notification_test.go b/internal/service/autoscaling/notification_test.go index 4d5bc624c8e..345a7c65f50 100644 --- a/internal/service/autoscaling/notification_test.go +++ b/internal/service/autoscaling/notification_test.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -173,7 +174,7 @@ func testAccCheckNotificationDestroy(ctx context.Context, groups []string) resou err = tfresource.NewEmptyResultError(nil) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/policy.go b/internal/service/autoscaling/policy.go index b65eef022a8..3f577999f3a 100644 --- a/internal/service/autoscaling/policy.go +++ b/internal/service/autoscaling/policy.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -537,7 +538,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d p, err := findScalingPolicyByTwoPartKey(ctx, conn, d.Get("autoscaling_group_name").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Policy %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/autoscaling/policy_test.go b/internal/service/autoscaling/policy_test.go index 5013691cf4e..93ca49828d4 100644 --- a/internal/service/autoscaling/policy_test.go +++ b/internal/service/autoscaling/policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -583,7 +583,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfautoscaling.FindScalingPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/schedule.go b/internal/service/autoscaling/schedule.go index 8857886edf7..0ad87b2e45e 100644 --- a/internal/service/autoscaling/schedule.go +++ b/internal/service/autoscaling/schedule.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -161,7 +162,7 @@ func resourceScheduleRead(ctx context.Context, d *schema.ResourceData, meta any) sa, err := findScheduleByTwoPartKey(ctx, conn, d.Get("autoscaling_group_name").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Scheduled Action %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/autoscaling/schedule_test.go b/internal/service/autoscaling/schedule_test.go index f8b0cd09f66..f29c10eaa5a 100644 --- a/internal/service/autoscaling/schedule_test.go +++ b/internal/service/autoscaling/schedule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -219,7 +219,7 @@ func testAccCheckScheduleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfautoscaling.FindScheduleByTwoPartKey(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/autoscaling/traffic_source_attachment.go b/internal/service/autoscaling/traffic_source_attachment.go index 5ab767bf46a..d5559dfc045 100644 --- a/internal/service/autoscaling/traffic_source_attachment.go +++ b/internal/service/autoscaling/traffic_source_attachment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -109,7 +110,7 @@ func resourceTrafficSourceAttachmentRead(ctx context.Context, d *schema.Resource _, err = findTrafficSourceAttachmentByThreePartKey(ctx, conn, asgName, trafficSourceType, trafficSourceID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Auto Scaling Traffic Source Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -197,7 +198,7 @@ func statusTrafficSourceAttachment(ctx context.Context, conn *autoscaling.Client return func() (any, string, error) { output, err := findTrafficSourceAttachmentByThreePartKey(ctx, conn, asgName, trafficSourceType, trafficSourceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/autoscaling/traffic_source_attachment_test.go b/internal/service/autoscaling/traffic_source_attachment_test.go index 91cce0067a1..ea074ba36ad 100644 --- a/internal/service/autoscaling/traffic_source_attachment_test.go +++ b/internal/service/autoscaling/traffic_source_attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckTrafficSourceAttachmentDestroy(ctx context.Context) resource.Te _, err := tfautoscaling.FindTrafficSourceAttachmentByThreePartKey(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.Attributes["traffic_source.0.type"], rs.Primary.Attributes["traffic_source.0.identifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From c36b2c18702f870e9088d9f77a3e9a3076e6a120 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:13 -0800 Subject: [PATCH 021/227] `autoscalingplans` --- internal/service/autoscalingplans/scaling_plan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/autoscalingplans/scaling_plan.go b/internal/service/autoscalingplans/scaling_plan.go index 4f5cce5acc2..579d12bf832 100644 --- a/internal/service/autoscalingplans/scaling_plan.go +++ b/internal/service/autoscalingplans/scaling_plan.go @@ -844,7 +844,7 @@ func statusScalingPlanCode(conn *autoscalingplans.Client, scalingPlanName string return func(ctx context.Context) (any, string, error) { scalingPlan, err := findScalingPlanByNameAndVersion(ctx, conn, scalingPlanName, scalingPlanVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 60906d0b6631a551d2f1c036df142939fdd1a462 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:14 -0800 Subject: [PATCH 022/227] `backup` --- internal/service/backup/framework.go | 5 +++-- internal/service/backup/framework_test.go | 4 ++-- internal/service/backup/global_settings.go | 3 ++- internal/service/backup/logically_air_gapped_vault.go | 5 +++-- internal/service/backup/logically_air_gapped_vault_test.go | 4 ++-- internal/service/backup/plan.go | 3 ++- internal/service/backup/plan_test.go | 4 ++-- internal/service/backup/region_settings.go | 3 ++- internal/service/backup/report_plan.go | 5 +++-- internal/service/backup/report_plan_test.go | 4 ++-- internal/service/backup/restore_testing_plan.go | 3 ++- internal/service/backup/restore_testing_plan_test.go | 4 ++-- internal/service/backup/restore_testing_selection.go | 3 ++- internal/service/backup/restore_testing_selection_test.go | 4 ++-- internal/service/backup/selection.go | 3 ++- internal/service/backup/selection_test.go | 4 ++-- internal/service/backup/vault.go | 5 +++-- internal/service/backup/vault_lock_configuration.go | 4 ++-- internal/service/backup/vault_lock_configuration_test.go | 4 ++-- internal/service/backup/vault_notifications.go | 3 ++- internal/service/backup/vault_notifications_test.go | 4 ++-- internal/service/backup/vault_policy.go | 3 ++- internal/service/backup/vault_policy_test.go | 4 ++-- internal/service/backup/vault_test.go | 5 +++-- 24 files changed, 53 insertions(+), 40 deletions(-) diff --git a/internal/service/backup/framework.go b/internal/service/backup/framework.go index 1376ec3c3c6..00c5b5a607d 100644 --- a/internal/service/backup/framework.go +++ b/internal/service/backup/framework.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func resourceFrameworkRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findFrameworkByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Framework (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -292,7 +293,7 @@ func statusFramework(ctx context.Context, conn *backup.Client, name string) sdkr return func() (any, string, error) { output, err := findFrameworkByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/backup/framework_test.go b/internal/service/backup/framework_test.go index fc44915baea..ccda35d6d94 100644 --- a/internal/service/backup/framework_test.go +++ b/internal/service/backup/framework_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -420,7 +420,7 @@ func testAccCheckFrameworkDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbackup.FindFrameworkByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/global_settings.go b/internal/service/backup/global_settings.go index ebc1cec6e7f..e13b9e21c0d 100644 --- a/internal/service/backup/global_settings.go +++ b/internal/service/backup/global_settings.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -66,7 +67,7 @@ func resourceGlobalSettingsRead(ctx context.Context, d *schema.ResourceData, met output, err := findGlobalSettings(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Global Settings (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/logically_air_gapped_vault.go b/internal/service/backup/logically_air_gapped_vault.go index 17b6bd1eeb0..3344eb79ae5 100644 --- a/internal/service/backup/logically_air_gapped_vault.go +++ b/internal/service/backup/logically_air_gapped_vault.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -162,7 +163,7 @@ func (r *logicallyAirGappedVaultResource) Read(ctx context.Context, request reso name := fwflex.StringValueFromFramework(ctx, data.ID) output, err := findLogicallyAirGappedBackupVaultByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -241,7 +242,7 @@ func statusLogicallyAirGappedVault(ctx context.Context, conn *backup.Client, nam return func() (any, string, error) { output, err := findLogicallyAirGappedBackupVaultByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/backup/logically_air_gapped_vault_test.go b/internal/service/backup/logically_air_gapped_vault_test.go index 204f6704581..2da60cbc43c 100644 --- a/internal/service/backup/logically_air_gapped_vault_test.go +++ b/internal/service/backup/logically_air_gapped_vault_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func testAccCheckLogicallyAirGappedVaultDestroy(ctx context.Context) resource.Te _, err := tfbackup.FindLogicallyAirGappedBackupVaultByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/plan.go b/internal/service/backup/plan.go index 2f83a975726..78ed08632df 100644 --- a/internal/service/backup/plan.go +++ b/internal/service/backup/plan.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -235,7 +236,7 @@ func resourcePlanRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findPlanByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Plan (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/plan_test.go b/internal/service/backup/plan_test.go index b07777dd561..4fa965d6a6a 100644 --- a/internal/service/backup/plan_test.go +++ b/internal/service/backup/plan_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -744,7 +744,7 @@ func testAccCheckPlanDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbackup.FindPlanByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/region_settings.go b/internal/service/backup/region_settings.go index a8ced1b4198..dbb3cf54982 100644 --- a/internal/service/backup/region_settings.go +++ b/internal/service/backup/region_settings.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -79,7 +80,7 @@ func resourceRegionSettingsRead(ctx context.Context, d *schema.ResourceData, met output, err := findRegionSettings(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Region Settings (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/report_plan.go b/internal/service/backup/report_plan.go index 2ec94f0c803..78ac921c6dc 100644 --- a/internal/service/backup/report_plan.go +++ b/internal/service/backup/report_plan.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -181,7 +182,7 @@ func resourceReportPlanRead(ctx context.Context, d *schema.ResourceData, meta an reportPlan, err := findReportPlanByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Report Plan %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -403,7 +404,7 @@ func statusReportPlan(ctx context.Context, conn *backup.Client, name string) sdk return func() (any, string, error) { output, err := findReportPlanByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/backup/report_plan_test.go b/internal/service/backup/report_plan_test.go index 0b9db52ebfb..1e4c02091a9 100644 --- a/internal/service/backup/report_plan_test.go +++ b/internal/service/backup/report_plan_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -258,7 +258,7 @@ func testAccCheckReportPlanDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbackup.FindReportPlanByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/restore_testing_plan.go b/internal/service/backup/restore_testing_plan.go index acc790dfcee..603d9f5bb98 100644 --- a/internal/service/backup/restore_testing_plan.go +++ b/internal/service/backup/restore_testing_plan.go @@ -32,6 +32,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -210,7 +211,7 @@ func (r *restoreTestingPlanResource) Read(ctx context.Context, request resource. name := data.RestoreTestingPlanName.ValueString() restoreTestingPlan, err := findRestoreTestingPlanByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/backup/restore_testing_plan_test.go b/internal/service/backup/restore_testing_plan_test.go index dcd02c01c73..3a527f152c0 100644 --- a/internal/service/backup/restore_testing_plan_test.go +++ b/internal/service/backup/restore_testing_plan_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -320,7 +320,7 @@ func testAccCheckRestoreTestingPlanDestroy(ctx context.Context) resource.TestChe _, err := tfbackup.FindRestoreTestingPlanByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/restore_testing_selection.go b/internal/service/backup/restore_testing_selection.go index c2830bf5f45..305eb178531 100644 --- a/internal/service/backup/restore_testing_selection.go +++ b/internal/service/backup/restore_testing_selection.go @@ -35,6 +35,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -233,7 +234,7 @@ func (r *restoreTestingSelectionResource) Read(ctx context.Context, request reso name := data.RestoreTestingSelectionName.ValueString() restoreTestingSelection, err := findRestoreTestingSelectionByTwoPartKey(ctx, conn, restoreTestingPlanName, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/backup/restore_testing_selection_test.go b/internal/service/backup/restore_testing_selection_test.go index 150eec5d062..e25a3a7c93f 100644 --- a/internal/service/backup/restore_testing_selection_test.go +++ b/internal/service/backup/restore_testing_selection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -139,7 +139,7 @@ func testAccCheckRestoreTestingSelectionDestroy(ctx context.Context) resource.Te _, err := tfbackup.FindRestoreTestingSelectionByTwoPartKey(ctx, conn, rs.Primary.Attributes["restore_testing_plan_name"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/selection.go b/internal/service/backup/selection.go index d61f04a1176..2a3ab0a947e 100644 --- a/internal/service/backup/selection.go +++ b/internal/service/backup/selection.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -253,7 +254,7 @@ func resourceSelectionRead(ctx context.Context, d *schema.ResourceData, meta any planID := d.Get("plan_id").(string) output, err := findSelectionByTwoPartKey(ctx, conn, planID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Selection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/selection_test.go b/internal/service/backup/selection_test.go index 806cd54319e..c23443614a1 100644 --- a/internal/service/backup/selection_test.go +++ b/internal/service/backup/selection_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -236,7 +236,7 @@ func testAccCheckSelectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbackup.FindSelectionByTwoPartKey(ctx, conn, rs.Primary.Attributes["plan_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/vault.go b/internal/service/backup/vault.go index 64da38eada9..3107eb1a73e 100644 --- a/internal/service/backup/vault.go +++ b/internal/service/backup/vault.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -115,7 +116,7 @@ func resourceVaultRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findBackupVaultByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Vault (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -286,7 +287,7 @@ func statusRecoveryPoint(ctx context.Context, conn *backup.Client, backupVaultNa return func() (any, string, error) { output, err := findRecoveryPointByTwoPartKey(ctx, conn, backupVaultName, recoveryPointARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/backup/vault_lock_configuration.go b/internal/service/backup/vault_lock_configuration.go index ba8966899ca..de0ee8b819e 100644 --- a/internal/service/backup/vault_lock_configuration.go +++ b/internal/service/backup/vault_lock_configuration.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_backup_vault_lock_configuration", name="Vault Lock Configuration") @@ -100,7 +100,7 @@ func resourceVaultLockConfigurationRead(ctx context.Context, d *schema.ResourceD output, err := findBackupVaultByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Vault Lock Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/vault_lock_configuration_test.go b/internal/service/backup/vault_lock_configuration_test.go index 273404d71aa..231e1b0668c 100644 --- a/internal/service/backup/vault_lock_configuration_test.go +++ b/internal/service/backup/vault_lock_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +85,7 @@ func testAccCheckVaultLockConfigurationDestroy(ctx context.Context) resource.Tes _, err := tfbackup.FindBackupVaultByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/vault_notifications.go b/internal/service/backup/vault_notifications.go index 42873bf02df..61e0975df35 100644 --- a/internal/service/backup/vault_notifications.go +++ b/internal/service/backup/vault_notifications.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -95,7 +96,7 @@ func resourceVaultNotificationsRead(ctx context.Context, d *schema.ResourceData, output, err := findVaultNotificationsByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Vault Notifications (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/vault_notifications_test.go b/internal/service/backup/vault_notifications_test.go index df1afc3212b..1adcd3f9ff6 100644 --- a/internal/service/backup/vault_notifications_test.go +++ b/internal/service/backup/vault_notifications_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -81,7 +81,7 @@ func testAccCheckVaultNotificationsDestroy(ctx context.Context) resource.TestChe _, err := tfbackup.FindVaultNotificationsByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/vault_policy.go b/internal/service/backup/vault_policy.go index 652fbd90c20..da3739f52c0 100644 --- a/internal/service/backup/vault_policy.go +++ b/internal/service/backup/vault_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -88,7 +89,7 @@ func resourceVaultPolicyRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findVaultAccessPolicyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Backup Vault Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/backup/vault_policy_test.go b/internal/service/backup/vault_policy_test.go index bcf52ec9c35..a7f4603c5e0 100644 --- a/internal/service/backup/vault_policy_test.go +++ b/internal/service/backup/vault_policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func testAccCheckVaultPolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfbackup.FindVaultAccessPolicyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/backup/vault_test.go b/internal/service/backup/vault_test.go index 95781ae35d2..84fe1504c62 100644 --- a/internal/service/backup/vault_test.go +++ b/internal/service/backup/vault_test.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -189,7 +190,7 @@ func testAccCheckVaultDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbackup.FindBackupVaultByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -311,7 +312,7 @@ func statusJobState(ctx context.Context, conn *backup.Client, id string) sdkretr return func() (any, string, error) { output, err := findJobByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 5956861d7176eb61f2b04f2cd73c9eb9eda18000 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:15 -0800 Subject: [PATCH 023/227] `batch` --- internal/service/batch/compute_environment.go | 5 +++-- internal/service/batch/compute_environment_test.go | 4 ++-- internal/service/batch/job_definition.go | 3 ++- internal/service/batch/job_definition_test.go | 6 +++--- internal/service/batch/job_queue.go | 5 +++-- internal/service/batch/job_queue_test.go | 4 ++-- internal/service/batch/scheduling_policy.go | 3 ++- internal/service/batch/scheduling_policy_test.go | 4 ++-- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/internal/service/batch/compute_environment.go b/internal/service/batch/compute_environment.go index aaf0f995e50..9bdbce09f40 100644 --- a/internal/service/batch/compute_environment.go +++ b/internal/service/batch/compute_environment.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -356,7 +357,7 @@ func resourceComputeEnvironmentRead(ctx context.Context, d *schema.ResourceData, computeEnvironment, err := findComputeEnvironmentDetailByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Batch Compute Environment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -766,7 +767,7 @@ func statusComputeEnvironment(ctx context.Context, conn *batch.Client, name stri return func() (any, string, error) { output, err := findComputeEnvironmentDetailByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/batch/compute_environment_test.go b/internal/service/batch/compute_environment_test.go index cc426e6f1f8..e09648eaf3a 100644 --- a/internal/service/batch/compute_environment_test.go +++ b/internal/service/batch/compute_environment_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1982,7 +1982,7 @@ func testAccCheckComputeEnvironmentDestroy(ctx context.Context) resource.TestChe _, err := tfbatch.FindComputeEnvironmentDetailByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/batch/job_definition.go b/internal/service/batch/job_definition.go index a6d86aaaa26..5537c6ef566 100644 --- a/internal/service/batch/job_definition.go +++ b/internal/service/batch/job_definition.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -846,7 +847,7 @@ func resourceJobDefinitionRead(ctx context.Context, d *schema.ResourceData, meta jobDefinition, err := findJobDefinitionByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Batch Job Definition (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/batch/job_definition_test.go b/internal/service/batch/job_definition_test.go index b30d45c4787..fa6da586f39 100644 --- a/internal/service/batch/job_definition_test.go +++ b/internal/service/batch/job_definition_test.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1283,7 +1283,7 @@ func testAccCheckJobDefinitionPreviousDeregistered(ctx context.Context, n string _, err := tfbatch.FindJobDefinitionByARN(ctx, conn, previousARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } @@ -1351,7 +1351,7 @@ func testAccCheckJobDefinitionDestroy(ctx context.Context) resource.TestCheckFun _, err := tfbatch.FindJobDefinitionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/batch/job_queue.go b/internal/service/batch/job_queue.go index 6f00d6f98bb..1e835255637 100644 --- a/internal/service/batch/job_queue.go +++ b/internal/service/batch/job_queue.go @@ -38,6 +38,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/provider/framework/listresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -217,7 +218,7 @@ func (r *jobQueueResource) Read(ctx context.Context, request resource.ReadReques jobQueue, err := findJobQueueByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -412,7 +413,7 @@ func statusJobQueue(ctx context.Context, conn *batch.Client, id string) sdkretry return func() (any, string, error) { output, err := findJobQueueByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/batch/job_queue_test.go b/internal/service/batch/job_queue_test.go index b3d0ebaf2e4..b8b40d2076c 100644 --- a/internal/service/batch/job_queue_test.go +++ b/internal/service/batch/job_queue_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -409,7 +409,7 @@ func testAccCheckJobQueueDestroy(ctx context.Context) resource.TestCheckFunc { conn := acctest.Provider.Meta().(*conns.AWSClient).BatchClient(ctx) _, err := tfbatch.FindJobQueueByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/batch/scheduling_policy.go b/internal/service/batch/scheduling_policy.go index 67cb1e6dcd0..f2af9437584 100644 --- a/internal/service/batch/scheduling_policy.go +++ b/internal/service/batch/scheduling_policy.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -119,7 +120,7 @@ func resourceSchedulingPolicyRead(ctx context.Context, d *schema.ResourceData, m sp, err := findSchedulingPolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Batch Scheduling Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/batch/scheduling_policy_test.go b/internal/service/batch/scheduling_policy_test.go index 253053b0927..af1eea8ee6c 100644 --- a/internal/service/batch/scheduling_policy_test.go +++ b/internal/service/batch/scheduling_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func testAccCheckSchedulingPolicyDestroy(ctx context.Context) resource.TestCheck _, err := tfbatch.FindSchedulingPolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 17fc33f2aa47279be68da313ab02fedc474251ff Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:16 -0800 Subject: [PATCH 024/227] `bcmdataexports` --- internal/service/bcmdataexports/export.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/service/bcmdataexports/export.go b/internal/service/bcmdataexports/export.go index c545041ade6..dbe78072fa5 100644 --- a/internal/service/bcmdataexports/export.go +++ b/internal/service/bcmdataexports/export.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -290,7 +291,7 @@ func (r *exportResource) Read(ctx context.Context, req resource.ReadRequest, res } out, err := findExportByARN(ctx, conn, state.ARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -442,7 +443,7 @@ func waitExportUpdated(ctx context.Context, conn *bcmdataexports.Client, id stri func statusExport(ctx context.Context, conn *bcmdataexports.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findExportByARN(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From f53097aa0eabbe0629c3afedbd76560b3c727ace Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:17 -0800 Subject: [PATCH 025/227] `bedrock` --- internal/service/bedrock/custom_model.go | 7 ++++--- internal/service/bedrock/custom_model_test.go | 6 +++--- internal/service/bedrock/guardrail.go | 5 +++-- internal/service/bedrock/guardrail_version.go | 4 ++-- internal/service/bedrock/guardrail_version_test.go | 4 ++-- internal/service/bedrock/inference_profile.go | 5 +++-- .../bedrock/model_invocation_logging_configuration.go | 3 ++- .../bedrock/model_invocation_logging_configuration_test.go | 4 ++-- internal/service/bedrock/provisioned_model_throughput.go | 5 +++-- .../service/bedrock/provisioned_model_throughput_test.go | 4 ++-- 10 files changed, 26 insertions(+), 21 deletions(-) diff --git a/internal/service/bedrock/custom_model.go b/internal/service/bedrock/custom_model.go index 7da7d800673..ed0a9911179 100644 --- a/internal/service/bedrock/custom_model.go +++ b/internal/service/bedrock/custom_model.go @@ -37,6 +37,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -328,7 +329,7 @@ func (r *customModelResource) Read(ctx context.Context, request resource.ReadReq jobARN := data.JobARN.ValueString() outputGJ, err := findModelCustomizationJobByID(ctx, conn, jobARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -369,7 +370,7 @@ func (r *customModelResource) Read(ctx context.Context, request resource.ReadReq customModelARN := aws.ToString(outputGJ.OutputModelArn) outputGM, err := findCustomModelByID(ctx, conn, customModelARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -543,7 +544,7 @@ func statusModelCustomizationJob(ctx context.Context, conn *bedrock.Client, id s } output, err := findModelCustomizationJob(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrock/custom_model_test.go b/internal/service/bedrock/custom_model_test.go index 981a866909b..c0db84c5d30 100644 --- a/internal/service/bedrock/custom_model_test.go +++ b/internal/service/bedrock/custom_model_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrock "github.com/hashicorp/terraform-provider-aws/internal/service/bedrock" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -261,7 +261,7 @@ func testAccCheckCustomModelDestroy(ctx context.Context) resource.TestCheckFunc output, err := tfbedrock.FindModelCustomizationJobByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -273,7 +273,7 @@ func testAccCheckCustomModelDestroy(ctx context.Context) resource.TestCheckFunc if modelARN := aws.ToString(output.OutputModelArn); modelARN != "" { _, err := tfbedrock.FindCustomModelByID(ctx, conn, modelARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrock/guardrail.go b/internal/service/bedrock/guardrail.go index c9e16ae4e84..c897efffa51 100644 --- a/internal/service/bedrock/guardrail.go +++ b/internal/service/bedrock/guardrail.go @@ -35,6 +35,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -556,7 +557,7 @@ func (r *guardrailResource) Read(ctx context.Context, req resource.ReadRequest, out, err := findGuardrailByTwoPartKey(ctx, conn, state.GuardrailID.ValueString(), state.Version.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -762,7 +763,7 @@ func waitGuardrailDeleted(ctx context.Context, conn *bedrock.Client, id string, func statusGuardrail(ctx context.Context, conn *bedrock.Client, id, version string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findGuardrailByTwoPartKey(ctx, conn, id, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrock/guardrail_version.go b/internal/service/bedrock/guardrail_version.go index c177970d0c0..f19947bb9cf 100644 --- a/internal/service/bedrock/guardrail_version.go +++ b/internal/service/bedrock/guardrail_version.go @@ -26,7 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +128,7 @@ func (r *guardrailVersionResource) Read(ctx context.Context, request resource.Re output, err := findGuardrailByTwoPartKey(ctx, conn, data.GuardrailARN.ValueString(), data.Version.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/bedrock/guardrail_version_test.go b/internal/service/bedrock/guardrail_version_test.go index 4faeccf83e5..33cfcb81577 100644 --- a/internal/service/bedrock/guardrail_version_test.go +++ b/internal/service/bedrock/guardrail_version_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrock "github.com/hashicorp/terraform-provider-aws/internal/service/bedrock" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +133,7 @@ func testAccCheckGuardrailVersionDestroy(ctx context.Context) resource.TestCheck _, err := tfbedrock.FindGuardrailByTwoPartKey(ctx, conn, rs.Primary.Attributes["guardrail_arn"], rs.Primary.Attributes[names.AttrVersion]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrock/inference_profile.go b/internal/service/bedrock/inference_profile.go index b9ec1a3b186..2280c8fcbe4 100644 --- a/internal/service/bedrock/inference_profile.go +++ b/internal/service/bedrock/inference_profile.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -205,7 +206,7 @@ func (r *inferenceProfileResource) Read(ctx context.Context, req resource.ReadRe } out, err := findInferenceProfileByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -311,7 +312,7 @@ func waitInferenceProfileDeleted(ctx context.Context, conn *bedrock.Client, id s func statusInferenceProfile(ctx context.Context, conn *bedrock.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findInferenceProfileByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrock/model_invocation_logging_configuration.go b/internal/service/bedrock/model_invocation_logging_configuration.go index 5188485f997..7d2d95c074e 100644 --- a/internal/service/bedrock/model_invocation_logging_configuration.go +++ b/internal/service/bedrock/model_invocation_logging_configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -174,7 +175,7 @@ func (r *modelInvocationLoggingConfigurationResource) Read(ctx context.Context, output, err := findModelInvocationLoggingConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/bedrock/model_invocation_logging_configuration_test.go b/internal/service/bedrock/model_invocation_logging_configuration_test.go index bf07002341f..15d7ff8dfd9 100644 --- a/internal/service/bedrock/model_invocation_logging_configuration_test.go +++ b/internal/service/bedrock/model_invocation_logging_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrock "github.com/hashicorp/terraform-provider-aws/internal/service/bedrock" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -189,7 +189,7 @@ func testAccCheckModelInvocationLoggingConfigurationDestroy(ctx context.Context) _, err := tfbedrock.FindModelInvocationLoggingConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrock/provisioned_model_throughput.go b/internal/service/bedrock/provisioned_model_throughput.go index 2e1900cd544..f4276479321 100644 --- a/internal/service/bedrock/provisioned_model_throughput.go +++ b/internal/service/bedrock/provisioned_model_throughput.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -147,7 +148,7 @@ func (r *provisionedModelThroughputResource) Read(ctx context.Context, request r output, err := findProvisionedModelThroughputByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -222,7 +223,7 @@ func statusProvisionedModelThroughput(ctx context.Context, conn *bedrock.Client, return func() (any, string, error) { output, err := findProvisionedModelThroughputByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrock/provisioned_model_throughput_test.go b/internal/service/bedrock/provisioned_model_throughput_test.go index 37ad56eff2b..dee644e492a 100644 --- a/internal/service/bedrock/provisioned_model_throughput_test.go +++ b/internal/service/bedrock/provisioned_model_throughput_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrock "github.com/hashicorp/terraform-provider-aws/internal/service/bedrock" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -163,7 +163,7 @@ func testAccCheckProvisionedModelThroughputDestroy(ctx context.Context) resource _, err := tfbedrock.FindProvisionedModelThroughputByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From aeab769d5e17e403cf9fa2d80f45534d8f93eff3 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:18 -0800 Subject: [PATCH 026/227] `bedrockagent` --- internal/service/bedrockagent/agent.go | 5 +++-- internal/service/bedrockagent/agent_action_group.go | 3 ++- internal/service/bedrockagent/agent_action_group_test.go | 4 ++-- internal/service/bedrockagent/agent_alias.go | 5 +++-- internal/service/bedrockagent/agent_alias_test.go | 4 ++-- internal/service/bedrockagent/agent_collaborator.go | 3 ++- internal/service/bedrockagent/agent_collaborator_test.go | 4 ++-- .../service/bedrockagent/agent_knowledge_base_association.go | 3 ++- .../bedrockagent/agent_knowledge_base_association_test.go | 4 ++-- internal/service/bedrockagent/agent_test.go | 4 ++-- internal/service/bedrockagent/data_source.go | 5 +++-- internal/service/bedrockagent/data_source_test.go | 4 ++-- internal/service/bedrockagent/flow.go | 3 ++- internal/service/bedrockagent/flow_test.go | 4 ++-- internal/service/bedrockagent/knowledge_base.go | 5 +++-- internal/service/bedrockagent/knowledge_base_test.go | 4 ++-- internal/service/bedrockagent/prompt.go | 3 ++- internal/service/bedrockagent/prompt_test.go | 4 ++-- 18 files changed, 40 insertions(+), 31 deletions(-) diff --git a/internal/service/bedrockagent/agent.go b/internal/service/bedrockagent/agent.go index 16d29bd4397..ed1ce1dbe30 100644 --- a/internal/service/bedrockagent/agent.go +++ b/internal/service/bedrockagent/agent.go @@ -38,6 +38,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -246,7 +247,7 @@ func (r *agentResource) Read(ctx context.Context, request resource.ReadRequest, agentID := data.ID.ValueString() agent, err := findAgentByID(ctx, conn, agentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -568,7 +569,7 @@ func statusAgent(ctx context.Context, conn *bedrockagent.Client, id string) sdkr return func() (any, string, error) { output, err := findAgentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrockagent/agent_action_group.go b/internal/service/bedrockagent/agent_action_group.go index 8600d13d968..75f3add9294 100644 --- a/internal/service/bedrockagent/agent_action_group.go +++ b/internal/service/bedrockagent/agent_action_group.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -306,7 +307,7 @@ func (r *agentActionGroupResource) Read(ctx context.Context, request resource.Re output, err := findAgentActionGroupByThreePartKey(ctx, conn, data.ActionGroupID.ValueString(), data.AgentID.ValueString(), data.AgentVersion.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/bedrockagent/agent_action_group_test.go b/internal/service/bedrockagent/agent_action_group_test.go index 9133e0f0411..ad23c20d6e1 100644 --- a/internal/service/bedrockagent/agent_action_group_test.go +++ b/internal/service/bedrockagent/agent_action_group_test.go @@ -20,8 +20,8 @@ import ( tfplancheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/plancheck" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -325,7 +325,7 @@ func testAccCheckAgentActionGroupDestroy(ctx context.Context) resource.TestCheck _, err := tfbedrockagent.FindAgentActionGroupByThreePartKey(ctx, conn, rs.Primary.Attributes["action_group_id"], rs.Primary.Attributes["agent_id"], rs.Primary.Attributes["agent_version"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrockagent/agent_alias.go b/internal/service/bedrockagent/agent_alias.go index c417f1b11b6..62d6e90af8f 100644 --- a/internal/service/bedrockagent/agent_alias.go +++ b/internal/service/bedrockagent/agent_alias.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -191,7 +192,7 @@ func (r *agentAliasResource) Read(ctx context.Context, request resource.ReadRequ output, err := findAgentAliasByTwoPartKey(ctx, conn, data.AgentAliasID.ValueString(), data.AgentID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -332,7 +333,7 @@ func statusAgentAlias(ctx context.Context, conn *bedrockagent.Client, agentAlias return func() (any, string, error) { output, err := findAgentAliasByTwoPartKey(ctx, conn, agentAliasID, agentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrockagent/agent_alias_test.go b/internal/service/bedrockagent/agent_alias_test.go index 67c2ad0df4a..8641e8c0c26 100644 --- a/internal/service/bedrockagent/agent_alias_test.go +++ b/internal/service/bedrockagent/agent_alias_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -272,7 +272,7 @@ func testAccCheckAgentAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbedrockagent.FindAgentAliasByTwoPartKey(ctx, conn, rs.Primary.Attributes["agent_alias_id"], rs.Primary.Attributes["agent_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrockagent/agent_collaborator.go b/internal/service/bedrockagent/agent_collaborator.go index 497a96cf316..8fad6d2990e 100644 --- a/internal/service/bedrockagent/agent_collaborator.go +++ b/internal/service/bedrockagent/agent_collaborator.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +202,7 @@ func (r *agentCollaboratorResource) Read(ctx context.Context, request resource.R out, err := findAgentCollaboratorByThreePartKey(ctx, conn, data.AgentID.ValueString(), data.AgentVersion.ValueString(), data.CollaboratorID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/bedrockagent/agent_collaborator_test.go b/internal/service/bedrockagent/agent_collaborator_test.go index 89759ca5021..b2292e02f98 100644 --- a/internal/service/bedrockagent/agent_collaborator_test.go +++ b/internal/service/bedrockagent/agent_collaborator_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -211,7 +211,7 @@ func testAccCheckAgentCollaboratorDestroy(ctx context.Context) resource.TestChec _, err := tfbedrockagent.FindAgentCollaboratorByThreePartKey(ctx, conn, rs.Primary.Attributes["agent_id"], rs.Primary.Attributes["agent_version"], rs.Primary.Attributes["collaborator_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/bedrockagent/agent_knowledge_base_association.go b/internal/service/bedrockagent/agent_knowledge_base_association.go index f65a21b2df7..854c237a72a 100644 --- a/internal/service/bedrockagent/agent_knowledge_base_association.go +++ b/internal/service/bedrockagent/agent_knowledge_base_association.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -157,7 +158,7 @@ func (r *agentKnowledgeBaseAssociationResource) Read(ctx context.Context, reques output, err := findAgentKnowledgeBaseAssociationByThreePartKey(ctx, conn, data.AgentID.ValueString(), data.AgentVersion.ValueString(), data.KnowledgeBaseID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/bedrockagent/agent_knowledge_base_association_test.go b/internal/service/bedrockagent/agent_knowledge_base_association_test.go index 7aa1b457fa3..961913cbd84 100644 --- a/internal/service/bedrockagent/agent_knowledge_base_association_test.go +++ b/internal/service/bedrockagent/agent_knowledge_base_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -183,7 +183,7 @@ func testAccCheckAgentKnowledgeBaseAssociationDestroy(ctx context.Context) resou _, err := tfbedrockagent.FindAgentKnowledgeBaseAssociationByThreePartID(ctx, conn, rs.Primary.Attributes["agent_id"], rs.Primary.Attributes["agent_version"], rs.Primary.Attributes["knowledge_base_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrockagent/agent_test.go b/internal/service/bedrockagent/agent_test.go index 34f72b3a994..cb23846f7cc 100644 --- a/internal/service/bedrockagent/agent_test.go +++ b/internal/service/bedrockagent/agent_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -521,7 +521,7 @@ func testAccCheckAgentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbedrockagent.FindAgentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrockagent/data_source.go b/internal/service/bedrockagent/data_source.go index 4f4569bf1ae..e2c0fef6890 100644 --- a/internal/service/bedrockagent/data_source.go +++ b/internal/service/bedrockagent/data_source.go @@ -38,6 +38,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -858,7 +859,7 @@ func (r *dataSourceResource) Read(ctx context.Context, request resource.ReadRequ ds, err := findDataSourceByTwoPartKey(ctx, conn, data.DataSourceID.ValueString(), data.KnowledgeBaseID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -973,7 +974,7 @@ func statusDataSource(ctx context.Context, conn *bedrockagent.Client, dataSource return func() (any, string, error) { output, err := findDataSourceByTwoPartKey(ctx, conn, dataSourceID, knowledgeBaseID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrockagent/data_source_test.go b/internal/service/bedrockagent/data_source_test.go index 8c88b8d5108..e694c7e8905 100644 --- a/internal/service/bedrockagent/data_source_test.go +++ b/internal/service/bedrockagent/data_source_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -562,7 +562,7 @@ func testAccCheckDataSourceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbedrockagent.FindDataSourceByTwoPartKey(ctx, conn, rs.Primary.Attributes["data_source_id"], rs.Primary.Attributes["knowledge_base_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrockagent/flow.go b/internal/service/bedrockagent/flow.go index a54a9559990..81a0bbd6eaa 100644 --- a/internal/service/bedrockagent/flow.go +++ b/internal/service/bedrockagent/flow.go @@ -34,6 +34,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -1004,7 +1005,7 @@ func (r *flowResource) Read(ctx context.Context, request resource.ReadRequest, r output, err := findFlowByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/bedrockagent/flow_test.go b/internal/service/bedrockagent/flow_test.go index 54500184949..b1b3edc6a45 100644 --- a/internal/service/bedrockagent/flow_test.go +++ b/internal/service/bedrockagent/flow_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -420,7 +420,7 @@ func testAccCheckFlowDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfbedrockagent.FindFlowByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/bedrockagent/knowledge_base.go b/internal/service/bedrockagent/knowledge_base.go index aeadc04032a..313decd4803 100644 --- a/internal/service/bedrockagent/knowledge_base.go +++ b/internal/service/bedrockagent/knowledge_base.go @@ -33,6 +33,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -587,7 +588,7 @@ func (r *knowledgeBaseResource) Read(ctx context.Context, request resource.ReadR kb, err := findKnowledgeBaseByID(ctx, conn, data.KnowledgeBaseID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -752,7 +753,7 @@ func statusKnowledgeBase(ctx context.Context, conn *bedrockagent.Client, id stri return func() (any, string, error) { output, err := findKnowledgeBaseByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/bedrockagent/knowledge_base_test.go b/internal/service/bedrockagent/knowledge_base_test.go index b12b4f9ecae..f28a9785c48 100644 --- a/internal/service/bedrockagent/knowledge_base_test.go +++ b/internal/service/bedrockagent/knowledge_base_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -415,7 +415,7 @@ func testAccCheckKnowledgeBaseDestroy(ctx context.Context) resource.TestCheckFun _, err := tfbedrockagent.FindKnowledgeBaseByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/bedrockagent/prompt.go b/internal/service/bedrockagent/prompt.go index 7f1e8f653ad..5ce292e1ef5 100644 --- a/internal/service/bedrockagent/prompt.go +++ b/internal/service/bedrockagent/prompt.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -519,7 +520,7 @@ func (r *promptResource) Read(ctx context.Context, request resource.ReadRequest, output, err := findPromptByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/bedrockagent/prompt_test.go b/internal/service/bedrockagent/prompt_test.go index d175636e75b..75a2004be08 100644 --- a/internal/service/bedrockagent/prompt_test.go +++ b/internal/service/bedrockagent/prompt_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagent "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -333,7 +333,7 @@ func testAccCheckPromptDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfbedrockagent.FindPromptByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } From 8d2fc2e08cd6dd9664f581c914f0d0c8ee5efb76 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:19 -0800 Subject: [PATCH 027/227] `bedrockagentcore` --- .../service/bedrockagentcore/agent_runtime_endpoint_test.go | 4 ++-- internal/service/bedrockagentcore/memory_strategy_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/bedrockagentcore/agent_runtime_endpoint_test.go b/internal/service/bedrockagentcore/agent_runtime_endpoint_test.go index 3c9b1444cef..4765e2cd477 100644 --- a/internal/service/bedrockagentcore/agent_runtime_endpoint_test.go +++ b/internal/service/bedrockagentcore/agent_runtime_endpoint_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagentcore "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -258,7 +258,7 @@ func testAccCheckAgentRuntimeEndpointDestroy(ctx context.Context) resource.TestC } _, err := tfbedrockagentcore.FindAgentRuntimeEndpointByTwoPartKey(ctx, conn, rs.Primary.Attributes["agent_runtime_id"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/bedrockagentcore/memory_strategy_test.go b/internal/service/bedrockagentcore/memory_strategy_test.go index b528d07cf82..75e60ad5ad0 100644 --- a/internal/service/bedrockagentcore/memory_strategy_test.go +++ b/internal/service/bedrockagentcore/memory_strategy_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbedrockagentcore "github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -295,7 +295,7 @@ func testAccCheckMemoryStrategyDestroy(ctx context.Context) resource.TestCheckFu memoryStrategyId := rs.Primary.Attributes["memory_strategy_id"] _, err := tfbedrockagentcore.FindMemoryStrategyByID(ctx, conn, rs.Primary.Attributes["memory_id"], memoryStrategyId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { From 27cd121afcfffe841dfb847c6ba87b7bb616de1a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:20 -0800 Subject: [PATCH 028/227] `billing` --- internal/service/billing/view_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/billing/view_test.go b/internal/service/billing/view_test.go index ddb4f4fb25b..7e9b7e15e64 100644 --- a/internal/service/billing/view_test.go +++ b/internal/service/billing/view_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbilling "github.com/hashicorp/terraform-provider-aws/internal/service/billing" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -203,7 +203,7 @@ func testAccCheckViewDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfbilling.FindViewByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { From 1bd91f9dc1366d5fcfc057a4a543501b83ee6ec0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:21 -0800 Subject: [PATCH 029/227] `budgets` --- internal/service/budgets/budget.go | 6 +++--- internal/service/budgets/budget_action.go | 2 +- internal/service/budgets/budget_action_test.go | 4 ++-- internal/service/budgets/budget_test.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/budgets/budget.go b/internal/service/budgets/budget.go index b5e255e2f97..44b9ce515da 100644 --- a/internal/service/budgets/budget.go +++ b/internal/service/budgets/budget.go @@ -364,7 +364,7 @@ func resourceBudgetRead(ctx context.Context, d *schema.ResourceData, meta any) d return FindBudgetByTwoPartKey(ctx, conn, accountID, budgetName) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Budget (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -416,7 +416,7 @@ func resourceBudgetRead(ctx context.Context, d *schema.ResourceData, meta any) d notifications, err := findNotifications(ctx, conn, accountID, budgetName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -443,7 +443,7 @@ func resourceBudgetRead(ctx context.Context, d *schema.ResourceData, meta any) d subscribers, err := findSubscribers(ctx, conn, accountID, budgetName, notification) - if tfresource.NotFound(err) { + if retry.NotFound(err) { tfList = append(tfList, tfMap) continue } diff --git a/internal/service/budgets/budget_action.go b/internal/service/budgets/budget_action.go index 96335a6c1ac..1d8d7adebd7 100644 --- a/internal/service/budgets/budget_action.go +++ b/internal/service/budgets/budget_action.go @@ -282,7 +282,7 @@ func resourceBudgetActionRead(ctx context.Context, d *schema.ResourceData, meta return FindActionByThreePartKey(ctx, conn, accountID, actionID, budgetName) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Budget Action (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/budgets/budget_action_test.go b/internal/service/budgets/budget_action_test.go index 241176263a7..fb760f827da 100644 --- a/internal/service/budgets/budget_action_test.go +++ b/internal/service/budgets/budget_action_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbudgets "github.com/hashicorp/terraform-provider-aws/internal/service/budgets" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -276,7 +276,7 @@ func testAccCheckBudgetActionDestroy(ctx context.Context) resource.TestCheckFunc return tfbudgets.FindActionByThreePartKey(ctx, conn, accountID, actionID, budgetName) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/budgets/budget_test.go b/internal/service/budgets/budget_test.go index 01a6c01b6be..0b652d3f04a 100644 --- a/internal/service/budgets/budget_test.go +++ b/internal/service/budgets/budget_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfbudgets "github.com/hashicorp/terraform-provider-aws/internal/service/budgets" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -606,7 +606,7 @@ func testAccCheckBudgetDestroy(ctx context.Context) resource.TestCheckFunc { return tfbudgets.FindBudgetByTwoPartKey(ctx, conn, accountID, budgetName) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From e365d2aa809044dcd570d4d0cb059f9f7d26526e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:22 -0800 Subject: [PATCH 030/227] `ce` --- internal/service/ce/anomaly_monitor.go | 3 ++- internal/service/ce/anomaly_monitor_test.go | 4 ++-- internal/service/ce/anomaly_subscription.go | 3 ++- internal/service/ce/anomaly_subscription_test.go | 4 ++-- internal/service/ce/cost_allocation_tag.go | 3 ++- internal/service/ce/cost_category.go | 3 ++- internal/service/ce/cost_category_test.go | 4 ++-- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/service/ce/anomaly_monitor.go b/internal/service/ce/anomaly_monitor.go index 9d9509c9ebc..c8720b1ae31 100644 --- a/internal/service/ce/anomaly_monitor.go +++ b/internal/service/ce/anomaly_monitor.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -131,7 +132,7 @@ func resourceAnomalyMonitorRead(ctx context.Context, d *schema.ResourceData, met monitor, err := findAnomalyMonitorByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cost Explorer Anomaly Monitor (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ce/anomaly_monitor_test.go b/internal/service/ce/anomaly_monitor_test.go index 1f7ea05c970..42eaa93792d 100644 --- a/internal/service/ce/anomaly_monitor_test.go +++ b/internal/service/ce/anomaly_monitor_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfce "github.com/hashicorp/terraform-provider-aws/internal/service/ce" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -222,7 +222,7 @@ func testAccCheckAnomalyMonitorDestroy(ctx context.Context) resource.TestCheckFu _, err := tfce.FindAnomalyMonitorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ce/anomaly_subscription.go b/internal/service/ce/anomaly_subscription.go index eedfe59a619..bb572b92647 100644 --- a/internal/service/ce/anomaly_subscription.go +++ b/internal/service/ce/anomaly_subscription.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -146,7 +147,7 @@ func resourceAnomalySubscriptionRead(ctx context.Context, d *schema.ResourceData subscription, err := findAnomalySubscriptionByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cost Explorer Anomaly Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ce/anomaly_subscription_test.go b/internal/service/ce/anomaly_subscription_test.go index cf30fb8ba6e..b6c85a7bc2e 100644 --- a/internal/service/ce/anomaly_subscription_test.go +++ b/internal/service/ce/anomaly_subscription_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfce "github.com/hashicorp/terraform-provider-aws/internal/service/ce" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -306,7 +306,7 @@ func testAccCheckAnomalySubscriptionDestroy(ctx context.Context) resource.TestCh _, err := tfce.FindAnomalySubscriptionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ce/cost_allocation_tag.go b/internal/service/ce/cost_allocation_tag.go index 825a97f994a..532e0c6f5a1 100644 --- a/internal/service/ce/cost_allocation_tag.go +++ b/internal/service/ce/cost_allocation_tag.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -56,7 +57,7 @@ func resourceCostAllocationTagRead(ctx context.Context, d *schema.ResourceData, tag, err := findCostAllocationTagByTagKey(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cost Explorer Cost Allocation Tag (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ce/cost_category.go b/internal/service/ce/cost_category.go index a63c1cfdb1a..4a3c7bcbd1f 100644 --- a/internal/service/ce/cost_category.go +++ b/internal/service/ce/cost_category.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -336,7 +337,7 @@ func resourceCostCategoryRead(ctx context.Context, d *schema.ResourceData, meta costCategory, err := findCostCategoryByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cost Explorer Cost Category (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ce/cost_category_test.go b/internal/service/ce/cost_category_test.go index 909dfe354ba..c0be6d14861 100644 --- a/internal/service/ce/cost_category_test.go +++ b/internal/service/ce/cost_category_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfce "github.com/hashicorp/terraform-provider-aws/internal/service/ce" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -318,7 +318,7 @@ func testAccCheckCostCategoryDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfce.FindCostCategoryByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 480038e6ac59117ed94f0c7b79378a066f691489 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:23 -0800 Subject: [PATCH 031/227] `chatbot` --- internal/service/chatbot/slack_channel_configuration.go | 5 +++-- internal/service/chatbot/slack_channel_configuration_test.go | 4 ++-- internal/service/chatbot/teams_channel_configuration.go | 5 +++-- internal/service/chatbot/teams_channel_configuration_test.go | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/service/chatbot/slack_channel_configuration.go b/internal/service/chatbot/slack_channel_configuration.go index 790432ce68b..3beeb63106a 100644 --- a/internal/service/chatbot/slack_channel_configuration.go +++ b/internal/service/chatbot/slack_channel_configuration.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -184,7 +185,7 @@ func (r *slackChannelConfigurationResource) Read(ctx context.Context, request re output, err := findSlackChannelConfigurationByARN(ctx, conn, data.ChatConfigurationARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -352,7 +353,7 @@ func statusSlackChannelConfiguration(ctx context.Context, conn *chatbot.Client, return func() (any, string, error) { output, err := findSlackChannelConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/chatbot/slack_channel_configuration_test.go b/internal/service/chatbot/slack_channel_configuration_test.go index d461a18c1af..f1eb1270811 100644 --- a/internal/service/chatbot/slack_channel_configuration_test.go +++ b/internal/service/chatbot/slack_channel_configuration_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchatbot "github.com/hashicorp/terraform-provider-aws/internal/service/chatbot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -149,7 +149,7 @@ func testAccCheckSlackChannelConfigurationDestroy(ctx context.Context) resource. _, err := tfchatbot.FindSlackChannelConfigurationByARN(ctx, conn, rs.Primary.Attributes["chat_configuration_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/chatbot/teams_channel_configuration.go b/internal/service/chatbot/teams_channel_configuration.go index 4ee97872a70..2b6fa40dc42 100644 --- a/internal/service/chatbot/teams_channel_configuration.go +++ b/internal/service/chatbot/teams_channel_configuration.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -184,7 +185,7 @@ func (r *teamsChannelConfigurationResource) Read(ctx context.Context, request re output, err := findTeamsChannelConfigurationByTeamID(ctx, conn, data.TeamID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -353,7 +354,7 @@ func statusTeamsChannelConfiguration(ctx context.Context, conn *chatbot.Client, return func() (any, string, error) { output, err := findTeamsChannelConfigurationByTeamID(ctx, conn, teamID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/chatbot/teams_channel_configuration_test.go b/internal/service/chatbot/teams_channel_configuration_test.go index cd89d632139..a2ff82b60e8 100644 --- a/internal/service/chatbot/teams_channel_configuration_test.go +++ b/internal/service/chatbot/teams_channel_configuration_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchatbot "github.com/hashicorp/terraform-provider-aws/internal/service/chatbot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func testAccCheckTeamsChannelConfigurationDestroy(ctx context.Context) resource. _, err := tfchatbot.FindTeamsChannelConfigurationByTeamID(ctx, conn, rs.Primary.Attributes["team_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 62c19a6a5528c1f1d062beed9c32b04cdedeb4ef Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:24 -0800 Subject: [PATCH 032/227] `chime` --- internal/service/chime/find.go | 3 ++- internal/service/chime/voice_connector.go | 3 ++- internal/service/chime/voice_connector_logging.go | 3 ++- internal/service/chime/voice_connector_origination.go | 3 ++- internal/service/chime/voice_connector_origination_test.go | 4 ++-- internal/service/chime/voice_connector_termination.go | 3 ++- .../service/chime/voice_connector_termination_credentials.go | 3 ++- .../chime/voice_connector_termination_credentials_test.go | 4 ++-- internal/service/chime/voice_connector_termination_test.go | 4 ++-- internal/service/chime/voice_connector_test.go | 4 ++-- 10 files changed, 20 insertions(+), 14 deletions(-) diff --git a/internal/service/chime/find.go b/internal/service/chime/find.go index 6f11cc98ca4..e1a688803d8 100644 --- a/internal/service/chime/find.go +++ b/internal/service/chime/find.go @@ -7,6 +7,7 @@ import ( "context" "time" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -19,7 +20,7 @@ func FindVoiceConnectorResourceWithRetry[T any](ctx context.Context, isNewResour err := tfresource.Retry(ctx, voiceConnectorResourcePropagationTimeout, func(ctx context.Context) *tfresource.RetryError { var err error resp, err = f() - if isNewResource && tfresource.NotFound(err) { + if isNewResource && retry.NotFound(err) { return tfresource.RetryableError(err) } diff --git a/internal/service/chime/voice_connector.go b/internal/service/chime/voice_connector.go index 7c86a99082d..5c888c5a6ba 100644 --- a/internal/service/chime/voice_connector.go +++ b/internal/service/chime/voice_connector.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -111,7 +112,7 @@ func resourceVoiceConnectorRead(ctx context.Context, d *schema.ResourceData, met return findVoiceConnectorByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Chime Voice connector %s not found", d.Id()) d.SetId("") return diags diff --git a/internal/service/chime/voice_connector_logging.go b/internal/service/chime/voice_connector_logging.go index 2e160f2ab7d..d6133b83c82 100644 --- a/internal/service/chime/voice_connector_logging.go +++ b/internal/service/chime/voice_connector_logging.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -82,7 +83,7 @@ func resourceVoiceConnectorLoggingRead(ctx context.Context, d *schema.ResourceDa return findVoiceConnectorLoggingByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Chime Voice Connector logging configuration %s not found", d.Id()) d.SetId("") return diags diff --git a/internal/service/chime/voice_connector_origination.go b/internal/service/chime/voice_connector_origination.go index 9e6beb3a514..fb3f71a3efc 100644 --- a/internal/service/chime/voice_connector_origination.go +++ b/internal/service/chime/voice_connector_origination.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +121,7 @@ func resourceVoiceConnectorOriginationRead(ctx context.Context, d *schema.Resour return findVoiceConnectorOriginationByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Chime Voice Connector (%s) origination not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/chime/voice_connector_origination_test.go b/internal/service/chime/voice_connector_origination_test.go index 76b13f7972b..2a1530289b6 100644 --- a/internal/service/chime/voice_connector_origination_test.go +++ b/internal/service/chime/voice_connector_origination_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckVoiceConnectorOriginationDestroy(ctx context.Context) resource. return tfchime.FindVoiceConnectorOriginationByID(ctx, conn, rs.Primary.ID) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/chime/voice_connector_termination.go b/internal/service/chime/voice_connector_termination.go index 2754be9c348..8897cc6192c 100644 --- a/internal/service/chime/voice_connector_termination.go +++ b/internal/service/chime/voice_connector_termination.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -125,7 +126,7 @@ func resourceVoiceConnectorTerminationRead(ctx context.Context, d *schema.Resour return findVoiceConnectorTerminationByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Chime Voice Connector (%s) termination not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/chime/voice_connector_termination_credentials.go b/internal/service/chime/voice_connector_termination_credentials.go index 933fd75bda8..4f5e5d63699 100644 --- a/internal/service/chime/voice_connector_termination_credentials.go +++ b/internal/service/chime/voice_connector_termination_credentials.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +95,7 @@ func resourceVoiceConnectorTerminationCredentialsRead(ctx context.Context, d *sc return findVoiceConnectorTerminationCredentialsByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Chime Voice Connector (%s) termination credentials not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/chime/voice_connector_termination_credentials_test.go b/internal/service/chime/voice_connector_termination_credentials_test.go index d18a8caad58..44e73195b5f 100644 --- a/internal/service/chime/voice_connector_termination_credentials_test.go +++ b/internal/service/chime/voice_connector_termination_credentials_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckVoiceConnectorTerminationCredentialsDestroy(ctx context.Context return tfchime.FindVoiceConnectorTerminationCredentialsByID(ctx, conn, rs.Primary.ID) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/chime/voice_connector_termination_test.go b/internal/service/chime/voice_connector_termination_test.go index 11ab294d4d8..89897b69d9e 100644 --- a/internal/service/chime/voice_connector_termination_test.go +++ b/internal/service/chime/voice_connector_termination_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -193,7 +193,7 @@ func testAccCheckVoiceConnectorTerminationDestroy(ctx context.Context) resource. return tfchime.FindVoiceConnectorTerminationByID(ctx, conn, rs.Primary.ID) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/chime/voice_connector_test.go b/internal/service/chime/voice_connector_test.go index dd27e479932..e417bc2d1a5 100644 --- a/internal/service/chime/voice_connector_test.go +++ b/internal/service/chime/voice_connector_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -259,7 +259,7 @@ func testAccCheckVoiceConnectorDestroy(ctx context.Context) resource.TestCheckFu return tfchime.FindVoiceConnectorByID(ctx, conn, rs.Primary.ID) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 01cbff652e170ffbea100a54f673a1d0d05c91e3 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:25 -0800 Subject: [PATCH 033/227] `chimesdkmediapipelines` --- .../media_insights_pipeline_configuration.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go index d1bb9418e78..0359041e471 100644 --- a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go +++ b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -530,7 +531,7 @@ func resourceMediaInsightsPipelineConfigurationRead(ctx context.Context, d *sche out, err := findMediaInsightsPipelineConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ChimeSDKMediaPipelines MediaInsightsPipelineConfiguration (%s) not found, removing from state", d.Id()) d.SetId("") return diags From 4e09775d6deb8139edbbe9e173d656452ae66fc0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:26 -0800 Subject: [PATCH 034/227] `chimesdkvoice` --- internal/service/chimesdkvoice/find.go | 3 ++- internal/service/chimesdkvoice/sip_media_application.go | 3 ++- internal/service/chimesdkvoice/sip_media_application_test.go | 4 ++-- internal/service/chimesdkvoice/sip_rule.go | 3 ++- internal/service/chimesdkvoice/sip_rule_test.go | 4 ++-- internal/service/chimesdkvoice/voice_profile_domain.go | 3 ++- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/service/chimesdkvoice/find.go b/internal/service/chimesdkvoice/find.go index 35e85cc9773..2ce273c256d 100644 --- a/internal/service/chimesdkvoice/find.go +++ b/internal/service/chimesdkvoice/find.go @@ -7,6 +7,7 @@ import ( "context" "time" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -19,7 +20,7 @@ func FindSIPResourceWithRetry[T any](ctx context.Context, isNewResource bool, f err := tfresource.Retry(ctx, sipResourcePropagationTimeout, func(ctx context.Context) *tfresource.RetryError { var err error resp, err = f() - if isNewResource && tfresource.NotFound(err) { + if isNewResource && retry.NotFound(err) { return tfresource.RetryableError(err) } diff --git a/internal/service/chimesdkvoice/sip_media_application.go b/internal/service/chimesdkvoice/sip_media_application.go index d0aaeade834..03cb25efe71 100644 --- a/internal/service/chimesdkvoice/sip_media_application.go +++ b/internal/service/chimesdkvoice/sip_media_application.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -99,7 +100,7 @@ func resourceSipMediaApplicationRead(ctx context.Context, d *schema.ResourceData return findSIPMediaApplicationByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Chime Sip Media Application %s not found", d.Id()) d.SetId("") return diags diff --git a/internal/service/chimesdkvoice/sip_media_application_test.go b/internal/service/chimesdkvoice/sip_media_application_test.go index cdc7f8e146e..fdea8471df0 100644 --- a/internal/service/chimesdkvoice/sip_media_application_test.go +++ b/internal/service/chimesdkvoice/sip_media_application_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchimesdkvoice "github.com/hashicorp/terraform-provider-aws/internal/service/chimesdkvoice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -220,7 +220,7 @@ func testAccCheckSipMediaApplicationDestroy(ctx context.Context) resource.TestCh return tfchimesdkvoice.FindSIPMediaApplicationByID(ctx, conn, rs.Primary.ID) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/chimesdkvoice/sip_rule.go b/internal/service/chimesdkvoice/sip_rule.go index e833e1a267e..d3ab57b5507 100644 --- a/internal/service/chimesdkvoice/sip_rule.go +++ b/internal/service/chimesdkvoice/sip_rule.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -116,7 +117,7 @@ func resourceSipRuleRead(ctx context.Context, d *schema.ResourceData, meta any) return findSIPRuleByID(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ChimeSDKVoice Sip Rule %s not found", d.Id()) d.SetId("") return diags diff --git a/internal/service/chimesdkvoice/sip_rule_test.go b/internal/service/chimesdkvoice/sip_rule_test.go index 6350b0620c8..00242e92597 100644 --- a/internal/service/chimesdkvoice/sip_rule_test.go +++ b/internal/service/chimesdkvoice/sip_rule_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfchimesdkvoice "github.com/hashicorp/terraform-provider-aws/internal/service/chimesdkvoice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -168,7 +168,7 @@ func testAccCheckSipRuleDestroy(ctx context.Context) resource.TestCheckFunc { return tfchimesdkvoice.FindSIPRuleByID(ctx, conn, rs.Primary.ID) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/chimesdkvoice/voice_profile_domain.go b/internal/service/chimesdkvoice/voice_profile_domain.go index fb7b753f7f8..1ee695b6e63 100644 --- a/internal/service/chimesdkvoice/voice_profile_domain.go +++ b/internal/service/chimesdkvoice/voice_profile_domain.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -128,7 +129,7 @@ func resourceVoiceProfileDomainRead(ctx context.Context, d *schema.ResourceData, out, err := FindVoiceProfileDomainByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ChimeSDKVoice VoiceProfileDomain (%s) not found, removing from state", d.Id()) d.SetId("") return diags From 547a354ea73c22a6ba93b4496af17fb9f7455601 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:27 -0800 Subject: [PATCH 035/227] `cleanrooms` --- internal/service/cleanrooms/collaboration.go | 3 ++- internal/service/cleanrooms/configured_table.go | 3 ++- internal/service/cleanrooms/membership.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/service/cleanrooms/collaboration.go b/internal/service/cleanrooms/collaboration.go index aeeb769b664..dbd108c22de 100644 --- a/internal/service/cleanrooms/collaboration.go +++ b/internal/service/cleanrooms/collaboration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -214,7 +215,7 @@ func resourceCollaborationRead(ctx context.Context, d *schema.ResourceData, meta out, err := findCollaborationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CleanRooms Collaboration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cleanrooms/configured_table.go b/internal/service/cleanrooms/configured_table.go index 000491d2d17..f8660af4503 100644 --- a/internal/service/cleanrooms/configured_table.go +++ b/internal/service/cleanrooms/configured_table.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -150,7 +151,7 @@ func resourceConfiguredTableRead(ctx context.Context, d *schema.ResourceData, me out, err := findConfiguredTableByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Clean Rooms Configured Table (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cleanrooms/membership.go b/internal/service/cleanrooms/membership.go index e319f72d934..3d47468a240 100644 --- a/internal/service/cleanrooms/membership.go +++ b/internal/service/cleanrooms/membership.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -248,7 +249,7 @@ func (r *membershipResource) Read(ctx context.Context, request resource.ReadRequ output, err := findMembershipByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return From f04fcc46de6c4937525857d24319275689755194 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:28 -0800 Subject: [PATCH 036/227] `cloud9` --- internal/service/cloud9/environment_ec2.go | 5 +++-- internal/service/cloud9/environment_ec2_test.go | 4 ++-- internal/service/cloud9/environment_membership.go | 3 ++- internal/service/cloud9/environment_membership_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/cloud9/environment_ec2.go b/internal/service/cloud9/environment_ec2.go index 1defef0a0ae..20c69545a21 100644 --- a/internal/service/cloud9/environment_ec2.go +++ b/internal/service/cloud9/environment_ec2.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -165,7 +166,7 @@ func resourceEnvironmentEC2Read(ctx context.Context, d *schema.ResourceData, met env, err := findEnvironmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cloud9 EC2 Environment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -297,7 +298,7 @@ func statusEnvironmentStatus(ctx context.Context, conn *cloud9.Client, id string return func() (any, string, error) { output, err := findEnvironmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloud9/environment_ec2_test.go b/internal/service/cloud9/environment_ec2_test.go index b002e41f232..3ccf9bc5437 100644 --- a/internal/service/cloud9/environment_ec2_test.go +++ b/internal/service/cloud9/environment_ec2_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloud9 "github.com/hashicorp/terraform-provider-aws/internal/service/cloud9" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -208,7 +208,7 @@ func testAccCheckEnvironmentEC2Destroy(ctx context.Context) resource.TestCheckFu _, err := tfcloud9.FindEnvironmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloud9/environment_membership.go b/internal/service/cloud9/environment_membership.go index 47f79438bcb..9970747693f 100644 --- a/internal/service/cloud9/environment_membership.go +++ b/internal/service/cloud9/environment_membership.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -96,7 +97,7 @@ func resourceEnvironmentMembershipRead(ctx context.Context, d *schema.ResourceDa env, err := findEnvironmentMembershipByTwoPartKey(ctx, conn, envID, userARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cloud9 Environment Membership (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloud9/environment_membership_test.go b/internal/service/cloud9/environment_membership_test.go index eabadb70d6f..113222e7c72 100644 --- a/internal/service/cloud9/environment_membership_test.go +++ b/internal/service/cloud9/environment_membership_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloud9 "github.com/hashicorp/terraform-provider-aws/internal/service/cloud9" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckEnvironmentMemberDestroy(ctx context.Context) resource.TestChec _, err := tfcloud9.FindEnvironmentMembershipByTwoPartKey(ctx, conn, rs.Primary.Attributes["environment_id"], rs.Primary.Attributes["user_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 80623cc0cbc1cb1a689874a48a80483a829537d6 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:28 -0800 Subject: [PATCH 037/227] `cloudcontrol` --- internal/service/cloudcontrol/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/cloudcontrol/resource.go b/internal/service/cloudcontrol/resource.go index d5c1725b6c1..df0fb026975 100644 --- a/internal/service/cloudcontrol/resource.go +++ b/internal/service/cloudcontrol/resource.go @@ -386,7 +386,7 @@ func statusProgressEventOperation(conn *cloudcontrol.Client, requestToken string return func(ctx context.Context) (any, string, error) { output, err := findProgressEventByRequestToken(ctx, conn, requestToken) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From de0a65371a5105602c550384699556c616a6f43e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:30 -0800 Subject: [PATCH 038/227] `cloudformation` --- internal/service/cloudformation/change_set.go | 3 ++- internal/service/cloudformation/stack.go | 7 ++++--- internal/service/cloudformation/stack_instances.go | 7 ++++--- internal/service/cloudformation/stack_instances_test.go | 6 +++--- internal/service/cloudformation/stack_set.go | 7 ++++--- internal/service/cloudformation/stack_set_instance.go | 5 +++-- internal/service/cloudformation/stack_set_instance_test.go | 6 +++--- internal/service/cloudformation/stack_set_test.go | 4 ++-- internal/service/cloudformation/stack_test.go | 4 ++-- internal/service/cloudformation/type.go | 5 +++-- internal/service/cloudformation/type_test.go | 4 ++-- 11 files changed, 32 insertions(+), 26 deletions(-) diff --git a/internal/service/cloudformation/change_set.go b/internal/service/cloudformation/change_set.go index 8872b84f312..30bb75a3e9f 100644 --- a/internal/service/cloudformation/change_set.go +++ b/internal/service/cloudformation/change_set.go @@ -14,6 +14,7 @@ import ( sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -47,7 +48,7 @@ func statusChangeSet(ctx context.Context, conn *cloudformation.Client, stackID, return func() (any, string, error) { output, err := findChangeSetByTwoPartKey(ctx, conn, stackID, changeSetName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudformation/stack.go b/internal/service/cloudformation/stack.go index c6bfcc6c6f8..5168feb10d5 100644 --- a/internal/service/cloudformation/stack.go +++ b/internal/service/cloudformation/stack.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -217,7 +218,7 @@ func resourceStackRead(ctx context.Context, d *schema.ResourceData, meta any) di stack, err := findStackByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFormation Stack %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -433,7 +434,7 @@ func statusStack(ctx context.Context, conn *cloudformation.Client, name string) StackName: aws.String(name), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -560,7 +561,7 @@ func waitStackDeleted(ctx context.Context, conn *cloudformation.Client, name, re outputRaw, err := stateConf.WaitForStateContext(ctx) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): return nil, nil case err != nil: return nil, err diff --git a/internal/service/cloudformation/stack_instances.go b/internal/service/cloudformation/stack_instances.go index dd4064f279c..3e6738332ba 100644 --- a/internal/service/cloudformation/stack_instances.go +++ b/internal/service/cloudformation/stack_instances.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -343,7 +344,7 @@ func resourceStackInstancesRead(ctx context.Context, d *schema.ResourceData, met } stackInstances, err := findStackInstancesByNameCallAs(ctx, meta, stackSetName, callAs, deployedByOU == "OU", flex.ExpandStringValueSet(d.Get(AttrAccounts).(*schema.Set)), flex.ExpandStringValueSet(d.Get(AttrRegions).(*schema.Set))) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFormation Stack Instances (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -670,14 +671,14 @@ func findStackInstancesByNameCallAs(ctx context.Context, meta any, stackSetName, // set based on the first account and region which means they may not be accurate for all stack instances stackInstance, err := findStackInstanceByFourPartKey(ctx, conn, stackSetName, output.Accounts[0], output.Regions[0], callAs) - if none || tfresource.NotFound(err) { + if none || retry.NotFound(err) { return output, &sdkretry.NotFoundError{ LastError: err, LastRequest: input, } } - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return output, err } diff --git a/internal/service/cloudformation/stack_instances_test.go b/internal/service/cloudformation/stack_instances_test.go index f062397fed0..0dc585fe977 100644 --- a/internal/service/cloudformation/stack_instances_test.go +++ b/internal/service/cloudformation/stack_instances_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -654,7 +654,7 @@ func testAccCheckStackInstancesForOrganizationalUnitDestroy(ctx context.Context) output, err := tfcloudformation.FindStackInstancesByNameCallAs(ctx, acctest.Provider.Meta(), stackSetName, callAs, deployedByOU, accounts, regions) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } if output.StackSetID == "" { @@ -703,7 +703,7 @@ func testAccCheckStackInstancesDestroy(ctx context.Context) resource.TestCheckFu _, err = tfcloudformation.FindStackInstancesByNameCallAs(ctx, acctest.Provider.Meta(), stackSetName, callAs, deployedByOU, accounts, regions) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudformation/stack_set.go b/internal/service/cloudformation/stack_set.go index b7dc005f00d..acd56a298af 100644 --- a/internal/service/cloudformation/stack_set.go +++ b/internal/service/cloudformation/stack_set.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -311,7 +312,7 @@ func resourceStackSetRead(ctx context.Context, d *schema.ResourceData, meta any) callAs := d.Get("call_as").(string) stackSet, err := findStackSetByName(ctx, conn, d.Id(), callAs) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFormation StackSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -507,7 +508,7 @@ func statusStackSet(ctx context.Context, conn *cloudformation.Client, name, call return func() (any, string, error) { output, err := findStackSetByName(ctx, conn, name, callAs) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -599,7 +600,7 @@ func statusStackSetOperation(ctx context.Context, conn *cloudformation.Client, s return func() (any, string, error) { output, err := findStackSetOperationByThreePartKey(ctx, conn, stackSetName, operationID, callAs) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudformation/stack_set_instance.go b/internal/service/cloudformation/stack_set_instance.go index 4b920c94be1..9dbcf95167b 100644 --- a/internal/service/cloudformation/stack_set_instance.go +++ b/internal/service/cloudformation/stack_set_instance.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -333,7 +334,7 @@ func resourceStackSetInstanceRead(ctx context.Context, d *schema.ResourceData, m // Stack instances deployed by account ID stackInstance, err := findStackInstanceByFourPartKey(ctx, conn, stackSetName, accountOrOrgID, region, callAs) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFormation StackSet Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -357,7 +358,7 @@ func resourceStackSetInstanceRead(ctx context.Context, d *schema.ResourceData, m summaries, err := findStackInstanceSummariesByFourPartKey(ctx, conn, stackSetName, region, callAs, orgIDs) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFormation StackSet Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudformation/stack_set_instance_test.go b/internal/service/cloudformation/stack_set_instance_test.go index 7bcb7f58218..3326e378dd5 100644 --- a/internal/service/cloudformation/stack_set_instance_test.go +++ b/internal/service/cloudformation/stack_set_instance_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -575,7 +575,7 @@ func testAccCheckStackSetInstanceForOrganizationalUnitDestroy(ctx context.Contex callAs := rs.Primary.Attributes["call_as"] output, err := tfcloudformation.FindStackInstanceSummariesByFourPartKey(ctx, conn, stackSetName, region, callAs, orgIDs) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } if len(output) == 0 { @@ -611,7 +611,7 @@ func testAccCheckStackSetInstanceDestroy(ctx context.Context) resource.TestCheck callAs := rs.Primary.Attributes["call_as"] _, err = tfcloudformation.FindStackInstanceByFourPartKey(ctx, conn, stackSetName, accountOrOrgID, region, callAs) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudformation/stack_set_test.go b/internal/service/cloudformation/stack_set_test.go index 652bc4cb145..211c3d726cb 100644 --- a/internal/service/cloudformation/stack_set_test.go +++ b/internal/service/cloudformation/stack_set_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -922,7 +922,7 @@ func testAccCheckStackSetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudformation.FindStackSetByName(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["call_as"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudformation/stack_test.go b/internal/service/cloudformation/stack_test.go index 4ffd05bed99..25513bfd424 100644 --- a/internal/service/cloudformation/stack_test.go +++ b/internal/service/cloudformation/stack_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -609,7 +609,7 @@ func testAccCheckStackDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudformation.FindStackByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudformation/type.go b/internal/service/cloudformation/type.go index de3b509e6e8..8137269cf08 100644 --- a/internal/service/cloudformation/type.go +++ b/internal/service/cloudformation/type.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -204,7 +205,7 @@ func resourceTypeRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findTypeByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFormation Type (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -391,7 +392,7 @@ func statusTypeRegistrationProgress(ctx context.Context, conn *cloudformation.Cl return func() (any, string, error) { output, err := findTypeRegistrationByToken(ctx, conn, registrationToken) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudformation/type_test.go b/internal/service/cloudformation/type_test.go index 9005ff74c68..411ea8755c0 100644 --- a/internal/service/cloudformation/type_test.go +++ b/internal/service/cloudformation/type_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -204,7 +204,7 @@ func testAccCheckTypeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudformation.FindTypeByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From f00986c8c09063a0a5de2454e7ecc67bdccb287a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:31 -0800 Subject: [PATCH 039/227] `cloudfront` --- internal/service/cloudfront/cache_policy.go | 3 ++- .../service/cloudfront/cache_policy_test.go | 4 ++-- .../continuous_deployment_policy.go | 7 ++++--- .../continuous_deployment_policy_test.go | 4 ++-- internal/service/cloudfront/distribution.go | 17 ++++++++-------- .../service/cloudfront/distribution_test.go | 4 ++-- .../field_level_encryption_config.go | 3 ++- .../field_level_encryption_config_test.go | 4 ++-- .../field_level_encryption_profile.go | 3 ++- .../field_level_encryption_profile_test.go | 4 ++-- internal/service/cloudfront/function.go | 5 +++-- internal/service/cloudfront/function_test.go | 4 ++-- internal/service/cloudfront/key_group.go | 3 ++- internal/service/cloudfront/key_group_test.go | 4 ++-- .../service/cloudfront/key_value_store.go | 5 +++-- .../cloudfront/key_value_store_test.go | 4 ++-- .../cloudfront/monitoring_subscription.go | 3 ++- .../monitoring_subscription_test.go | 4 ++-- .../cloudfront/origin_access_control.go | 3 ++- .../cloudfront/origin_access_control_test.go | 4 ++-- .../cloudfront/origin_access_identity.go | 3 ++- .../cloudfront/origin_access_identity_test.go | 4 ++-- .../cloudfront/origin_request_policy.go | 3 ++- .../cloudfront/origin_request_policy_test.go | 4 ++-- internal/service/cloudfront/public_key.go | 3 ++- .../service/cloudfront/public_key_test.go | 4 ++-- .../service/cloudfront/realtime_log_config.go | 3 ++- .../cloudfront/realtime_log_config_test.go | 4 ++-- .../cloudfront/response_headers_policy.go | 3 ++- .../response_headers_policy_test.go | 4 ++-- internal/service/cloudfront/sweep.go | 20 +++++++++---------- internal/service/cloudfront/vpc_origin.go | 9 +++++---- .../service/cloudfront/vpc_origin_test.go | 4 ++-- 33 files changed, 88 insertions(+), 72 deletions(-) diff --git a/internal/service/cloudfront/cache_policy.go b/internal/service/cloudfront/cache_policy.go index cdd80b95d96..444ef331d98 100644 --- a/internal/service/cloudfront/cache_policy.go +++ b/internal/service/cloudfront/cache_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -211,7 +212,7 @@ func resourceCachePolicyRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findCachePolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Cache Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/cache_policy_test.go b/internal/service/cloudfront/cache_policy_test.go index 5d4dbb47834..e38b98d80d0 100644 --- a/internal/service/cloudfront/cache_policy_test.go +++ b/internal/service/cloudfront/cache_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -223,7 +223,7 @@ func testAccCheckCachePolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfcloudfront.FindCachePolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/continuous_deployment_policy.go b/internal/service/cloudfront/continuous_deployment_policy.go index aae90a97d16..84e0afc86c2 100644 --- a/internal/service/cloudfront/continuous_deployment_policy.go +++ b/internal/service/cloudfront/continuous_deployment_policy.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +187,7 @@ func (r *continuousDeploymentPolicyResource) Read(ctx context.Context, request r output, err := findContinuousDeploymentPolicyByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -266,7 +267,7 @@ func (r *continuousDeploymentPolicyResource) Delete(ctx context.Context, request id := data.ID.ValueString() etag, err := cdpETag(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -290,7 +291,7 @@ func (r *continuousDeploymentPolicyResource) Delete(ctx context.Context, request if errs.IsA[*awstypes.PreconditionFailed](err) || errs.IsA[*awstypes.InvalidIfMatchVersion](err) { etag, err = cdpETag(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } diff --git a/internal/service/cloudfront/continuous_deployment_policy_test.go b/internal/service/cloudfront/continuous_deployment_policy_test.go index e65ad5ddd1a..f5886df9815 100644 --- a/internal/service/cloudfront/continuous_deployment_policy_test.go +++ b/internal/service/cloudfront/continuous_deployment_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -293,7 +293,7 @@ func testAccCheckContinuousDeploymentPolicyDestroy(ctx context.Context) resource _, err := tfcloudfront.FindContinuousDeploymentPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/distribution.go b/internal/service/cloudfront/distribution.go index 760ed9891f5..59ce3abcbb0 100644 --- a/internal/service/cloudfront/distribution.go +++ b/internal/service/cloudfront/distribution.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -956,7 +957,7 @@ func resourceDistributionRead(ctx context.Context, d *schema.ResourceData, meta output, err := findDistributionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Distribution (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1109,18 +1110,18 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met err := disableContinuousDeploymentPolicy(ctx, conn, v) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendFromErr(diags, err) default: - if _, err := waitDistributionDeployed(ctx, conn, d.Id()); err != nil && !tfresource.NotFound(err) { + if _, err := waitDistributionDeployed(ctx, conn, d.Id()); err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "waiting for CloudFront Distribution (%s) deploy: %s", d.Id(), err) } } } if err := disableDistribution(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -1134,7 +1135,7 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met err := deleteDistribution(ctx, conn, d.Id()) - if err == nil || tfresource.NotFound(err) || errs.IsA[*awstypes.NoSuchDistribution](err) { + if err == nil || retry.NotFound(err) || errs.IsA[*awstypes.NoSuchDistribution](err) { return diags } @@ -1143,7 +1144,7 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met // configuration from the Terraform configuration, should other changes have occurred manually. if errs.IsA[*awstypes.DistributionNotDisabled](err) { if err := disableDistribution(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -1169,7 +1170,7 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met if errs.IsA[*awstypes.DistributionNotDisabled](err) { if err := disableDistribution(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -1299,7 +1300,7 @@ func statusDistribution(ctx context.Context, conn *cloudfront.Client, id string) return func() (any, string, error) { output, err := findDistributionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudfront/distribution_test.go b/internal/service/cloudfront/distribution_test.go index 719336f1cf4..38db6683729 100644 --- a/internal/service/cloudfront/distribution_test.go +++ b/internal/service/cloudfront/distribution_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1701,7 +1701,7 @@ func testAccCheckDistributionDestroy(ctx context.Context) resource.TestCheckFunc output, err := tfcloudfront.FindDistributionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/field_level_encryption_config.go b/internal/service/cloudfront/field_level_encryption_config.go index e5a0f5b1f19..6fe3d4af571 100644 --- a/internal/service/cloudfront/field_level_encryption_config.go +++ b/internal/service/cloudfront/field_level_encryption_config.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +178,7 @@ func resourceFieldLevelEncryptionConfigRead(ctx context.Context, d *schema.Resou output, err := findFieldLevelEncryptionConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Field-level Encryption Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/field_level_encryption_config_test.go b/internal/service/cloudfront/field_level_encryption_config_test.go index 35d28ae5951..0350ce3ef58 100644 --- a/internal/service/cloudfront/field_level_encryption_config_test.go +++ b/internal/service/cloudfront/field_level_encryption_config_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func testAccCheckFieldLevelEncryptionConfigDestroy(ctx context.Context) resource _, err := tfcloudfront.FindFieldLevelEncryptionConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/field_level_encryption_profile.go b/internal/service/cloudfront/field_level_encryption_profile.go index 35e7d569105..00610c9a9ca 100644 --- a/internal/service/cloudfront/field_level_encryption_profile.go +++ b/internal/service/cloudfront/field_level_encryption_profile.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +138,7 @@ func resourceFieldLevelEncryptionProfileRead(ctx context.Context, d *schema.Reso output, err := findFieldLevelEncryptionProfileByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Field-level Encryption Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/field_level_encryption_profile_test.go b/internal/service/cloudfront/field_level_encryption_profile_test.go index 91887785975..f7856cb950b 100644 --- a/internal/service/cloudfront/field_level_encryption_profile_test.go +++ b/internal/service/cloudfront/field_level_encryption_profile_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func testAccCheckFieldLevelEncryptionProfileDestroy(ctx context.Context) resourc _, err := tfcloudfront.FindFieldLevelEncryptionProfileByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/function.go b/internal/service/cloudfront/function.go index 0058cd68b75..eed3f522c8a 100644 --- a/internal/service/cloudfront/function.go +++ b/internal/service/cloudfront/function.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -135,7 +136,7 @@ func resourceFunctionRead(ctx context.Context, d *schema.ResourceData, meta any) outputDF, err := findFunctionByTwoPartKey(ctx, conn, d.Id(), awstypes.FunctionStageDevelopment) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Function (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -169,7 +170,7 @@ func resourceFunctionRead(ctx context.Context, d *schema.ResourceData, meta any) outputDF, err = findFunctionByTwoPartKey(ctx, conn, d.Id(), awstypes.FunctionStageLive) - if tfresource.NotFound(err) { + if retry.NotFound(err) { d.Set("live_stage_etag", "") } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading CloudFront Function (%s) LIVE stage: %s", d.Id(), err) diff --git a/internal/service/cloudfront/function_test.go b/internal/service/cloudfront/function_test.go index 6e5685f669e..64b022087a2 100644 --- a/internal/service/cloudfront/function_test.go +++ b/internal/service/cloudfront/function_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -346,7 +346,7 @@ func testAccCheckFunctionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudfront.FindFunctionByTwoPartKey(ctx, conn, rs.Primary.ID, awstypes.FunctionStageDevelopment) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/key_group.go b/internal/service/cloudfront/key_group.go index d2afffea1e0..0677e724e10 100644 --- a/internal/service/cloudfront/key_group.go +++ b/internal/service/cloudfront/key_group.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -90,7 +91,7 @@ func resourceKeyGroupRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findKeyGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Key Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/key_group_test.go b/internal/service/cloudfront/key_group_test.go index b21f6028d72..5e7e8227496 100644 --- a/internal/service/cloudfront/key_group_test.go +++ b/internal/service/cloudfront/key_group_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func testAccCheckKeyGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudfront.FindKeyGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/key_value_store.go b/internal/service/cloudfront/key_value_store.go index 3f84d0d54fa..1eefffb92e3 100644 --- a/internal/service/cloudfront/key_value_store.go +++ b/internal/service/cloudfront/key_value_store.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -142,7 +143,7 @@ func (r *keyValueStoreResource) Read(ctx context.Context, request resource.ReadR output, err := findKeyValueStoreByName(ctx, conn, data.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -274,7 +275,7 @@ func statusKeyValueStore(ctx context.Context, conn *cloudfront.Client, name stri return func() (any, string, error) { output, err := findKeyValueStoreByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudfront/key_value_store_test.go b/internal/service/cloudfront/key_value_store_test.go index 09ce475e606..bc418a412c9 100644 --- a/internal/service/cloudfront/key_value_store_test.go +++ b/internal/service/cloudfront/key_value_store_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func testAccCheckKeyValueStoreDestroy(ctx context.Context) resource.TestCheckFun _, err := tfcloudfront.FindKeyValueStoreByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/monitoring_subscription.go b/internal/service/cloudfront/monitoring_subscription.go index a0bf4114b5c..41275134ac8 100644 --- a/internal/service/cloudfront/monitoring_subscription.go +++ b/internal/service/cloudfront/monitoring_subscription.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -99,7 +100,7 @@ func resourceMonitoringSubscriptionRead(ctx context.Context, d *schema.ResourceD output, err := findMonitoringSubscriptionByDistributionID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Monitoring Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/monitoring_subscription_test.go b/internal/service/cloudfront/monitoring_subscription_test.go index 77be04fc0f2..8641dedda01 100644 --- a/internal/service/cloudfront/monitoring_subscription_test.go +++ b/internal/service/cloudfront/monitoring_subscription_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func testAccCheckMonitoringSubscriptionDestroy(ctx context.Context) resource.Tes _, err := tfcloudfront.FindMonitoringSubscriptionByDistributionID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/origin_access_control.go b/internal/service/cloudfront/origin_access_control.go index 38198640759..7c2db5bd17d 100644 --- a/internal/service/cloudfront/origin_access_control.go +++ b/internal/service/cloudfront/origin_access_control.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +106,7 @@ func resourceOriginAccessControlRead(ctx context.Context, d *schema.ResourceData output, err := findOriginAccessControlByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Origin Access Control (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/origin_access_control_test.go b/internal/service/cloudfront/origin_access_control_test.go index 6d016ab55bd..d335132d22e 100644 --- a/internal/service/cloudfront/origin_access_control_test.go +++ b/internal/service/cloudfront/origin_access_control_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -325,7 +325,7 @@ func testAccCheckOriginAccessControlDestroy(ctx context.Context) resource.TestCh _, err := tfcloudfront.FindOriginAccessControlByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/origin_access_identity.go b/internal/service/cloudfront/origin_access_identity.go index 0b9d8002bf0..74a09b37b69 100644 --- a/internal/service/cloudfront/origin_access_identity.go +++ b/internal/service/cloudfront/origin_access_identity.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +93,7 @@ func resourceOriginAccessIdentityRead(ctx context.Context, d *schema.ResourceDat output, err := findOriginAccessIdentityByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Origin Access Identity (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/origin_access_identity_test.go b/internal/service/cloudfront/origin_access_identity_test.go index 832c03a9ab0..26ab91889e5 100644 --- a/internal/service/cloudfront/origin_access_identity_test.go +++ b/internal/service/cloudfront/origin_access_identity_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -118,7 +118,7 @@ func testAccCheckOriginAccessIdentityDestroy(ctx context.Context) resource.TestC _, err := tfcloudfront.FindOriginAccessIdentityByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/origin_request_policy.go b/internal/service/cloudfront/origin_request_policy.go index 9b23e8172b1..88dcbed8ab4 100644 --- a/internal/service/cloudfront/origin_request_policy.go +++ b/internal/service/cloudfront/origin_request_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +185,7 @@ func resourceOriginRequestPolicyRead(ctx context.Context, d *schema.ResourceData output, err := findOriginRequestPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Origin Request Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/origin_request_policy_test.go b/internal/service/cloudfront/origin_request_policy_test.go index bbc150486ff..dd6724e9b28 100644 --- a/internal/service/cloudfront/origin_request_policy_test.go +++ b/internal/service/cloudfront/origin_request_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -156,7 +156,7 @@ func testAccCheckOriginRequestPolicyDestroy(ctx context.Context) resource.TestCh _, err := tfcloudfront.FindOriginRequestPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/public_key.go b/internal/service/cloudfront/public_key.go index 16182d959bc..42f8b616803 100644 --- a/internal/service/cloudfront/public_key.go +++ b/internal/service/cloudfront/public_key.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +118,7 @@ func resourcePublicKeyRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findPublicKeyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Public Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/public_key_test.go b/internal/service/cloudfront/public_key_test.go index b4c46ea3e08..ede74137c96 100644 --- a/internal/service/cloudfront/public_key_test.go +++ b/internal/service/cloudfront/public_key_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -187,7 +187,7 @@ func testAccCheckPublicKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudfront.FindPublicKeyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/realtime_log_config.go b/internal/service/cloudfront/realtime_log_config.go index b04b819b80f..a003219564c 100644 --- a/internal/service/cloudfront/realtime_log_config.go +++ b/internal/service/cloudfront/realtime_log_config.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -133,7 +134,7 @@ func resourceRealtimeLogConfigRead(ctx context.Context, d *schema.ResourceData, logConfig, err := findRealtimeLogConfigByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Real-time Log Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/realtime_log_config_test.go b/internal/service/cloudfront/realtime_log_config_test.go index 03e00875c19..a60790c28cd 100644 --- a/internal/service/cloudfront/realtime_log_config_test.go +++ b/internal/service/cloudfront/realtime_log_config_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +159,7 @@ func testAccCheckRealtimeLogConfigDestroy(ctx context.Context) resource.TestChec _, err := tfcloudfront.FindRealtimeLogConfigByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/response_headers_policy.go b/internal/service/cloudfront/response_headers_policy.go index 88946c05fbd..6e01ec281ea 100644 --- a/internal/service/cloudfront/response_headers_policy.go +++ b/internal/service/cloudfront/response_headers_policy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -385,7 +386,7 @@ func resourceResponseHeadersPolicyRead(ctx context.Context, d *schema.ResourceDa output, err := findResponseHeadersPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudFront Response Headers Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudfront/response_headers_policy_test.go b/internal/service/cloudfront/response_headers_policy_test.go index 07b1bd727a1..2c3a1d525f3 100644 --- a/internal/service/cloudfront/response_headers_policy_test.go +++ b/internal/service/cloudfront/response_headers_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -398,7 +398,7 @@ func testAccCheckResponseHeadersPolicyDestroy(ctx context.Context) resource.Test _, err := tfcloudfront.FindResponseHeadersPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/sweep.go b/internal/service/cloudfront/sweep.go index 8a64df68b5f..0e71dac56c0 100644 --- a/internal/service/cloudfront/sweep.go +++ b/internal/service/cloudfront/sweep.go @@ -12,10 +12,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudfront" awstypes "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" "github.com/hashicorp/terraform-provider-aws/internal/sweep/framework" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func sweepCachePolicies(region string) error { id := aws.ToString(v.CachePolicy.Id) output, err := findCachePolicyByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -217,7 +217,7 @@ func sweepDistributionsByProductionOrStaging(region string, staging bool) error id := aws.ToString(v.Id) output, err := findDistributionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -308,7 +308,7 @@ func sweepFunctions(region string) error { name := aws.ToString(v.Name) output, err := findFunctionByTwoPartKey(ctx, conn, name, awstypes.FunctionStageDevelopment) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -364,7 +364,7 @@ func sweepKeyGroup(region string) error { id := aws.ToString(v.KeyGroup.Id) output, err := findKeyGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -505,7 +505,7 @@ func sweepFieldLevelEncryptionConfigs(region string) error { id := aws.ToString(v.Id) output, err := findFieldLevelEncryptionConfigByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -561,7 +561,7 @@ func sweepFieldLevelEncryptionProfiles(region string) error { id := aws.ToString(v.Id) output, err := findFieldLevelEncryptionProfileByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -619,7 +619,7 @@ func sweepOriginRequestPolicies(region string) error { id := aws.ToString(v.OriginRequestPolicy.Id) output, err := findOriginRequestPolicyByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -677,7 +677,7 @@ func sweepResponseHeadersPolicies(region string) error { id := aws.ToString(v.ResponseHeadersPolicy.Id) output, err := findResponseHeadersPolicyByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -733,7 +733,7 @@ func sweepOriginAccessControls(region string) error { id := aws.ToString(v.Id) output, err := findOriginAccessControlByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudfront/vpc_origin.go b/internal/service/cloudfront/vpc_origin.go index 6539abba9d4..201830fa290 100644 --- a/internal/service/cloudfront/vpc_origin.go +++ b/internal/service/cloudfront/vpc_origin.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -170,7 +171,7 @@ func (r *vpcOriginResource) Read(ctx context.Context, request resource.ReadReque output, err := findVPCOriginByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -252,7 +253,7 @@ func (r *vpcOriginResource) Delete(ctx context.Context, request resource.DeleteR id := data.ID.ValueString() etag, err := vpcOriginETag(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -276,7 +277,7 @@ func (r *vpcOriginResource) Delete(ctx context.Context, request resource.DeleteR if errs.IsA[*awstypes.PreconditionFailed](err) || errs.IsA[*awstypes.InvalidIfMatchVersion](err) { etag, err = vpcOriginETag(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -351,7 +352,7 @@ func vpcOriginStatus(ctx context.Context, conn *cloudfront.Client, id string) sd return func() (any, string, error) { output, err := findVPCOriginByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudfront/vpc_origin_test.go b/internal/service/cloudfront/vpc_origin_test.go index e4112ae3a66..62aa49e533b 100644 --- a/internal/service/cloudfront/vpc_origin_test.go +++ b/internal/service/cloudfront/vpc_origin_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -218,7 +218,7 @@ func testAccCheckVPCOriginDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudfront.FindVPCOriginByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7dce937348265c6667324d567d6d6581ef9979d4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:33 -0800 Subject: [PATCH 040/227] `cloudfrontkeyvaluestore` --- internal/service/cloudfrontkeyvaluestore/key.go | 3 ++- internal/service/cloudfrontkeyvaluestore/key_test.go | 4 ++-- internal/service/cloudfrontkeyvaluestore/keys_exclusive.go | 3 ++- .../service/cloudfrontkeyvaluestore/keys_exclusive_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/cloudfrontkeyvaluestore/key.go b/internal/service/cloudfrontkeyvaluestore/key.go index 4ad2770286f..615bf3e0793 100644 --- a/internal/service/cloudfrontkeyvaluestore/key.go +++ b/internal/service/cloudfrontkeyvaluestore/key.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -138,7 +139,7 @@ func (r *keyResource) Read(ctx context.Context, request resource.ReadRequest, re output, err := findKeyByTwoPartKey(ctx, conn, data.KvsARN.ValueString(), data.Key.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/cloudfrontkeyvaluestore/key_test.go b/internal/service/cloudfrontkeyvaluestore/key_test.go index e7c523bee54..2c7b05b01b3 100644 --- a/internal/service/cloudfrontkeyvaluestore/key_test.go +++ b/internal/service/cloudfrontkeyvaluestore/key_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfrontkeyvaluestore "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func testAccCheckKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudfrontkeyvaluestore.FindKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes["key_value_store_arn"], rs.Primary.Attributes[names.AttrKey]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/cloudfrontkeyvaluestore/keys_exclusive.go b/internal/service/cloudfrontkeyvaluestore/keys_exclusive.go index 67592e89973..976e73b977e 100644 --- a/internal/service/cloudfrontkeyvaluestore/keys_exclusive.go +++ b/internal/service/cloudfrontkeyvaluestore/keys_exclusive.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -203,7 +204,7 @@ func (r *keysExclusiveResource) Read(ctx context.Context, request resource.ReadR conn := r.Meta().CloudFrontKeyValueStoreClient(ctx) kvs, keyPairs, err := FindResourceKeyValuePairsForKeyValueStore(ctx, conn, data.KvsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/cloudfrontkeyvaluestore/keys_exclusive_test.go b/internal/service/cloudfrontkeyvaluestore/keys_exclusive_test.go index 6a6b3dc14f4..a001e932e39 100644 --- a/internal/service/cloudfrontkeyvaluestore/keys_exclusive_test.go +++ b/internal/service/cloudfrontkeyvaluestore/keys_exclusive_test.go @@ -24,9 +24,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" tfcloudfrontkeyvaluestore "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -379,7 +379,7 @@ func testAccCheckKeysExclusiveDestroy(ctx context.Context) resource.TestCheckFun _, err := tfcloudfrontkeyvaluestore.FindKeyValueStoreByARN(ctx, conn, rs.Primary.Attributes["key_value_store_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } From 767b1ba28c60aeee645aa15affd11f1640550f09 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:34 -0800 Subject: [PATCH 041/227] `cloudhsmv2` --- internal/service/cloudhsmv2/cluster.go | 5 +++-- internal/service/cloudhsmv2/cluster_test.go | 4 ++-- internal/service/cloudhsmv2/hsm.go | 5 +++-- internal/service/cloudhsmv2/hsm_test.go | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/service/cloudhsmv2/cluster.go b/internal/service/cloudhsmv2/cluster.go index 6a41fd142ca..ace81a995a6 100644 --- a/internal/service/cloudhsmv2/cluster.go +++ b/internal/service/cloudhsmv2/cluster.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -165,7 +166,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) cluster, err := findClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudHSMv2 Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -286,7 +287,7 @@ func statusCluster(ctx context.Context, conn *cloudhsmv2.Client, id string) sdkr return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudhsmv2/cluster_test.go b/internal/service/cloudhsmv2/cluster_test.go index 0a54d818d09..6b762cb1df6 100644 --- a/internal/service/cloudhsmv2/cluster_test.go +++ b/internal/service/cloudhsmv2/cluster_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudhsmv2 "github.com/hashicorp/terraform-provider-aws/internal/service/cloudhsmv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudhsmv2.FindClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index b72eec901c6..5548427c14a 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +133,7 @@ func resourceHSMRead(ctx context.Context, d *schema.ResourceData, meta any) diag hsm, err := findHSMByTwoPartKey(ctx, conn, d.Id(), d.Get("hsm_eni_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudHSMv2 HSM (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -211,7 +212,7 @@ func statusHSM(ctx context.Context, conn *cloudhsmv2.Client, id string) sdkretry return func() (any, string, error) { output, err := findHSMByTwoPartKey(ctx, conn, id, "") - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudhsmv2/hsm_test.go b/internal/service/cloudhsmv2/hsm_test.go index 1e1bbe612ae..b43b501b21f 100644 --- a/internal/service/cloudhsmv2/hsm_test.go +++ b/internal/service/cloudhsmv2/hsm_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudhsmv2 "github.com/hashicorp/terraform-provider-aws/internal/service/cloudhsmv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckHSMDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["hsm_eni_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 85c3f1618f49ebb7fb444dec78825fec86fb3c9c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:35 -0800 Subject: [PATCH 042/227] `cloudsearch` --- internal/service/cloudsearch/domain.go | 4 ++-- internal/service/cloudsearch/domain_service_access_policy.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/cloudsearch/domain.go b/internal/service/cloudsearch/domain.go index 74d73761fdb..e5f4d6c942c 100644 --- a/internal/service/cloudsearch/domain.go +++ b/internal/service/cloudsearch/domain.go @@ -671,7 +671,7 @@ func statusDomainDeleting(conn *cloudsearch.Client, name string) retry.StateRefr return func(ctx context.Context) (any, string, error) { output, err := findDomainByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -687,7 +687,7 @@ func statusDomainProcessing(conn *cloudsearch.Client, name string) retry.StateRe return func(ctx context.Context) (any, string, error) { output, err := findDomainByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudsearch/domain_service_access_policy.go b/internal/service/cloudsearch/domain_service_access_policy.go index c5128e68b5a..212eaa55f65 100644 --- a/internal/service/cloudsearch/domain_service_access_policy.go +++ b/internal/service/cloudsearch/domain_service_access_policy.go @@ -193,7 +193,7 @@ func statusAccessPolicyState(conn *cloudsearch.Client, name string) retry.StateR return func(ctx context.Context) (any, string, error) { output, err := findAccessPoliciesStatusByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 4863949e5942dae5414c7a9d43e300a16272fdeb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:36 -0800 Subject: [PATCH 043/227] `cloudtrail` --- internal/service/cloudtrail/event_data_store.go | 5 +++-- internal/service/cloudtrail/event_data_store_test.go | 4 ++-- .../cloudtrail/organization_delegated_admin_account.go | 4 ++-- .../cloudtrail/organization_delegated_admin_account_test.go | 4 ++-- internal/service/cloudtrail/sweep.go | 4 ++-- internal/service/cloudtrail/trail.go | 3 ++- internal/service/cloudtrail/trail_test.go | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/internal/service/cloudtrail/event_data_store.go b/internal/service/cloudtrail/event_data_store.go index b027bc77433..8690d2e43cf 100644 --- a/internal/service/cloudtrail/event_data_store.go +++ b/internal/service/cloudtrail/event_data_store.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -240,7 +241,7 @@ func resourceEventDataStoreRead(ctx context.Context, d *schema.ResourceData, met output, err := findEventDataStoreByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudTrail Event Data Store (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -402,7 +403,7 @@ func statusEventDataStore(ctx context.Context, conn *cloudtrail.Client, arn stri return func() (any, string, error) { output, err := findEventDataStoreByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cloudtrail/event_data_store_test.go b/internal/service/cloudtrail/event_data_store_test.go index bd5e17acd50..fd452195d97 100644 --- a/internal/service/cloudtrail/event_data_store_test.go +++ b/internal/service/cloudtrail/event_data_store_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -439,7 +439,7 @@ func testAccCheckEventDataStoreDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcloudtrail.FindEventDataStoreByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudtrail/organization_delegated_admin_account.go b/internal/service/cloudtrail/organization_delegated_admin_account.go index cdf7be2beed..3463e060f9a 100644 --- a/internal/service/cloudtrail/organization_delegated_admin_account.go +++ b/internal/service/cloudtrail/organization_delegated_admin_account.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func (r *organizationDelegatedAdminAccountResource) Read(ctx context.Context, re delegatedAdministrator, err := tforganizations.FindDelegatedAdministratorByTwoPartKey(ctx, conn, data.ID.ValueString(), servicePrincipal) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/cloudtrail/organization_delegated_admin_account_test.go b/internal/service/cloudtrail/organization_delegated_admin_account_test.go index 506b0bf49fb..776a7c0abd7 100644 --- a/internal/service/cloudtrail/organization_delegated_admin_account_test.go +++ b/internal/service/cloudtrail/organization_delegated_admin_account_test.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +89,7 @@ func testAccCheckOrganizationDelegatedAdminAccountDestroy(ctx context.Context) r _, err := tforganizations.FindDelegatedAdministratorByTwoPartKey(ctx, conn, rs.Primary.ID, tfcloudtrail.ServicePrincipal) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudtrail/sweep.go b/internal/service/cloudtrail/sweep.go index cc62dfc0283..af4f5f8c81a 100644 --- a/internal/service/cloudtrail/sweep.go +++ b/internal/service/cloudtrail/sweep.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudtrail" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func RegisterSweepers() { @@ -60,7 +60,7 @@ func sweepTrails(region string) error { trail, err := findTrailByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudtrail/trail.go b/internal/service/cloudtrail/trail.go index 63cf3c0992f..f9950c845b4 100644 --- a/internal/service/cloudtrail/trail.go +++ b/internal/service/cloudtrail/trail.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -367,7 +368,7 @@ func resourceTrailRead(ctx context.Context, d *schema.ResourceData, meta any) di return findTrailByARN(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudTrail Trail (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cloudtrail/trail_test.go b/internal/service/cloudtrail/trail_test.go index 01d30ff137b..217adc5b9a1 100644 --- a/internal/service/cloudtrail/trail_test.go +++ b/internal/service/cloudtrail/trail_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -937,7 +937,7 @@ func testAccCheckTrailDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudtrail.FindTrailByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 57c814d1d712e363e900d869dd247c68c2cb32c2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:37 -0800 Subject: [PATCH 044/227] `cloudwatch` --- internal/service/cloudwatch/composite_alarm_test.go | 4 ++-- internal/service/cloudwatch/contributor_insight_rule_test.go | 4 ++-- .../cloudwatch/contributor_managed_insight_rule_test.go | 4 ++-- internal/service/cloudwatch/dashboard_test.go | 4 ++-- internal/service/cloudwatch/metric_alarm_test.go | 4 ++-- internal/service/cloudwatch/metric_stream_test.go | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/service/cloudwatch/composite_alarm_test.go b/internal/service/cloudwatch/composite_alarm_test.go index d4867c0c392..f0e33dc1738 100644 --- a/internal/service/cloudwatch/composite_alarm_test.go +++ b/internal/service/cloudwatch/composite_alarm_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -386,7 +386,7 @@ func testAccCheckCompositeAlarmDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcloudwatch.FindCompositeAlarmByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudwatch/contributor_insight_rule_test.go b/internal/service/cloudwatch/contributor_insight_rule_test.go index b6a16ea233b..ca46cdd38a8 100644 --- a/internal/service/cloudwatch/contributor_insight_rule_test.go +++ b/internal/service/cloudwatch/contributor_insight_rule_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func testAccCheckContributorInsightRuleDestroy(ctx context.Context) resource.Tes _, err := tfcloudwatch.FindContributorInsightRuleByName(ctx, conn, rs.Primary.Attributes["rule_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudwatch/contributor_managed_insight_rule_test.go b/internal/service/cloudwatch/contributor_managed_insight_rule_test.go index 6125a9ad984..558add975f3 100644 --- a/internal/service/cloudwatch/contributor_managed_insight_rule_test.go +++ b/internal/service/cloudwatch/contributor_managed_insight_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func testAccCheckContributorManagedInsightRuleDestroy(ctx context.Context) resou rs.Primary.Attributes["template_name"], ) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/cloudwatch/dashboard_test.go b/internal/service/cloudwatch/dashboard_test.go index d226179f9fb..b745acac097 100644 --- a/internal/service/cloudwatch/dashboard_test.go +++ b/internal/service/cloudwatch/dashboard_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckDashboardDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudwatch.FindDashboardByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudwatch/metric_alarm_test.go b/internal/service/cloudwatch/metric_alarm_test.go index 7c25a3351f5..d8d1fb760d0 100755 --- a/internal/service/cloudwatch/metric_alarm_test.go +++ b/internal/service/cloudwatch/metric_alarm_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -636,7 +636,7 @@ func testAccCheckMetricAlarmDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfcloudwatch.FindMetricAlarmByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cloudwatch/metric_stream_test.go b/internal/service/cloudwatch/metric_stream_test.go index 90214599fd0..b1a6cb67a75 100644 --- a/internal/service/cloudwatch/metric_stream_test.go +++ b/internal/service/cloudwatch/metric_stream_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -466,7 +466,7 @@ func testAccCheckMetricStreamDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfcloudwatch.FindMetricStreamByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From eee1d0b05be098957f7c3a7151b2d8f38822da8c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:38 -0800 Subject: [PATCH 045/227] `codeartifact` --- internal/service/codeartifact/domain.go | 3 ++- internal/service/codeartifact/domain_permissions_policy.go | 3 ++- .../service/codeartifact/domain_permissions_policy_test.go | 4 ++-- internal/service/codeartifact/domain_test.go | 4 ++-- internal/service/codeartifact/repository.go | 3 ++- .../service/codeartifact/repository_permissions_policy.go | 3 ++- .../codeartifact/repository_permissions_policy_test.go | 4 ++-- internal/service/codeartifact/repository_test.go | 4 ++-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/service/codeartifact/domain.go b/internal/service/codeartifact/domain.go index b1134dd509a..9ccb4d6762e 100644 --- a/internal/service/codeartifact/domain.go +++ b/internal/service/codeartifact/domain.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -120,7 +121,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta any) d domain, err := findDomainByTwoPartKey(ctx, conn, owner, domainName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeArtifact Domain (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codeartifact/domain_permissions_policy.go b/internal/service/codeartifact/domain_permissions_policy.go index 4c6cf9ff365..82e9db78737 100644 --- a/internal/service/codeartifact/domain_permissions_policy.go +++ b/internal/service/codeartifact/domain_permissions_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -106,7 +107,7 @@ func resourceDomainPermissionsPolicyRead(ctx context.Context, d *schema.Resource policy, err := findDomainPermissionsPolicyByTwoPartKey(ctx, conn, owner, domainName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeArtifact Domain Permissions Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codeartifact/domain_permissions_policy_test.go b/internal/service/codeartifact/domain_permissions_policy_test.go index 9ecb7c2bf8c..260ddadff71 100644 --- a/internal/service/codeartifact/domain_permissions_policy_test.go +++ b/internal/service/codeartifact/domain_permissions_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -205,7 +205,7 @@ func testAccCheckDomainPermissionsPolicyDestroy(ctx context.Context) resource.Te _, err := tfcodeartifact.FindDomainPermissionsPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["domain_owner"], rs.Primary.Attributes[names.AttrDomain]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codeartifact/domain_test.go b/internal/service/codeartifact/domain_test.go index 2f45226bfef..13edd17670e 100644 --- a/internal/service/codeartifact/domain_test.go +++ b/internal/service/codeartifact/domain_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -236,7 +236,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodeartifact.FindDomainByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrOwner], rs.Primary.Attributes[names.AttrDomain]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codeartifact/repository.go b/internal/service/codeartifact/repository.go index e7267a5328b..33d2789b438 100644 --- a/internal/service/codeartifact/repository.go +++ b/internal/service/codeartifact/repository.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -170,7 +171,7 @@ func resourceRepositoryRead(ctx context.Context, d *schema.ResourceData, meta an repository, err := findRepositoryByThreePartKey(ctx, conn, owner, domainName, repositoryName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeArtifact Repository (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codeartifact/repository_permissions_policy.go b/internal/service/codeartifact/repository_permissions_policy.go index fe0901c0782..68ab987fda0 100644 --- a/internal/service/codeartifact/repository_permissions_policy.go +++ b/internal/service/codeartifact/repository_permissions_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -112,7 +113,7 @@ func resourceRepositoryPermissionsPolicyRead(ctx context.Context, d *schema.Reso policy, err := findRepositoryPermissionsPolicyByThreePartKey(ctx, conn, owner, domainName, repositoryName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeArtifact Repository Permissions Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codeartifact/repository_permissions_policy_test.go b/internal/service/codeartifact/repository_permissions_policy_test.go index 69fd4555d8b..5e2dc325caa 100644 --- a/internal/service/codeartifact/repository_permissions_policy_test.go +++ b/internal/service/codeartifact/repository_permissions_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -204,7 +204,7 @@ func testAccCheckRepositoryPermissionsPolicyDestroy(ctx context.Context) resourc _, err := tfcodeartifact.FindRepositoryPermissionsPolicyByThreePartKey(ctx, conn, rs.Primary.Attributes["domain_owner"], rs.Primary.Attributes[names.AttrDomain], rs.Primary.Attributes["repository"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codeartifact/repository_test.go b/internal/service/codeartifact/repository_test.go index 46c21c4e1c1..f7853f42229 100644 --- a/internal/service/codeartifact/repository_test.go +++ b/internal/service/codeartifact/repository_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -307,7 +307,7 @@ func testAccCheckRepositoryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodeartifact.FindRepositoryByThreePartKey(ctx, conn, rs.Primary.Attributes["domain_owner"], rs.Primary.Attributes[names.AttrDomain], rs.Primary.Attributes["repository"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From adc3372ae402c83a27c2a6dde8ecfddd56c10478 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:39 -0800 Subject: [PATCH 046/227] `codebuild` --- internal/service/codebuild/fleet.go | 5 +++-- internal/service/codebuild/fleet_test.go | 4 ++-- internal/service/codebuild/project.go | 3 ++- internal/service/codebuild/project_test.go | 6 +++--- internal/service/codebuild/report_group.go | 5 +++-- internal/service/codebuild/report_group_test.go | 4 ++-- internal/service/codebuild/resource_policy.go | 3 ++- internal/service/codebuild/resource_policy_test.go | 4 ++-- internal/service/codebuild/source_credential.go | 3 ++- internal/service/codebuild/source_credential_test.go | 4 ++-- internal/service/codebuild/webhook.go | 3 ++- internal/service/codebuild/webhook_test.go | 4 ++-- 12 files changed, 27 insertions(+), 21 deletions(-) diff --git a/internal/service/codebuild/fleet.go b/internal/service/codebuild/fleet.go index faea198e92c..5795fdaa49c 100644 --- a/internal/service/codebuild/fleet.go +++ b/internal/service/codebuild/fleet.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -295,7 +296,7 @@ func resourceFleetRead(ctx context.Context, d *schema.ResourceData, meta any) di fleet, err := findFleetByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeBuild Fleet (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -501,7 +502,7 @@ func statusFleet(ctx context.Context, conn *codebuild.Client, arn string) sdkret return func() (any, string, error) { output, err := findFleetByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codebuild/fleet_test.go b/internal/service/codebuild/fleet_test.go index eae70871133..f35717cb892 100644 --- a/internal/service/codebuild/fleet_test.go +++ b/internal/service/codebuild/fleet_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -417,7 +417,7 @@ func testAccCheckFleetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodebuild.FindFleetByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codebuild/project.go b/internal/service/codebuild/project.go index 350491fe94b..7e1e5d639e3 100644 --- a/internal/service/codebuild/project.go +++ b/internal/service/codebuild/project.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -930,7 +931,7 @@ func resourceProjectRead(ctx context.Context, d *schema.ResourceData, meta any) project, err := findProjectByNameOrARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeBuild Project (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codebuild/project_test.go b/internal/service/codebuild/project_test.go index c82458eac16..75a91e0ca08 100644 --- a/internal/service/codebuild/project_test.go +++ b/internal/service/codebuild/project_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -3073,7 +3073,7 @@ func testAccCheckProjectDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodebuild.FindProjectByNameOrARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -3106,7 +3106,7 @@ func testAccPreCheck(ctx context.Context, t *testing.T) { t.Skipf("skipping acceptance testing: %s", err) } - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { t.Fatalf("unexpected PreCheck error: %s", err) } } diff --git a/internal/service/codebuild/report_group.go b/internal/service/codebuild/report_group.go index 5c7200e43c5..30117015a51 100644 --- a/internal/service/codebuild/report_group.go +++ b/internal/service/codebuild/report_group.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -145,7 +146,7 @@ func resourceReportGroupRead(ctx context.Context, d *schema.ResourceData, meta a reportGroup, err := findReportGroupByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeBuild Report Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -251,7 +252,7 @@ func statusReportGroup(ctx context.Context, conn *codebuild.Client, arn string) return func() (any, string, error) { output, err := findReportGroupByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codebuild/report_group_test.go b/internal/service/codebuild/report_group_test.go index 448ca86fa5c..b3d0527776e 100644 --- a/internal/service/codebuild/report_group_test.go +++ b/internal/service/codebuild/report_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -231,7 +231,7 @@ func testAccCheckReportGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfcodebuild.FindReportGroupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codebuild/resource_policy.go b/internal/service/codebuild/resource_policy.go index 3fa289f9d64..1a58dac2e81 100644 --- a/internal/service/codebuild/resource_policy.go +++ b/internal/service/codebuild/resource_policy.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -78,7 +79,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met output, err := findResourcePolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeBuild Resource Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codebuild/resource_policy_test.go b/internal/service/codebuild/resource_policy_test.go index 692ce233655..9927833690c 100644 --- a/internal/service/codebuild/resource_policy_test.go +++ b/internal/service/codebuild/resource_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +107,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcodebuild.FindResourcePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codebuild/source_credential.go b/internal/service/codebuild/source_credential.go index 7e92b0b97f3..dd04ca8a361 100644 --- a/internal/service/codebuild/source_credential.go +++ b/internal/service/codebuild/source_credential.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -96,7 +97,7 @@ func resourceSourceCredentialRead(ctx context.Context, d *schema.ResourceData, m credentials, err := findSourceCredentialsByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeBuild Source Credential (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codebuild/source_credential_test.go b/internal/service/codebuild/source_credential_test.go index be00996b17c..a37acd083d2 100644 --- a/internal/service/codebuild/source_credential_test.go +++ b/internal/service/codebuild/source_credential_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +159,7 @@ func testAccCheckSourceCredentialDestroy(ctx context.Context) resource.TestCheck _, err := tfcodebuild.FindSourceCredentialsByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codebuild/webhook.go b/internal/service/codebuild/webhook.go index ef04463f6b9..ae719d7438d 100644 --- a/internal/service/codebuild/webhook.go +++ b/internal/service/codebuild/webhook.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +200,7 @@ func resourceWebhookRead(ctx context.Context, d *schema.ResourceData, meta any) webhook, err := findWebhookByProjectName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeBuild Webhook (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codebuild/webhook_test.go b/internal/service/codebuild/webhook_test.go index f4d0aef640d..4bbc11c1ee6 100644 --- a/internal/service/codebuild/webhook_test.go +++ b/internal/service/codebuild/webhook_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -617,7 +617,7 @@ func testAccCheckWebhookDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodebuild.FindWebhookByProjectName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From afdceda9f958063f0d15e57da01cc7c67907f02a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:40 -0800 Subject: [PATCH 047/227] `codecatalyst` --- internal/service/codecatalyst/dev_environment.go | 5 +++-- internal/service/codecatalyst/project.go | 3 ++- internal/service/codecatalyst/source_repository.go | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/service/codecatalyst/dev_environment.go b/internal/service/codecatalyst/dev_environment.go index 5cac9f9df50..2a5369745af 100644 --- a/internal/service/codecatalyst/dev_environment.go +++ b/internal/service/codecatalyst/dev_environment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -178,7 +179,7 @@ func resourceDevEnvironmentRead(ctx context.Context, d *schema.ResourceData, met out, err := findDevEnvironmentByID(ctx, conn, d.Id(), spaceName, projectName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Codecatalyst DevEnvironment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -306,7 +307,7 @@ func waitDevEnvironmentUpdated(ctx context.Context, conn *codecatalyst.Client, i func statusDevEnvironment(ctx context.Context, conn *codecatalyst.Client, id string, spaceName *string, projectName *string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findDevEnvironmentByID(ctx, conn, id, spaceName, projectName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codecatalyst/project.go b/internal/service/codecatalyst/project.go index 6b5b6217a02..982dbc12fef 100644 --- a/internal/service/codecatalyst/project.go +++ b/internal/service/codecatalyst/project.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +101,7 @@ func resourceProjectRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := findProjectByName(ctx, conn, d.Id(), spaceName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeCatalyst Project (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codecatalyst/source_repository.go b/internal/service/codecatalyst/source_repository.go index 453d027a9ad..605378718f0 100644 --- a/internal/service/codecatalyst/source_repository.go +++ b/internal/service/codecatalyst/source_repository.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +101,7 @@ func resourceSourceRepositoryRead(ctx context.Context, d *schema.ResourceData, m out, err := findSourceRepositoryByName(ctx, conn, d.Id(), projectName, spaceName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeCatalyst SourceRepository (%s) not found, removing from state", d.Id()) d.SetId("") return diags From f4770fbb60c1830a837b73e2db0c5d110196852b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:41 -0800 Subject: [PATCH 048/227] `codecommit` --- internal/service/codecommit/approval_rule_template.go | 3 ++- .../service/codecommit/approval_rule_template_association.go | 3 ++- .../codecommit/approval_rule_template_association_test.go | 4 ++-- internal/service/codecommit/approval_rule_template_test.go | 4 ++-- internal/service/codecommit/repository.go | 3 ++- internal/service/codecommit/repository_test.go | 4 ++-- internal/service/codecommit/trigger.go | 3 ++- internal/service/codecommit/trigger_test.go | 4 ++-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/service/codecommit/approval_rule_template.go b/internal/service/codecommit/approval_rule_template.go index 06fd2beb6e0..263dfcb8dea 100644 --- a/internal/service/codecommit/approval_rule_template.go +++ b/internal/service/codecommit/approval_rule_template.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -115,7 +116,7 @@ func resourceApprovalRuleTemplateRead(ctx context.Context, d *schema.ResourceDat result, err := findApprovalRuleTemplateByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeCommit Approval Rule Template %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codecommit/approval_rule_template_association.go b/internal/service/codecommit/approval_rule_template_association.go index cce7685d9e3..96807ccacb2 100644 --- a/internal/service/codecommit/approval_rule_template_association.go +++ b/internal/service/codecommit/approval_rule_template_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourceApprovalRuleTemplateAssociationRead(ctx context.Context, d *schema. _, err = findApprovalRuleTemplateAssociationByTwoPartKey(ctx, conn, approvalRuleTemplateName, repositoryName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeCommit Approval Rule Template Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codecommit/approval_rule_template_association_test.go b/internal/service/codecommit/approval_rule_template_association_test.go index 9b425cf936f..4b36e844e54 100644 --- a/internal/service/codecommit/approval_rule_template_association_test.go +++ b/internal/service/codecommit/approval_rule_template_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodecommit "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckApprovalRuleTemplateAssociationDestroy(ctx context.Context) res _, err := tfcodecommit.FindApprovalRuleTemplateAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["approval_rule_template_name"], rs.Primary.Attributes[names.AttrRepositoryName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codecommit/approval_rule_template_test.go b/internal/service/codecommit/approval_rule_template_test.go index f5390d4c7b9..ca9ef7a728f 100644 --- a/internal/service/codecommit/approval_rule_template_test.go +++ b/internal/service/codecommit/approval_rule_template_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodecommit "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func testAccCheckApprovalRuleTemplateDestroy(ctx context.Context) resource.TestC _, err := tfcodecommit.FindApprovalRuleTemplateByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codecommit/repository.go b/internal/service/codecommit/repository.go index e969b8f0cc1..312dea12e4d 100644 --- a/internal/service/codecommit/repository.go +++ b/internal/service/codecommit/repository.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -121,7 +122,7 @@ func resourceRepositoryRead(ctx context.Context, d *schema.ResourceData, meta an repository, err := findRepositoryByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeCommit Repository %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codecommit/repository_test.go b/internal/service/codecommit/repository_test.go index ac8bca83d67..e3cbd4f7d9b 100644 --- a/internal/service/codecommit/repository_test.go +++ b/internal/service/codecommit/repository_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodecommit "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -329,7 +329,7 @@ func testAccCheckRepositoryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodecommit.FindRepositoryByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codecommit/trigger.go b/internal/service/codecommit/trigger.go index 2c3d3cf1b3b..303f3e56673 100644 --- a/internal/service/codecommit/trigger.go +++ b/internal/service/codecommit/trigger.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceTriggerRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findRepositoryTriggersByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeCommit Trigger %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codecommit/trigger_test.go b/internal/service/codecommit/trigger_test.go index 0d3db331669..49df609b898 100644 --- a/internal/service/codecommit/trigger_test.go +++ b/internal/service/codecommit/trigger_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodecommit "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckTriggerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodecommit.FindRepositoryTriggersByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 9a165805fec6d61f593018dc6a9b9cf903908252 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:42 -0800 Subject: [PATCH 049/227] `codeconnections` --- internal/service/codeconnections/connection.go | 5 +++-- internal/service/codeconnections/connection_test.go | 4 ++-- internal/service/codeconnections/host.go | 5 +++-- internal/service/codeconnections/host_test.go | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/service/codeconnections/connection.go b/internal/service/codeconnections/connection.go index 2b0fff4a827..c5c5e969892 100644 --- a/internal/service/codeconnections/connection.go +++ b/internal/service/codeconnections/connection.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -185,7 +186,7 @@ func (r *connectionResource) Read(ctx context.Context, req resource.ReadRequest, out, err := findConnectionByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -306,7 +307,7 @@ func statusConnection(ctx context.Context, conn *codeconnections.Client, arn str return func() (any, string, error) { out, err := findConnectionByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codeconnections/connection_test.go b/internal/service/codeconnections/connection_test.go index c582fb5c3c8..23e451d5d8b 100644 --- a/internal/service/codeconnections/connection_test.go +++ b/internal/service/codeconnections/connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeconnections "github.com/hashicorp/terraform-provider-aws/internal/service/codeconnections" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -147,7 +147,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodeconnections.FindConnectionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codeconnections/host.go b/internal/service/codeconnections/host.go index 361fc4d06a6..b3eac587a2b 100644 --- a/internal/service/codeconnections/host.go +++ b/internal/service/codeconnections/host.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -196,7 +197,7 @@ func (r *hostResource) Read(ctx context.Context, req resource.ReadRequest, resp out, err := findHostByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -353,7 +354,7 @@ func waitHostDeleted(ctx context.Context, conn *codeconnections.Client, id strin func statusHost(ctx context.Context, conn *codeconnections.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findHostByARN(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codeconnections/host_test.go b/internal/service/codeconnections/host_test.go index 69e7fec75df..81cb06dd767 100644 --- a/internal/service/codeconnections/host_test.go +++ b/internal/service/codeconnections/host_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeconnections "github.com/hashicorp/terraform-provider-aws/internal/service/codeconnections" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckHostDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodeconnections.FindHostByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7f666116a8604f09213f86604eb99e157781edd8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:43 -0800 Subject: [PATCH 050/227] `codeguruprofiler` --- internal/service/codeguruprofiler/profiling_group.go | 3 ++- .../service/codeguruprofiler/profiling_group_data_source.go | 4 ++-- internal/service/codeguruprofiler/profiling_group_test.go | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/service/codeguruprofiler/profiling_group.go b/internal/service/codeguruprofiler/profiling_group.go index 1e55b5ea983..a42ae96f1fc 100644 --- a/internal/service/codeguruprofiler/profiling_group.go +++ b/internal/service/codeguruprofiler/profiling_group.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -145,7 +146,7 @@ func (r *profilingGroupResource) Read(ctx context.Context, req resource.ReadRequ } out, err := findProfilingGroupByName(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/codeguruprofiler/profiling_group_data_source.go b/internal/service/codeguruprofiler/profiling_group_data_source.go index 9a40eece7bb..492bcdbc541 100644 --- a/internal/service/codeguruprofiler/profiling_group_data_source.go +++ b/internal/service/codeguruprofiler/profiling_group_data_source.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -77,7 +77,7 @@ func (d *profilingGroupDataSource) Read(ctx context.Context, req datasource.Read } out, err := findProfilingGroupByName(ctx, conn, data.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/codeguruprofiler/profiling_group_test.go b/internal/service/codeguruprofiler/profiling_group_test.go index f18644ad5cd..c5c88dbc808 100644 --- a/internal/service/codeguruprofiler/profiling_group_test.go +++ b/internal/service/codeguruprofiler/profiling_group_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodeguruprofiler "github.com/hashicorp/terraform-provider-aws/internal/service/codeguruprofiler" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func testAccCheckProfilingGroupDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcodeguruprofiler.FindProfilingGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } From 8928e53b04f2ea5dfa85c7ba2e029dd8004ec59f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:44 -0800 Subject: [PATCH 051/227] `codegurureviewer` --- internal/service/codegurureviewer/repository_association.go | 5 +++-- .../service/codegurureviewer/repository_association_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/codegurureviewer/repository_association.go b/internal/service/codegurureviewer/repository_association.go index 00f24b79a37..c2ed25571e0 100644 --- a/internal/service/codegurureviewer/repository_association.go +++ b/internal/service/codegurureviewer/repository_association.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -301,7 +302,7 @@ func resourceRepositoryAssociationRead(ctx context.Context, d *schema.ResourceDa out, err := findRepositoryAssociationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeGuru Reviewer Repository Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -391,7 +392,7 @@ func statusRepositoryAssociation(ctx context.Context, conn *codegurureviewer.Cli return func() (any, string, error) { output, err := findRepositoryAssociationByARN(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go index 24ed8807d51..562877476e8 100644 --- a/internal/service/codegurureviewer/repository_association_test.go +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodegurureviewer "github.com/hashicorp/terraform-provider-aws/internal/service/codegurureviewer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -218,7 +218,7 @@ func testAccCheckRepositoryAssociationDestroy(ctx context.Context) resource.Test _, err := tfcodegurureviewer.FindRepositoryAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 58056aacdb2a03a2c9f54ed6af320a49b5de322e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:44 -0800 Subject: [PATCH 052/227] `codepipeline` --- internal/service/codepipeline/codepipeline.go | 3 ++- internal/service/codepipeline/codepipeline_test.go | 4 ++-- internal/service/codepipeline/custom_action_type.go | 3 ++- internal/service/codepipeline/custom_action_type_test.go | 4 ++-- internal/service/codepipeline/webhook.go | 3 ++- internal/service/codepipeline/webhook_test.go | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/internal/service/codepipeline/codepipeline.go b/internal/service/codepipeline/codepipeline.go index 77a70795a77..abc0b0227c0 100644 --- a/internal/service/codepipeline/codepipeline.go +++ b/internal/service/codepipeline/codepipeline.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -673,7 +674,7 @@ func resourcePipelineRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findPipelineByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodePipeline Pipeline %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codepipeline/codepipeline_test.go b/internal/service/codepipeline/codepipeline_test.go index 6b9a9020344..f19b67cd557 100644 --- a/internal/service/codepipeline/codepipeline_test.go +++ b/internal/service/codepipeline/codepipeline_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodepipeline "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1301,7 +1301,7 @@ func testAccCheckPipelineDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodepipeline.FindPipelineByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codepipeline/custom_action_type.go b/internal/service/codepipeline/custom_action_type.go index 1d00d32667c..db6f880adac 100644 --- a/internal/service/codepipeline/custom_action_type.go +++ b/internal/service/codepipeline/custom_action_type.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -233,7 +234,7 @@ func resourceCustomActionTypeRead(ctx context.Context, d *schema.ResourceData, m actionType, err := findCustomActionTypeByThreePartKey(ctx, conn, category, provider, version) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodePipeline Custom Action Type %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codepipeline/custom_action_type_test.go b/internal/service/codepipeline/custom_action_type_test.go index 418b6612984..569257e9071 100644 --- a/internal/service/codepipeline/custom_action_type_test.go +++ b/internal/service/codepipeline/custom_action_type_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodepipeline "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -247,7 +247,7 @@ func testAccCheckCustomActionTypeDestroy(ctx context.Context) resource.TestCheck _, err = tfcodepipeline.FindCustomActionTypeByThreePartKey(ctx, conn, category, provider, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codepipeline/webhook.go b/internal/service/codepipeline/webhook.go index 50fea357779..3c685f926a6 100644 --- a/internal/service/codepipeline/webhook.go +++ b/internal/service/codepipeline/webhook.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -163,7 +164,7 @@ func resourceWebhookRead(ctx context.Context, d *schema.ResourceData, meta any) webhook, err := findWebhookByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodePipeline Webhook %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codepipeline/webhook_test.go b/internal/service/codepipeline/webhook_test.go index 2369f5b7a4f..632ddd08139 100644 --- a/internal/service/codepipeline/webhook_test.go +++ b/internal/service/codepipeline/webhook_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodepipeline "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -316,7 +316,7 @@ func testAccCheckWebhookDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodepipeline.FindWebhookByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From d8cdf8903c50091d2df674b18ec6e2aa62ac20a2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:45 -0800 Subject: [PATCH 053/227] `codestarconnections` --- internal/service/codestarconnections/connection.go | 3 ++- internal/service/codestarconnections/connection_test.go | 4 ++-- internal/service/codestarconnections/host.go | 5 +++-- internal/service/codestarconnections/host_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/codestarconnections/connection.go b/internal/service/codestarconnections/connection.go index 489673f2d04..a8f75001d3e 100644 --- a/internal/service/codestarconnections/connection.go +++ b/internal/service/codestarconnections/connection.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -105,7 +106,7 @@ func resourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta an connection, err := findConnectionByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeStar Connections Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codestarconnections/connection_test.go b/internal/service/codestarconnections/connection_test.go index bb0d4d297e7..92b8019aa07 100644 --- a/internal/service/codestarconnections/connection_test.go +++ b/internal/service/codestarconnections/connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodestarconnections "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +199,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodestarconnections.FindConnectionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/codestarconnections/host.go b/internal/service/codestarconnections/host.go index 9ef3cdac0d5..08ec334d154 100644 --- a/internal/service/codestarconnections/host.go +++ b/internal/service/codestarconnections/host.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +131,7 @@ func resourceHostRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findHostByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeStar Connections Host (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -265,7 +266,7 @@ func statusHost(ctx context.Context, conn *codestarconnections.Client, arn strin return func() (any, string, error) { output, err := findHostByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/codestarconnections/host_test.go b/internal/service/codestarconnections/host_test.go index 00a215d8474..c0955019824 100644 --- a/internal/service/codestarconnections/host_test.go +++ b/internal/service/codestarconnections/host_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodestarconnections "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func testAccCheckHostDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodestarconnections.FindHostByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 05376c22228f5424045b975c82c03faa7a3447c9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:46 -0800 Subject: [PATCH 054/227] `codestarnotifications` --- internal/service/codestarnotifications/notification_rule.go | 3 ++- .../service/codestarnotifications/notification_rule_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/service/codestarnotifications/notification_rule.go b/internal/service/codestarnotifications/notification_rule.go index 3d3e3ed7963..3c1a83c2719 100644 --- a/internal/service/codestarnotifications/notification_rule.go +++ b/internal/service/codestarnotifications/notification_rule.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -138,7 +139,7 @@ func resourceNotificationRuleRead(ctx context.Context, d *schema.ResourceData, m rule, err := findNotificationRuleByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeStar Notification Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/codestarnotifications/notification_rule_test.go b/internal/service/codestarnotifications/notification_rule_test.go index 7e492a5d6d0..e5278205666 100644 --- a/internal/service/codestarnotifications/notification_rule_test.go +++ b/internal/service/codestarnotifications/notification_rule_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodestarnotifications "github.com/hashicorp/terraform-provider-aws/internal/service/codestarnotifications" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -272,7 +272,7 @@ func testAccCheckNotificationRuleDestroy(ctx context.Context) resource.TestCheck _, err := tfcodestarnotifications.FindNotificationRuleByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 1a4de327e482d6455a671fd2f3389e012706a5d8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:47 -0800 Subject: [PATCH 055/227] `cognitoidp` --- internal/service/cognitoidp/identity_provider.go | 3 ++- internal/service/cognitoidp/identity_provider_test.go | 4 ++-- internal/service/cognitoidp/log_delivery_configuration.go | 3 ++- internal/service/cognitoidp/managed_login_branding.go | 5 +++-- internal/service/cognitoidp/managed_login_branding_test.go | 4 ++-- internal/service/cognitoidp/managed_user_pool_client.go | 3 ++- internal/service/cognitoidp/resource_server.go | 3 ++- internal/service/cognitoidp/resource_server_test.go | 4 ++-- internal/service/cognitoidp/risk_configuration.go | 3 ++- internal/service/cognitoidp/risk_configuration_test.go | 4 ++-- internal/service/cognitoidp/user.go | 3 ++- internal/service/cognitoidp/user_group.go | 3 ++- internal/service/cognitoidp/user_group_test.go | 4 ++-- internal/service/cognitoidp/user_in_group.go | 4 ++-- internal/service/cognitoidp/user_in_group_test.go | 4 ++-- internal/service/cognitoidp/user_pool.go | 3 ++- internal/service/cognitoidp/user_pool_client.go | 3 ++- internal/service/cognitoidp/user_pool_client_test.go | 4 ++-- internal/service/cognitoidp/user_pool_domain.go | 5 +++-- internal/service/cognitoidp/user_pool_domain_test.go | 4 ++-- internal/service/cognitoidp/user_pool_test.go | 4 ++-- internal/service/cognitoidp/user_pool_ui_customization.go | 3 ++- .../service/cognitoidp/user_pool_ui_customization_test.go | 4 ++-- internal/service/cognitoidp/user_test.go | 4 ++-- 24 files changed, 50 insertions(+), 38 deletions(-) diff --git a/internal/service/cognitoidp/identity_provider.go b/internal/service/cognitoidp/identity_provider.go index d1eb852c297..34e9ba1cbdb 100644 --- a/internal/service/cognitoidp/identity_provider.go +++ b/internal/service/cognitoidp/identity_provider.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +133,7 @@ func resourceIdentityProviderRead(ctx context.Context, d *schema.ResourceData, m idp, err := findIdentityProviderByTwoPartKey(ctx, conn, userPoolID, providerName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito Identity Provider %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/identity_provider_test.go b/internal/service/cognitoidp/identity_provider_test.go index 1c492ac599a..3c68ba6a0d0 100644 --- a/internal/service/cognitoidp/identity_provider_test.go +++ b/internal/service/cognitoidp/identity_provider_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -248,7 +248,7 @@ func testAccCheckIdentityProviderDestroy(ctx context.Context) resource.TestCheck _, err := tfcognitoidp.FindIdentityProviderByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrProviderName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/log_delivery_configuration.go b/internal/service/cognitoidp/log_delivery_configuration.go index e768e7dc5f9..bfa5803acb0 100644 --- a/internal/service/cognitoidp/log_delivery_configuration.go +++ b/internal/service/cognitoidp/log_delivery_configuration.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/smerr" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -166,7 +167,7 @@ func (r *logDeliveryConfigurationResource) Read(ctx context.Context, req resourc } out, err := findLogDeliveryConfigurationByUserPoolID(ctx, conn, state.UserPoolID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/cognitoidp/managed_login_branding.go b/internal/service/cognitoidp/managed_login_branding.go index 1992f717f95..749cd5f73d0 100644 --- a/internal/service/cognitoidp/managed_login_branding.go +++ b/internal/service/cognitoidp/managed_login_branding.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -213,7 +214,7 @@ func (r *managedLoginBrandingResource) Read(ctx context.Context, request resourc // Return only customized values. mlb, err := findManagedLoginBrandingByThreePartKey(ctx, conn, userPoolID, managedLoginBrandingID, false) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -276,7 +277,7 @@ func (r *managedLoginBrandingResource) Read(ctx context.Context, request resourc } mlb, err := findManagedLoginBrandingByClient(ctx, conn, &input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/managed_login_branding_test.go b/internal/service/cognitoidp/managed_login_branding_test.go index 0c1a76bd1b8..93d9c8a66a6 100644 --- a/internal/service/cognitoidp/managed_login_branding_test.go +++ b/internal/service/cognitoidp/managed_login_branding_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -360,7 +360,7 @@ func testAccCheckManagedLoginBrandingDestroy(ctx context.Context) resource.TestC _, err := tfcognitoidp.FindManagedLoginBrandingByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes["managed_login_branding_id"], false) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/managed_user_pool_client.go b/internal/service/cognitoidp/managed_user_pool_client.go index 930f86030d8..0c94037a501 100644 --- a/internal/service/cognitoidp/managed_user_pool_client.go +++ b/internal/service/cognitoidp/managed_user_pool_client.go @@ -35,6 +35,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -533,7 +534,7 @@ func (r *managedUserPoolClientResource) Read(ctx context.Context, request resour upc, err := findUserPoolClientByTwoPartKey(ctx, conn, data.UserPoolID.ValueString(), data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/cognitoidp/resource_server.go b/internal/service/cognitoidp/resource_server.go index a6a1b5c6d82..a9b599a3a23 100644 --- a/internal/service/cognitoidp/resource_server.go +++ b/internal/service/cognitoidp/resource_server.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -120,7 +121,7 @@ func resourceResourceServerRead(ctx context.Context, d *schema.ResourceData, met resourceServer, err := findResourceServerByTwoPartKey(ctx, conn, userPoolID, identifier) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito Resource Server %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/resource_server_test.go b/internal/service/cognitoidp/resource_server_test.go index a5af2268be1..a3b1069dc4c 100644 --- a/internal/service/cognitoidp/resource_server_test.go +++ b/internal/service/cognitoidp/resource_server_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -204,7 +204,7 @@ func testAccCheckResourceServerDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcognitoidp.FindResourceServerByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrIdentifier]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/risk_configuration.go b/internal/service/cognitoidp/risk_configuration.go index ff9f369d66c..b9fafb06466 100644 --- a/internal/service/cognitoidp/risk_configuration.go +++ b/internal/service/cognitoidp/risk_configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -345,7 +346,7 @@ func resourceRiskConfigurationRead(ctx context.Context, d *schema.ResourceData, riskConfig, err := findRiskConfigurationByTwoPartKey(ctx, conn, userPoolID, clientID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito Risk Configuration %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/risk_configuration_test.go b/internal/service/cognitoidp/risk_configuration_test.go index 648b322eae6..dca11114de1 100644 --- a/internal/service/cognitoidp/risk_configuration_test.go +++ b/internal/service/cognitoidp/risk_configuration_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -291,7 +291,7 @@ func testAccCheckRiskConfigurationDestroy(ctx context.Context) resource.TestChec _, err := tfcognitoidp.FindRiskConfigurationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrClientID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user.go b/internal/service/cognitoidp/user.go index ce3b56f9cfa..9ebb28db47f 100644 --- a/internal/service/cognitoidp/user.go +++ b/internal/service/cognitoidp/user.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -243,7 +244,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia userPoolID, username := d.Get(names.AttrUserPoolID).(string), d.Get(names.AttrUsername).(string) user, err := findUserByTwoPartKey(ctx, conn, userPoolID, username) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito User %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/user_group.go b/internal/service/cognitoidp/user_group.go index 7820a3e9298..f03b6063e79 100644 --- a/internal/service/cognitoidp/user_group.go +++ b/internal/service/cognitoidp/user_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceUserGroupRead(ctx context.Context, d *schema.ResourceData, meta any group, err := findGroupByTwoPartKey(ctx, conn, userPoolID, groupName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito User Group %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/user_group_test.go b/internal/service/cognitoidp/user_group_test.go index fb596fb3588..420bb649663 100644 --- a/internal/service/cognitoidp/user_group_test.go +++ b/internal/service/cognitoidp/user_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -189,7 +189,7 @@ func testAccCheckUserGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcognitoidp.FindGroupByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user_in_group.go b/internal/service/cognitoidp/user_in_group.go index 4e2cecd3abb..487cf8c8702 100644 --- a/internal/service/cognitoidp/user_in_group.go +++ b/internal/service/cognitoidp/user_in_group.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func resourceUserInGroupRead(ctx context.Context, d *schema.ResourceData, meta a username := parts[2] err = findGroupUserByThreePartKey(ctx, conn, groupName, userPoolId, username) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito Group User %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/user_in_group_test.go b/internal/service/cognitoidp/user_in_group_test.go index 4195e70c756..af58051bfcc 100644 --- a/internal/service/cognitoidp/user_in_group_test.go +++ b/internal/service/cognitoidp/user_in_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func testAccCheckUserInGroupDestroy(ctx context.Context) resource.TestCheckFunc err := tfcognitoidp.FindGroupUserByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrGroupName], rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrUsername]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user_pool.go b/internal/service/cognitoidp/user_pool.go index c180c0e8961..561870386bd 100644 --- a/internal/service/cognitoidp/user_pool.go +++ b/internal/service/cognitoidp/user_pool.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -915,7 +916,7 @@ func resourceUserPoolRead(ctx context.Context, d *schema.ResourceData, meta any) userPool, err := findUserPoolByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito User Pool %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/user_pool_client.go b/internal/service/cognitoidp/user_pool_client.go index dfe6fd76a98..52efc05179a 100644 --- a/internal/service/cognitoidp/user_pool_client.go +++ b/internal/service/cognitoidp/user_pool_client.go @@ -37,6 +37,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -404,7 +405,7 @@ func (r *userPoolClientResource) Read(ctx context.Context, request resource.Read upc, err := findUserPoolClientByTwoPartKey(ctx, conn, data.UserPoolID.ValueString(), data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/cognitoidp/user_pool_client_test.go b/internal/service/cognitoidp/user_pool_client_test.go index 635908824a9..cbb3f890eac 100644 --- a/internal/service/cognitoidp/user_pool_client_test.go +++ b/internal/service/cognitoidp/user_pool_client_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1507,7 +1507,7 @@ func testAccCheckUserPoolClientDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcognitoidp.FindUserPoolClientByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user_pool_domain.go b/internal/service/cognitoidp/user_pool_domain.go index 3fcc585d0df..dc1195bcabb 100644 --- a/internal/service/cognitoidp/user_pool_domain.go +++ b/internal/service/cognitoidp/user_pool_domain.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -136,7 +137,7 @@ func resourceUserPoolDomainRead(ctx context.Context, d *schema.ResourceData, met desc, err := findUserPoolDomain(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito User Pool Domain %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -267,7 +268,7 @@ func statusUserPoolDomain(ctx context.Context, conn *cognitoidentityprovider.Cli return func() (any, string, error) { output, err := findUserPoolDomain(ctx, conn, domain) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index 0b9072f97b1..18e6f8daeff 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -243,7 +243,7 @@ func testAccCheckUserPoolDomainDestroy(ctx context.Context) resource.TestCheckFu _, err := tfcognitoidp.FindUserPoolDomain(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 869878e394a..ded5e85db4f 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2121,7 +2121,7 @@ func testAccCheckUserPoolDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcognitoidp.FindUserPoolByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user_pool_ui_customization.go b/internal/service/cognitoidp/user_pool_ui_customization.go index 69b01afccfe..beb64330968 100644 --- a/internal/service/cognitoidp/user_pool_ui_customization.go +++ b/internal/service/cognitoidp/user_pool_ui_customization.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -127,7 +128,7 @@ func resourceUserPoolUICustomizationRead(ctx context.Context, d *schema.Resource uiCustomization, err := findUserPoolUICustomizationByTwoPartKey(ctx, conn, userPoolID, clientID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cognito User Pool UI Customization %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cognitoidp/user_pool_ui_customization_test.go b/internal/service/cognitoidp/user_pool_ui_customization_test.go index 4fe00f8e710..8e7ee3eb45e 100644 --- a/internal/service/cognitoidp/user_pool_ui_customization_test.go +++ b/internal/service/cognitoidp/user_pool_ui_customization_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -517,7 +517,7 @@ func testAccCheckUserPoolUICustomizationDestroy(ctx context.Context) resource.Te _, err := tfcognitoidp.FindUserPoolUICustomizationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrClientID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/cognitoidp/user_test.go b/internal/service/cognitoidp/user_test.go index 62796a48f34..bb1ca26eeac 100644 --- a/internal/service/cognitoidp/user_test.go +++ b/internal/service/cognitoidp/user_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -374,7 +374,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcognitoidp.FindUserByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserPoolID], rs.Primary.Attributes[names.AttrUsername]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5236c9ff6671c73b3143bf8230197ec915d05d5e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:48 -0800 Subject: [PATCH 056/227] `comprehend` --- internal/service/comprehend/document_classifier.go | 5 +++-- internal/service/comprehend/entity_recognizer.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/service/comprehend/document_classifier.go b/internal/service/comprehend/document_classifier.go index 4de5658d33f..f2d4c2df8a5 100644 --- a/internal/service/comprehend/document_classifier.go +++ b/internal/service/comprehend/document_classifier.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -297,7 +298,7 @@ func resourceDocumentClassifierRead(ctx context.Context, d *schema.ResourceData, out, err := FindDocumentClassifierByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Comprehend Document Classifier (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -701,7 +702,7 @@ func waitDocumentClassifierDeleted(ctx context.Context, conn *comprehend.Client, func statusDocumentClassifier(ctx context.Context, conn *comprehend.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindDocumentClassifierByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/comprehend/entity_recognizer.go b/internal/service/comprehend/entity_recognizer.go index 1ce69f15771..314149478e8 100644 --- a/internal/service/comprehend/entity_recognizer.go +++ b/internal/service/comprehend/entity_recognizer.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -331,7 +332,7 @@ func resourceEntityRecognizerRead(ctx context.Context, d *schema.ResourceData, m out, err := FindEntityRecognizerByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Comprehend Entity Recognizer (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -728,7 +729,7 @@ func waitEntityRecognizerDeleted(ctx context.Context, conn *comprehend.Client, i func statusEntityRecognizer(ctx context.Context, conn *comprehend.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindEntityRecognizerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From a45dac28f23ee332f47ed1bd32c3bfcf0a6f0035 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:49 -0800 Subject: [PATCH 057/227] `computeoptimizer` --- internal/service/computeoptimizer/enrollment_status.go | 5 +++-- .../service/computeoptimizer/recommendation_preferences.go | 3 ++- .../computeoptimizer/recommendation_preferences_test.go | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/service/computeoptimizer/enrollment_status.go b/internal/service/computeoptimizer/enrollment_status.go index dcaffdbb060..52e6c7807de 100644 --- a/internal/service/computeoptimizer/enrollment_status.go +++ b/internal/service/computeoptimizer/enrollment_status.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -127,7 +128,7 @@ func (r *enrollmentStatusResource) Read(ctx context.Context, request resource.Re output, err := findEnrollmentStatus(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -202,7 +203,7 @@ func statusEnrollmentStatus(ctx context.Context, conn *computeoptimizer.Client) return func() (any, string, error) { output, err := findEnrollmentStatus(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/computeoptimizer/recommendation_preferences.go b/internal/service/computeoptimizer/recommendation_preferences.go index 086d13cb0a6..5778c006596 100644 --- a/internal/service/computeoptimizer/recommendation_preferences.go +++ b/internal/service/computeoptimizer/recommendation_preferences.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -256,7 +257,7 @@ func (r *recommendationPreferencesResource) Read(ctx context.Context, request re scope := fwdiag.Must(data.Scope.ToPtr(ctx)) output, err := findRecommendationPreferencesByThreePartKey(ctx, conn, data.ResourceType.ValueString(), scope.Name.ValueString(), scope.Value.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/computeoptimizer/recommendation_preferences_test.go b/internal/service/computeoptimizer/recommendation_preferences_test.go index 50a0e60bb0a..b77731643a5 100644 --- a/internal/service/computeoptimizer/recommendation_preferences_test.go +++ b/internal/service/computeoptimizer/recommendation_preferences_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcomputeoptimizer "github.com/hashicorp/terraform-provider-aws/internal/service/computeoptimizer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -308,7 +308,7 @@ func testAccCheckRecommendationPreferencesDestroy(ctx context.Context) resource. _, err := tfcomputeoptimizer.FindRecommendationPreferencesByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrResourceType], rs.Primary.Attributes["scope.0.name"], rs.Primary.Attributes["scope.0.value"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From b68a4c653443d35110bd1d61ffdae2bb0771c37f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:50 -0800 Subject: [PATCH 058/227] `configservice` --- internal/service/configservice/aggregate_authorization.go | 3 ++- .../service/configservice/aggregate_authorization_test.go | 4 ++-- internal/service/configservice/config_rule.go | 5 +++-- internal/service/configservice/config_rule_test.go | 4 ++-- internal/service/configservice/configuration_aggregator.go | 3 ++- .../service/configservice/configuration_aggregator_test.go | 4 ++-- internal/service/configservice/configuration_recorder.go | 3 ++- .../service/configservice/configuration_recorder_status.go | 3 ++- .../configservice/configuration_recorder_status_test.go | 4 ++-- .../service/configservice/configuration_recorder_test.go | 4 ++-- internal/service/configservice/conformance_pack.go | 5 +++-- internal/service/configservice/conformance_pack_test.go | 4 ++-- internal/service/configservice/delivery_channel.go | 3 ++- internal/service/configservice/delivery_channel_test.go | 4 ++-- .../service/configservice/organization_conformance_pack.go | 5 +++-- .../configservice/organization_conformance_pack_test.go | 4 ++-- .../service/configservice/organization_custom_policy_rule.go | 3 ++- .../configservice/organization_custom_policy_rule_test.go | 4 ++-- internal/service/configservice/organization_custom_rule.go | 3 ++- .../service/configservice/organization_custom_rule_test.go | 4 ++-- internal/service/configservice/organization_managed_rule.go | 5 +++-- .../service/configservice/organization_managed_rule_test.go | 4 ++-- internal/service/configservice/remediation_configuration.go | 3 ++- .../service/configservice/remediation_configuration_test.go | 4 ++-- internal/service/configservice/retention_configuration.go | 3 ++- .../service/configservice/retention_configuration_test.go | 4 ++-- 26 files changed, 56 insertions(+), 43 deletions(-) diff --git a/internal/service/configservice/aggregate_authorization.go b/internal/service/configservice/aggregate_authorization.go index 7a696d3e0e7..a35d75b4253 100644 --- a/internal/service/configservice/aggregate_authorization.go +++ b/internal/service/configservice/aggregate_authorization.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -107,7 +108,7 @@ func resourceAggregateAuthorizationRead(ctx context.Context, d *schema.ResourceD aggregationAuthorization, err := findAggregateAuthorizationByTwoPartKey(ctx, conn, accountID, authorizedRegion) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Aggregate Authorization (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/aggregate_authorization_test.go b/internal/service/configservice/aggregate_authorization_test.go index aa69d5cfeba..1cdc30eef99 100644 --- a/internal/service/configservice/aggregate_authorization_test.go +++ b/internal/service/configservice/aggregate_authorization_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func testAccCheckAggregateAuthorizationDestroy(ctx context.Context) resource.Tes } _, err := tfconfig.FindAggregateAuthorizationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAccountID], authorizedRegion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/config_rule.go b/internal/service/configservice/config_rule.go index c0bd8054b83..d8b4538ab12 100644 --- a/internal/service/configservice/config_rule.go +++ b/internal/service/configservice/config_rule.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -258,7 +259,7 @@ func resourceConfigRuleRead(ctx context.Context, d *schema.ResourceData, meta an rule, err := findConfigRuleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Config Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -370,7 +371,7 @@ func statusConfigRule(ctx context.Context, conn *configservice.Client, name stri return func() (any, string, error) { output, err := findConfigRuleByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/configservice/config_rule_test.go b/internal/service/configservice/config_rule_test.go index d3f37f8de51..c31271b43f4 100644 --- a/internal/service/configservice/config_rule_test.go +++ b/internal/service/configservice/config_rule_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -430,7 +430,7 @@ func testAccCheckConfigRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfconfig.FindConfigRuleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/configuration_aggregator.go b/internal/service/configservice/configuration_aggregator.go index 47f79e98e50..643b8d68875 100644 --- a/internal/service/configservice/configuration_aggregator.go +++ b/internal/service/configservice/configuration_aggregator.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -165,7 +166,7 @@ func resourceConfigurationAggregatorRead(ctx context.Context, d *schema.Resource aggregator, err := findConfigurationAggregatorByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Configuration Aggregator (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/configuration_aggregator_test.go b/internal/service/configservice/configuration_aggregator_test.go index 77be0d648ca..18ef31c22db 100644 --- a/internal/service/configservice/configuration_aggregator_test.go +++ b/internal/service/configservice/configuration_aggregator_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -218,7 +218,7 @@ func testAccCheckConfigurationAggregatorDestroy(ctx context.Context) resource.Te _, err := tfconfig.FindConfigurationAggregatorByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/configuration_recorder.go b/internal/service/configservice/configuration_recorder.go index 8a655834db9..f537859cb49 100644 --- a/internal/service/configservice/configuration_recorder.go +++ b/internal/service/configservice/configuration_recorder.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -189,7 +190,7 @@ func resourceConfigurationRecorderRead(ctx context.Context, d *schema.ResourceDa recorder, err := findConfigurationRecorderByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Configuration Recorder (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/configuration_recorder_status.go b/internal/service/configservice/configuration_recorder_status.go index b4cd503a576..b1e08dbd326 100644 --- a/internal/service/configservice/configuration_recorder_status.go +++ b/internal/service/configservice/configuration_recorder_status.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -86,7 +87,7 @@ func resourceConfigurationRecorderStatusRead(ctx context.Context, d *schema.Reso recorderStatus, err := findConfigurationRecorderStatusByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Configuration Recorder Status (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/configuration_recorder_status_test.go b/internal/service/configservice/configuration_recorder_status_test.go index 980963bc6e3..cdb712560ef 100644 --- a/internal/service/configservice/configuration_recorder_status_test.go +++ b/internal/service/configservice/configuration_recorder_status_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckConfigurationRecorderStatusDestroy(ctx context.Context) resourc _, err := tfconfig.FindConfigurationRecorderStatusByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/configuration_recorder_test.go b/internal/service/configservice/configuration_recorder_test.go index 85f4194f308..f254d677fd0 100644 --- a/internal/service/configservice/configuration_recorder_test.go +++ b/internal/service/configservice/configuration_recorder_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -166,7 +166,7 @@ func testAccCheckConfigurationRecorderDestroy(ctx context.Context) resource.Test _, err := tfconfig.FindConfigurationRecorderByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/conformance_pack.go b/internal/service/configservice/conformance_pack.go index 32f312b5617..8a7f017163e 100644 --- a/internal/service/configservice/conformance_pack.go +++ b/internal/service/configservice/conformance_pack.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -158,7 +159,7 @@ func resourceConformancePackRead(ctx context.Context, d *schema.ResourceData, me pack, err := findConformancePackByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Conformance Pack (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -296,7 +297,7 @@ func statusConformancePack(ctx context.Context, conn *configservice.Client, name return func() (any, string, error) { output, err := findConformancePackStatusByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/configservice/conformance_pack_test.go b/internal/service/configservice/conformance_pack_test.go index 4f9eaf9790b..2ceacb30dc3 100644 --- a/internal/service/configservice/conformance_pack_test.go +++ b/internal/service/configservice/conformance_pack_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -446,7 +446,7 @@ func testAccCheckConformancePackDestroy(ctx context.Context) resource.TestCheckF _, err := tfconfig.FindConformancePackByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/delivery_channel.go b/internal/service/configservice/delivery_channel.go index 41262e30465..04c913a1e50 100644 --- a/internal/service/configservice/delivery_channel.go +++ b/internal/service/configservice/delivery_channel.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -135,7 +136,7 @@ func resourceDeliveryChannelRead(ctx context.Context, d *schema.ResourceData, me channel, err := findDeliveryChannelByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Delivery Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/delivery_channel_test.go b/internal/service/configservice/delivery_channel_test.go index f184a60bfc4..0d9cd54117b 100644 --- a/internal/service/configservice/delivery_channel_test.go +++ b/internal/service/configservice/delivery_channel_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func testAccCheckDeliveryChannelDestroy(ctx context.Context) resource.TestCheckF _, err := tfconfig.FindDeliveryChannelByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/organization_conformance_pack.go b/internal/service/configservice/organization_conformance_pack.go index b36ce8df54c..0f39f2a7ba2 100644 --- a/internal/service/configservice/organization_conformance_pack.go +++ b/internal/service/configservice/organization_conformance_pack.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -180,7 +181,7 @@ func resourceOrganizationConformancePackRead(ctx context.Context, d *schema.Reso pack, err := findOrganizationConformancePackByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Organization Conformance Pack (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -431,7 +432,7 @@ func statusOrganizationConformancePack(ctx context.Context, conn *configservice. return func() (any, string, error) { output, err := findOrganizationConformancePackStatusByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/configservice/organization_conformance_pack_test.go b/internal/service/configservice/organization_conformance_pack_test.go index d585123ef3c..df9c91297ef 100644 --- a/internal/service/configservice/organization_conformance_pack_test.go +++ b/internal/service/configservice/organization_conformance_pack_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -443,7 +443,7 @@ func testAccCheckOrganizationConformancePackDestroy(ctx context.Context) resourc _, err := tfconfig.FindOrganizationConformancePackByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { + if retry.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { continue } diff --git a/internal/service/configservice/organization_custom_policy_rule.go b/internal/service/configservice/organization_custom_policy_rule.go index 1df7c31ef96..dc0b9327b50 100644 --- a/internal/service/configservice/organization_custom_policy_rule.go +++ b/internal/service/configservice/organization_custom_policy_rule.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -213,7 +214,7 @@ func resourceOrganizationCustomPolicyRuleRead(ctx context.Context, d *schema.Res configRule, err := findOrganizationCustomPolicyRuleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Organization Custom Policy Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/organization_custom_policy_rule_test.go b/internal/service/configservice/organization_custom_policy_rule_test.go index 087416ae44f..7e3b743ce59 100644 --- a/internal/service/configservice/organization_custom_policy_rule_test.go +++ b/internal/service/configservice/organization_custom_policy_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckOrganizationCustomPolicyRuleDestroy(ctx context.Context) resour _, err := tfconfig.FindOrganizationCustomPolicyRuleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { + if retry.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { continue } diff --git a/internal/service/configservice/organization_custom_rule.go b/internal/service/configservice/organization_custom_rule.go index c224bc88a30..74734e95eee 100644 --- a/internal/service/configservice/organization_custom_rule.go +++ b/internal/service/configservice/organization_custom_rule.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -193,7 +194,7 @@ func resourceOrganizationCustomRuleRead(ctx context.Context, d *schema.ResourceD configRule, err := findOrganizationCustomRuleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Organization Custom Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/organization_custom_rule_test.go b/internal/service/configservice/organization_custom_rule_test.go index c509d7f1585..9584d17d61d 100644 --- a/internal/service/configservice/organization_custom_rule_test.go +++ b/internal/service/configservice/organization_custom_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfigservice "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -490,7 +490,7 @@ func testAccCheckOrganizationCustomRuleDestroy(ctx context.Context) resource.Tes _, err := tfconfigservice.FindOrganizationCustomRuleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { + if retry.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { continue } diff --git a/internal/service/configservice/organization_managed_rule.go b/internal/service/configservice/organization_managed_rule.go index 69a2d4bbb5f..3246984019f 100644 --- a/internal/service/configservice/organization_managed_rule.go +++ b/internal/service/configservice/organization_managed_rule.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -185,7 +186,7 @@ func resourceOrganizationManagedRuleRead(ctx context.Context, d *schema.Resource configRule, err := findOrganizationManagedRuleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Organization Managed Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -458,7 +459,7 @@ func statusOrganizationConfigRule(ctx context.Context, conn *configservice.Clien return func() (any, string, error) { output, err := findOrganizationConfigRuleStatusByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/configservice/organization_managed_rule_test.go b/internal/service/configservice/organization_managed_rule_test.go index 6d087ac3954..aad5bb1b93d 100644 --- a/internal/service/configservice/organization_managed_rule_test.go +++ b/internal/service/configservice/organization_managed_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -451,7 +451,7 @@ func testAccCheckOrganizationManagedRuleDestroy(ctx context.Context) resource.Te _, err := tfconfig.FindOrganizationManagedRuleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { + if retry.NotFound(err) || errs.IsA[*types.OrganizationAccessDeniedException](err) { continue } diff --git a/internal/service/configservice/remediation_configuration.go b/internal/service/configservice/remediation_configuration.go index 391e21c2ade..c8222033e86 100644 --- a/internal/service/configservice/remediation_configuration.go +++ b/internal/service/configservice/remediation_configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +208,7 @@ func resourceRemediationConfigurationRead(ctx context.Context, d *schema.Resourc remediationConfiguration, err := findRemediationConfigurationByConfigRuleName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ConfigService Remediation Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/configservice/remediation_configuration_test.go b/internal/service/configservice/remediation_configuration_test.go index c6828c21732..a734bb5e84f 100644 --- a/internal/service/configservice/remediation_configuration_test.go +++ b/internal/service/configservice/remediation_configuration_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -260,7 +260,7 @@ func testAccCheckRemediationConfigurationDestroy(ctx context.Context) resource.T _, err := tfconfig.FindRemediationConfigurationByConfigRuleName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/configservice/retention_configuration.go b/internal/service/configservice/retention_configuration.go index b809a4c7527..fadd176d534 100644 --- a/internal/service/configservice/retention_configuration.go +++ b/internal/service/configservice/retention_configuration.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -102,7 +103,7 @@ func (r *retentionConfigurationResource) Read(ctx context.Context, request resou name := data.ID.ValueString() retentionConfiguration, err := findRetentionConfigurationByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/configservice/retention_configuration_test.go b/internal/service/configservice/retention_configuration_test.go index 06dfcd5b448..e355720c766 100644 --- a/internal/service/configservice/retention_configuration_test.go +++ b/internal/service/configservice/retention_configuration_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckRetentionConfigurationDestroy(ctx context.Context) resource.Tes _, err := tfconfig.FindRetentionConfigurationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7ee78d95531746313684726cb014a7e4dca6452c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:51 -0800 Subject: [PATCH 059/227] `connect` --- internal/service/connect/bot_association.go | 3 ++- internal/service/connect/bot_association_test.go | 4 ++-- internal/service/connect/contact_flow.go | 3 ++- internal/service/connect/contact_flow_module.go | 3 ++- internal/service/connect/contact_flow_module_test.go | 4 ++-- internal/service/connect/contact_flow_test.go | 4 ++-- internal/service/connect/hours_of_operation.go | 3 ++- internal/service/connect/hours_of_operation_test.go | 4 ++-- internal/service/connect/instance.go | 5 +++-- internal/service/connect/instance_storage_config.go | 3 ++- internal/service/connect/instance_storage_config_test.go | 4 ++-- internal/service/connect/instance_test.go | 4 ++-- internal/service/connect/lambda_function_association.go | 3 ++- internal/service/connect/lambda_function_association_test.go | 4 ++-- internal/service/connect/phone_number.go | 5 +++-- .../service/connect/phone_number_contact_flow_association.go | 3 ++- .../connect/phone_number_contact_flow_association_test.go | 4 ++-- internal/service/connect/phone_number_test.go | 4 ++-- internal/service/connect/queue.go | 3 ++- internal/service/connect/queue_test.go | 4 ++-- internal/service/connect/quick_connect.go | 3 ++- internal/service/connect/quick_connect_test.go | 4 ++-- internal/service/connect/routing_profile.go | 3 ++- internal/service/connect/routing_profile_test.go | 4 ++-- internal/service/connect/security_profile.go | 3 ++- internal/service/connect/security_profile_test.go | 4 ++-- internal/service/connect/user.go | 3 ++- internal/service/connect/user_hierarchy_group.go | 3 ++- internal/service/connect/user_hierarchy_group_test.go | 4 ++-- internal/service/connect/user_hierarchy_structure.go | 3 ++- internal/service/connect/user_hierarchy_structure_test.go | 4 ++-- internal/service/connect/user_test.go | 4 ++-- internal/service/connect/vocabulary.go | 5 +++-- internal/service/connect/vocabulary_test.go | 4 ++-- 34 files changed, 71 insertions(+), 54 deletions(-) diff --git a/internal/service/connect/bot_association.go b/internal/service/connect/bot_association.go index 4f1761d50b0..ccd2f714d75 100644 --- a/internal/service/connect/bot_association.go +++ b/internal/service/connect/bot_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceBotAssociationRead(ctx context.Context, d *schema.ResourceData, met lexBot, err := findBotAssociationByThreePartKey(ctx, conn, instanceID, name, region) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Bot Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/bot_association_test.go b/internal/service/connect/bot_association_test.go index be47e9f0b00..a1aff49903d 100644 --- a/internal/service/connect/bot_association_test.go +++ b/internal/service/connect/bot_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func testAccCheckBotAssociationDestroy(ctx context.Context) resource.TestCheckFu _, err := tfconnect.FindBotAssociationByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["lex_bot.0.name"], rs.Primary.Attributes["lex_bot.0.lex_region"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/contact_flow.go b/internal/service/connect/contact_flow.go index 803c1cb4a84..7b558e58adb 100644 --- a/internal/service/connect/contact_flow.go +++ b/internal/service/connect/contact_flow.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -156,7 +157,7 @@ func resourceContactFlowRead(ctx context.Context, d *schema.ResourceData, meta a contactFlow, err := findContactFlowByTwoPartKey(ctx, conn, instanceID, contactFlowID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Contact Flow (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/contact_flow_module.go b/internal/service/connect/contact_flow_module.go index 3285059fb63..b94941d41bf 100644 --- a/internal/service/connect/contact_flow_module.go +++ b/internal/service/connect/contact_flow_module.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -149,7 +150,7 @@ func resourceContactFlowModuleRead(ctx context.Context, d *schema.ResourceData, contactFlowModule, err := findContactFlowModuleByTwoPartKey(ctx, conn, instanceID, contactFlowModuleID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Contact Flow Module (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/contact_flow_module_test.go b/internal/service/connect/contact_flow_module_test.go index ce919711e04..aa19b60460c 100644 --- a/internal/service/connect/contact_flow_module_test.go +++ b/internal/service/connect/contact_flow_module_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -174,7 +174,7 @@ func testAccCheckContactFlowModuleDestroy(ctx context.Context) resource.TestChec _, err := tfconnect.FindContactFlowModuleByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["contact_flow_module_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/contact_flow_test.go b/internal/service/connect/contact_flow_test.go index 9051d660a20..72454d3d872 100644 --- a/internal/service/connect/contact_flow_test.go +++ b/internal/service/connect/contact_flow_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -178,7 +178,7 @@ func testAccCheckContactFlowDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfconnect.FindContactFlowByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["contact_flow_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/hours_of_operation.go b/internal/service/connect/hours_of_operation.go index 089bc7e517d..e030bb41907 100644 --- a/internal/service/connect/hours_of_operation.go +++ b/internal/service/connect/hours_of_operation.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -160,7 +161,7 @@ func resourceHoursOfOperationRead(ctx context.Context, d *schema.ResourceData, m hoursOfOperation, err := findHoursOfOperationByTwoPartKey(ctx, conn, instanceID, hoursOfOperationID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Hours Of Operation (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/hours_of_operation_test.go b/internal/service/connect/hours_of_operation_test.go index f0f8b69d49c..aa9638876d6 100644 --- a/internal/service/connect/hours_of_operation_test.go +++ b/internal/service/connect/hours_of_operation_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -264,7 +264,7 @@ func testAccCheckHoursOfOperationDestroy(ctx context.Context) resource.TestCheck _, err := tfconnect.FindHoursOfOperationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["hours_of_operation_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/instance.go b/internal/service/connect/instance.go index 36344a51b9e..df0832edb9d 100644 --- a/internal/service/connect/instance.go +++ b/internal/service/connect/instance.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -192,7 +193,7 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta any) instance, err := findInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -384,7 +385,7 @@ func statusInstance(ctx context.Context, conn *connect.Client, id string) sdkret return func() (any, string, error) { output, err := findInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/connect/instance_storage_config.go b/internal/service/connect/instance_storage_config.go index 49127a480d2..cf9e7cbe379 100644 --- a/internal/service/connect/instance_storage_config.go +++ b/internal/service/connect/instance_storage_config.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -219,7 +220,7 @@ func resourceInstanceStorageConfigRead(ctx context.Context, d *schema.ResourceDa storageConfig, err := findInstanceStorageConfigByThreePartKey(ctx, conn, instanceID, associationID, resourceType) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Instance Storage Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/instance_storage_config_test.go b/internal/service/connect/instance_storage_config_test.go index 1439357609c..862a84cccae 100644 --- a/internal/service/connect/instance_storage_config_test.go +++ b/internal/service/connect/instance_storage_config_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -505,7 +505,7 @@ func testAccCheckInstanceStorageConfigDestroy(ctx context.Context) resource.Test _, err := tfconnect.FindInstanceStorageConfigByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes[names.AttrAssociationID], awstypes.InstanceStorageResourceType(rs.Primary.Attributes[names.AttrResourceType])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/instance_test.go b/internal/service/connect/instance_test.go index 011406f390e..30a340370b7 100644 --- a/internal/service/connect/instance_test.go +++ b/internal/service/connect/instance_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -216,7 +216,7 @@ func testAccCheckInstanceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfconnect.FindInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/lambda_function_association.go b/internal/service/connect/lambda_function_association.go index 85cfbbb201b..cf2a5260334 100644 --- a/internal/service/connect/lambda_function_association.go +++ b/internal/service/connect/lambda_function_association.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -91,7 +92,7 @@ func resourceLambdaFunctionAssociationRead(ctx context.Context, d *schema.Resour instanceID, functionARN := parts[0], parts[1] _, err = findLambdaFunctionAssociationByTwoPartKey(ctx, conn, instanceID, functionARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Lambda Function Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/lambda_function_association_test.go b/internal/service/connect/lambda_function_association_test.go index 09acc392b2c..20b81bf4886 100644 --- a/internal/service/connect/lambda_function_association_test.go +++ b/internal/service/connect/lambda_function_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -82,7 +82,7 @@ func testAccCheckLambdaFunctionAssociationDestroy(ctx context.Context) resource. _, err := tfconnect.FindLambdaFunctionAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes[names.AttrFunctionARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/phone_number.go b/internal/service/connect/phone_number.go index 1ff895a5afd..25bb67b1bce 100644 --- a/internal/service/connect/phone_number.go +++ b/internal/service/connect/phone_number.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -178,7 +179,7 @@ func resourcePhoneNumberRead(ctx context.Context, d *schema.ResourceData, meta a phoneNumberSummary, err := findPhoneNumberByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Phone Number (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -310,7 +311,7 @@ func statusPhoneNumber(ctx context.Context, conn *connect.Client, id string) sdk return func() (any, string, error) { output, err := findPhoneNumberByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/connect/phone_number_contact_flow_association.go b/internal/service/connect/phone_number_contact_flow_association.go index e04088a6437..fef185c6232 100644 --- a/internal/service/connect/phone_number_contact_flow_association.go +++ b/internal/service/connect/phone_number_contact_flow_association.go @@ -22,6 +22,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -103,7 +104,7 @@ func (r *phoneNumberContactFlowAssociationResource) Read(ctx context.Context, re phoneNumberID, instanceID, contactFlowID := fwflex.StringValueFromFramework(ctx, data.PhoneNumberID), fwflex.StringValueFromFramework(ctx, data.InstanceID), fwflex.StringValueFromFramework(ctx, data.ContactFlowID) _, err := findPhoneNumberContactFlowAssociationByThreePartKey(ctx, conn, phoneNumberID, instanceID, contactFlowID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/connect/phone_number_contact_flow_association_test.go b/internal/service/connect/phone_number_contact_flow_association_test.go index 025958f1118..942fe2c45d9 100644 --- a/internal/service/connect/phone_number_contact_flow_association_test.go +++ b/internal/service/connect/phone_number_contact_flow_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +89,7 @@ func testAccCheckPhoneNumberContactFlowAssociationDestroy(ctx context.Context) r _, err := tfconnect.FindPhoneNumberContactFlowAssociationByThreePartKey(ctx, conn, rs.Primary.Attributes["phone_number_id"], rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["contact_flow_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/phone_number_test.go b/internal/service/connect/phone_number_test.go index acf917b965c..c62215b0bee 100644 --- a/internal/service/connect/phone_number_test.go +++ b/internal/service/connect/phone_number_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -253,7 +253,7 @@ func testAccCheckPhoneNumberDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfconnect.FindPhoneNumberByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/queue.go b/internal/service/connect/queue.go index c58a4e0ac89..d40778147fa 100644 --- a/internal/service/connect/queue.go +++ b/internal/service/connect/queue.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -172,7 +173,7 @@ func resourceQueueRead(ctx context.Context, d *schema.ResourceData, meta any) di queue, err := findQueueByTwoPartKey(ctx, conn, instanceID, queueID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Queue (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/queue_test.go b/internal/service/connect/queue_test.go index 92bbda7ea25..a5d825a3fdc 100644 --- a/internal/service/connect/queue_test.go +++ b/internal/service/connect/queue_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -525,7 +525,7 @@ func testAccCheckQueueDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfconnect.FindQueueByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["queue_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/quick_connect.go b/internal/service/connect/quick_connect.go index 7fbf8d39b99..4346cc1816f 100644 --- a/internal/service/connect/quick_connect.go +++ b/internal/service/connect/quick_connect.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -183,7 +184,7 @@ func resourceQuickConnectRead(ctx context.Context, d *schema.ResourceData, meta quickConnect, err := findQuickConnectByTwoPartKey(ctx, conn, instanceID, quickConnectID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Quick Connect (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/quick_connect_test.go b/internal/service/connect/quick_connect_test.go index a71f4791f4c..42cfc354f0b 100644 --- a/internal/service/connect/quick_connect_test.go +++ b/internal/service/connect/quick_connect_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func testAccCheckQuickConnectDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfconnect.FindQuickConnectByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["quick_connect_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/routing_profile.go b/internal/service/connect/routing_profile.go index 05d7dc2cf6a..c210ede3502 100644 --- a/internal/service/connect/routing_profile.go +++ b/internal/service/connect/routing_profile.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -201,7 +202,7 @@ func resourceRoutingProfileRead(ctx context.Context, d *schema.ResourceData, met output, err := findRoutingProfileByTwoPartKey(ctx, conn, instanceID, routingProfileID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Routing Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/routing_profile_test.go b/internal/service/connect/routing_profile_test.go index cb20b539e61..00434461144 100644 --- a/internal/service/connect/routing_profile_test.go +++ b/internal/service/connect/routing_profile_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -761,7 +761,7 @@ func testAccCheckRoutingProfileDestroy(ctx context.Context) resource.TestCheckFu _, err := tfconnect.FindRoutingProfileByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["routing_profile_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/security_profile.go b/internal/service/connect/security_profile.go index 9d9fc9f500f..1149d001b68 100644 --- a/internal/service/connect/security_profile.go +++ b/internal/service/connect/security_profile.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -124,7 +125,7 @@ func resourceSecurityProfileRead(ctx context.Context, d *schema.ResourceData, me securityProfile, err := findSecurityProfileByTwoPartKey(ctx, conn, instanceID, securityProfileID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Security Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/security_profile_test.go b/internal/service/connect/security_profile_test.go index 5865b6ec28d..21d8d81cc80 100644 --- a/internal/service/connect/security_profile_test.go +++ b/internal/service/connect/security_profile_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -227,7 +227,7 @@ func testAccCheckSecurityProfileDestroy(ctx context.Context) resource.TestCheckF _, err := tfconnect.FindSecurityProfileByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["security_profile_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/user.go b/internal/service/connect/user.go index b41c717bc59..b7e5ebd306a 100644 --- a/internal/service/connect/user.go +++ b/internal/service/connect/user.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -209,7 +210,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia user, err := findUserByTwoPartKey(ctx, conn, instanceID, userID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect User (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/user_hierarchy_group.go b/internal/service/connect/user_hierarchy_group.go index c6724e2ed57..19c4087d7da 100644 --- a/internal/service/connect/user_hierarchy_group.go +++ b/internal/service/connect/user_hierarchy_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -149,7 +150,7 @@ func resourceUserHierarchyGroupRead(ctx context.Context, d *schema.ResourceData, hierarchyGroup, err := findUserHierarchyGroupByTwoPartKey(ctx, conn, instanceID, userHierarchyGroupID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect User Hierarchy Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/user_hierarchy_group_test.go b/internal/service/connect/user_hierarchy_group_test.go index 4f207e3dc62..4fa894ecc6f 100644 --- a/internal/service/connect/user_hierarchy_group_test.go +++ b/internal/service/connect/user_hierarchy_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -222,7 +222,7 @@ func testAccCheckUserHierarchyGroupDestroy(ctx context.Context) resource.TestChe _, err := tfconnect.FindUserHierarchyGroupByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["hierarchy_group_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/user_hierarchy_structure.go b/internal/service/connect/user_hierarchy_structure.go index 6fe3a4b5d6a..91535331500 100644 --- a/internal/service/connect/user_hierarchy_structure.go +++ b/internal/service/connect/user_hierarchy_structure.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +114,7 @@ func resourceUserHierarchyStructureRead(ctx context.Context, d *schema.ResourceD hierarchyStructure, err := findUserHierarchyStructureByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect User Hierarchy Structure (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/connect/user_hierarchy_structure_test.go b/internal/service/connect/user_hierarchy_structure_test.go index 648665c8eba..4ad96ccdb3d 100644 --- a/internal/service/connect/user_hierarchy_structure_test.go +++ b/internal/service/connect/user_hierarchy_structure_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckUserHierarchyStructureDestroy(ctx context.Context) resource.Tes _, err := tfconnect.FindUserHierarchyStructureByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/user_test.go b/internal/service/connect/user_test.go index 2f7196dc307..86512a2df58 100644 --- a/internal/service/connect/user_test.go +++ b/internal/service/connect/user_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -448,7 +448,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfconnect.FindUserByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["user_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/connect/vocabulary.go b/internal/service/connect/vocabulary.go index f6bba6d6dd8..a434b54b771 100644 --- a/internal/service/connect/vocabulary.go +++ b/internal/service/connect/vocabulary.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -146,7 +147,7 @@ func resourceVocabularyRead(ctx context.Context, d *schema.ResourceData, meta an vocabulary, err := findVocabularyByTwoPartKey(ctx, conn, instanceID, vocabularyID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Connect Vocabulary (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -260,7 +261,7 @@ func statusVocabulary(ctx context.Context, conn *connect.Client, instanceID, voc return func() (any, string, error) { output, err := findVocabularyByTwoPartKey(ctx, conn, instanceID, vocabularyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/connect/vocabulary_test.go b/internal/service/connect/vocabulary_test.go index 4004a2e74d7..e26a9161a3c 100644 --- a/internal/service/connect/vocabulary_test.go +++ b/internal/service/connect/vocabulary_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +184,7 @@ func testAccCheckVocabularyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfconnect.FindVocabularyByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes["vocabulary_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 2b0d1dbacf1b5e7677180ee9e71a32f0cc5b34d2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:52 -0800 Subject: [PATCH 060/227] `controltower` --- internal/service/controltower/control.go | 5 +++-- internal/service/controltower/control_test.go | 4 ++-- internal/service/controltower/controls_data_source_test.go | 4 ++-- internal/service/controltower/landing_zone.go | 5 +++-- internal/service/controltower/landing_zone_test.go | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/internal/service/controltower/control.go b/internal/service/controltower/control.go index dcd1b1ee55d..f6c7ca1054e 100644 --- a/internal/service/controltower/control.go +++ b/internal/service/controltower/control.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -169,7 +170,7 @@ func resourceControlRead(ctx context.Context, d *schema.ResourceData, meta any) output, err = findEnabledControlByARN(ctx, conn, aws.ToString(out.Arn)) } - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ControlTower Control %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -423,7 +424,7 @@ func statusControlOperation(ctx context.Context, conn *controltower.Client, id s return func() (any, string, error) { output, err := findControlOperationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/controltower/control_test.go b/internal/service/controltower/control_test.go index cc0bc14d10b..40fad291917 100644 --- a/internal/service/controltower/control_test.go +++ b/internal/service/controltower/control_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcontroltower "github.com/hashicorp/terraform-provider-aws/internal/service/controltower" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckControlDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcontroltower.FindEnabledControlByTwoPartKey(ctx, conn, rs.Primary.Attributes["target_identifier"], rs.Primary.Attributes["control_identifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/controltower/controls_data_source_test.go b/internal/service/controltower/controls_data_source_test.go index 08bc87f089a..45fb5083538 100644 --- a/internal/service/controltower/controls_data_source_test.go +++ b/internal/service/controltower/controls_data_source_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -45,7 +45,7 @@ func testAccPreCheck(ctx context.Context, t *testing.T) { conn := acctest.Provider.Meta().(*conns.AWSClient).CloudTrailClient(ctx) _, err := tfcloudtrail.FindTrailInfoByName(ctx, conn, "aws-controltower-BaselineCloudTrail") - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip("skipping since Control Tower not found") } diff --git a/internal/service/controltower/landing_zone.go b/internal/service/controltower/landing_zone.go index 91e737eaeff..a4357b36ee3 100644 --- a/internal/service/controltower/landing_zone.go +++ b/internal/service/controltower/landing_zone.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -133,7 +134,7 @@ func resourceLandingZoneRead(ctx context.Context, d *schema.ResourceData, meta a landingZone, err := findLandingZoneByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ControlTower Landing Zone (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -283,7 +284,7 @@ func statusLandingZoneOperation(ctx context.Context, conn *controltower.Client, return func() (any, string, error) { output, err := findLandingZoneOperationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/controltower/landing_zone_test.go b/internal/service/controltower/landing_zone_test.go index 53094da84ee..865230cde60 100644 --- a/internal/service/controltower/landing_zone_test.go +++ b/internal/service/controltower/landing_zone_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcontroltower "github.com/hashicorp/terraform-provider-aws/internal/service/controltower" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -175,7 +175,7 @@ func testAccCheckLandingZoneDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfcontroltower.FindLandingZoneByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5ea55c0731e13a04baa5ab6ed99de72f08d90c8b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:53 -0800 Subject: [PATCH 061/227] `cur` --- internal/service/cur/report_definition.go | 3 ++- internal/service/cur/report_definition_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/service/cur/report_definition.go b/internal/service/cur/report_definition.go index cdf4e26ea48..0a05e8d173e 100644 --- a/internal/service/cur/report_definition.go +++ b/internal/service/cur/report_definition.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -177,7 +178,7 @@ func resourceReportDefinitionRead(ctx context.Context, d *schema.ResourceData, m reportDefinition, err := findReportDefinitionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Cost And Usage Report Definition (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/cur/report_definition_test.go b/internal/service/cur/report_definition_test.go index 5850f912be7..cf8976ce516 100644 --- a/internal/service/cur/report_definition_test.go +++ b/internal/service/cur/report_definition_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcur "github.com/hashicorp/terraform-provider-aws/internal/service/cur" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -440,7 +440,7 @@ func testAccCheckReportDefinitionDestroy(ctx context.Context) resource.TestCheck _, err := tfcur.FindReportDefinitionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 0d2072cc36cfe6f67128242156a46a16b3ac579e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:54 -0800 Subject: [PATCH 062/227] `dataexchange` --- internal/service/dataexchange/data_set.go | 3 ++- internal/service/dataexchange/data_set_test.go | 4 ++-- internal/service/dataexchange/event_action.go | 3 ++- internal/service/dataexchange/revision.go | 4 ++-- internal/service/dataexchange/revision_assets.go | 5 +++-- internal/service/dataexchange/revision_assets_test.go | 4 ++-- internal/service/dataexchange/revision_test.go | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/internal/service/dataexchange/data_set.go b/internal/service/dataexchange/data_set.go index 060947259a3..f2703bf35d1 100644 --- a/internal/service/dataexchange/data_set.go +++ b/internal/service/dataexchange/data_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourceDataSetRead(ctx context.Context, d *schema.ResourceData, meta any) dataSet, err := findDataSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataExchange DataSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/dataexchange/data_set_test.go b/internal/service/dataexchange/data_set_test.go index 1ff3199986c..263ed803b53 100644 --- a/internal/service/dataexchange/data_set_test.go +++ b/internal/service/dataexchange/data_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdataexchange "github.com/hashicorp/terraform-provider-aws/internal/service/dataexchange" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func testAccCheckDataSetDestroy(ctx context.Context) resource.TestCheckFunc { // Try to find the resource _, err := tfdataexchange.FindDataSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dataexchange/event_action.go b/internal/service/dataexchange/event_action.go index 55374a6629c..01ebb7bf5cf 100644 --- a/internal/service/dataexchange/event_action.go +++ b/internal/service/dataexchange/event_action.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -206,7 +207,7 @@ func (r *eventActionResource) Read(ctx context.Context, req resource.ReadRequest } out, err := findEventActionByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/dataexchange/revision.go b/internal/service/dataexchange/revision.go index 7713f2e5696..0b3a671da11 100644 --- a/internal/service/dataexchange/revision.go +++ b/internal/service/dataexchange/revision.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func resourceRevisionRead(ctx context.Context, d *schema.ResourceData, meta any) revision, err := findRevisionByID(ctx, conn, dataSetId, revisionId) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataExchange Revision (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/dataexchange/revision_assets.go b/internal/service/dataexchange/revision_assets.go index fb9443a5fb0..30752d2ea6c 100644 --- a/internal/service/dataexchange/revision_assets.go +++ b/internal/service/dataexchange/revision_assets.go @@ -42,6 +42,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -687,7 +688,7 @@ func (r *revisionAssetsResource) Read(ctx context.Context, req resource.ReadRequ } out, err := findRevisionByID(ctx, conn, state.DataSetID.ValueString(), state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -997,7 +998,7 @@ func statusJob(ctx context.Context, conn *dataexchange.Client, jobID string) sdk return func() (any, string, error) { output, err := findJobByID(ctx, conn, jobID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dataexchange/revision_assets_test.go b/internal/service/dataexchange/revision_assets_test.go index b9e238f9dfe..c81c1be89a4 100644 --- a/internal/service/dataexchange/revision_assets_test.go +++ b/internal/service/dataexchange/revision_assets_test.go @@ -22,8 +22,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdataexchange "github.com/hashicorp/terraform-provider-aws/internal/service/dataexchange" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -506,7 +506,7 @@ func testAccCheckRevisionAssetsDestroy(ctx context.Context) resource.TestCheckFu } _, err := tfdataexchange.FindRevisionByID(ctx, conn, rs.Primary.Attributes["data_set_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/dataexchange/revision_test.go b/internal/service/dataexchange/revision_test.go index 1ad139d8347..f3121a62987 100644 --- a/internal/service/dataexchange/revision_test.go +++ b/internal/service/dataexchange/revision_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdataexchange "github.com/hashicorp/terraform-provider-aws/internal/service/dataexchange" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +199,7 @@ func testAccCheckRevisionDestroy(ctx context.Context) resource.TestCheckFunc { // Try to find the resource _, err = tfdataexchange.FindRevisionByID(ctx, conn, dataSetId, revisionId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8b050ab8425e2a7edfaebdbab809e96863f4c49c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:54 -0800 Subject: [PATCH 063/227] `datasync` --- internal/service/datasync/agent.go | 3 ++- internal/service/datasync/agent_test.go | 4 ++-- internal/service/datasync/location_azure_blob.go | 3 ++- internal/service/datasync/location_azure_blob_test.go | 4 ++-- internal/service/datasync/location_efs.go | 3 ++- internal/service/datasync/location_efs_test.go | 4 ++-- internal/service/datasync/location_fsx_lustre_file_system.go | 3 ++- .../service/datasync/location_fsx_lustre_file_system_test.go | 4 ++-- internal/service/datasync/location_fsx_ontap_file_system.go | 3 ++- .../service/datasync/location_fsx_ontap_file_system_test.go | 4 ++-- .../service/datasync/location_fsx_openzfs_file_system.go | 3 ++- .../datasync/location_fsx_openzfs_file_system_test.go | 4 ++-- .../service/datasync/location_fsx_windows_file_system.go | 3 ++- .../datasync/location_fsx_windows_file_system_test.go | 4 ++-- internal/service/datasync/location_hdfs.go | 3 ++- internal/service/datasync/location_hdfs_test.go | 4 ++-- internal/service/datasync/location_nfs.go | 3 ++- internal/service/datasync/location_nfs_test.go | 4 ++-- internal/service/datasync/location_object_storage.go | 3 ++- internal/service/datasync/location_object_storage_test.go | 4 ++-- internal/service/datasync/location_s3.go | 3 ++- internal/service/datasync/location_s3_test.go | 4 ++-- internal/service/datasync/location_smb.go | 3 ++- internal/service/datasync/location_smb_test.go | 4 ++-- internal/service/datasync/task.go | 5 +++-- internal/service/datasync/task_test.go | 4 ++-- 26 files changed, 53 insertions(+), 40 deletions(-) diff --git a/internal/service/datasync/agent.go b/internal/service/datasync/agent.go index 524eaa34b46..9b383b9d0cd 100644 --- a/internal/service/datasync/agent.go +++ b/internal/service/datasync/agent.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -221,7 +222,7 @@ func resourceAgentRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findAgentByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Agent (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/agent_test.go b/internal/service/datasync/agent_test.go index 274fb010049..3c0d6cd9df4 100644 --- a/internal/service/datasync/agent_test.go +++ b/internal/service/datasync/agent_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -214,7 +214,7 @@ func testAccCheckAgentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdatasync.FindAgentByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_azure_blob.go b/internal/service/datasync/location_azure_blob.go index b1f63c1cd62..5c33aac1f4c 100644 --- a/internal/service/datasync/location_azure_blob.go +++ b/internal/service/datasync/location_azure_blob.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -158,7 +159,7 @@ func resourceLocationAzureBlobRead(ctx context.Context, d *schema.ResourceData, output, err := findLocationAzureBlobByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location Microsoft Azure Blob Storage (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_azure_blob_test.go b/internal/service/datasync/location_azure_blob_test.go index 23f16cfa7a6..d0ed1ae6c21 100644 --- a/internal/service/datasync/location_azure_blob_test.go +++ b/internal/service/datasync/location_azure_blob_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -191,7 +191,7 @@ func testAccCheckLocationAzureBlobDestroy(ctx context.Context) resource.TestChec _, err := tfdatasync.FindLocationAzureBlobByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_efs.go b/internal/service/datasync/location_efs.go index 45a0a9dba7f..55e7822af55 100644 --- a/internal/service/datasync/location_efs.go +++ b/internal/service/datasync/location_efs.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -160,7 +161,7 @@ func resourceLocationEFSRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findLocationEFSByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location EFS (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_efs_test.go b/internal/service/datasync/location_efs_test.go index 4a5fa8cb3cc..7b1942ed037 100644 --- a/internal/service/datasync/location_efs_test.go +++ b/internal/service/datasync/location_efs_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckLocationEFSDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdatasync.FindLocationEFSByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_fsx_lustre_file_system.go b/internal/service/datasync/location_fsx_lustre_file_system.go index 058bf5bc0a4..c28fb3cc440 100644 --- a/internal/service/datasync/location_fsx_lustre_file_system.go +++ b/internal/service/datasync/location_fsx_lustre_file_system.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -135,7 +136,7 @@ func resourceLocationFSxLustreFileSystemRead(ctx context.Context, d *schema.Reso output, err := findLocationFSxLustreByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location FSx for Lustre File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_fsx_lustre_file_system_test.go b/internal/service/datasync/location_fsx_lustre_file_system_test.go index 62eb4eaaddc..7017288a65c 100644 --- a/internal/service/datasync/location_fsx_lustre_file_system_test.go +++ b/internal/service/datasync/location_fsx_lustre_file_system_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -182,7 +182,7 @@ func testAccCheckLocationFSxforLustreFileSystemDestroy(ctx context.Context) reso _, err := tfdatasync.FindLocationFSxLustreByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_fsx_ontap_file_system.go b/internal/service/datasync/location_fsx_ontap_file_system.go index b51a28aa3b9..d46ac65c9d6 100644 --- a/internal/service/datasync/location_fsx_ontap_file_system.go +++ b/internal/service/datasync/location_fsx_ontap_file_system.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -230,7 +231,7 @@ func resourceLocationFSxONTAPFileSystemRead(ctx context.Context, d *schema.Resou output, err := findLocationFSxONTAPByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location FSx for NetApp ONTAP File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_fsx_ontap_file_system_test.go b/internal/service/datasync/location_fsx_ontap_file_system_test.go index 967a1fd6fa6..5120b933db4 100644 --- a/internal/service/datasync/location_fsx_ontap_file_system_test.go +++ b/internal/service/datasync/location_fsx_ontap_file_system_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -233,7 +233,7 @@ func testAccCheckLocationFSxforNetAppONTAPFileSystemDestroy(ctx context.Context) _, err := tfdatasync.FindLocationFSxONTAPByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_fsx_openzfs_file_system.go b/internal/service/datasync/location_fsx_openzfs_file_system.go index 4509e7a4518..3179b86fa98 100644 --- a/internal/service/datasync/location_fsx_openzfs_file_system.go +++ b/internal/service/datasync/location_fsx_openzfs_file_system.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -173,7 +174,7 @@ func resourceLocationFSxOpenZFSFileSystemRead(ctx context.Context, d *schema.Res output, err := findLocationFSxOpenZFSByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location FSx for OpenZFS File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_fsx_openzfs_file_system_test.go b/internal/service/datasync/location_fsx_openzfs_file_system_test.go index 9a34184cce5..773fe67c34f 100644 --- a/internal/service/datasync/location_fsx_openzfs_file_system_test.go +++ b/internal/service/datasync/location_fsx_openzfs_file_system_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -182,7 +182,7 @@ func testAccCheckLocationFSxforOpenZFSFileSystemDestroy(ctx context.Context) res _, err := tfdatasync.FindLocationFSxOpenZFSByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_fsx_windows_file_system.go b/internal/service/datasync/location_fsx_windows_file_system.go index 8a02f0094d0..df63e4c13d1 100644 --- a/internal/service/datasync/location_fsx_windows_file_system.go +++ b/internal/service/datasync/location_fsx_windows_file_system.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -161,7 +162,7 @@ func resourceLocationFSxWindowsFileSystemRead(ctx context.Context, d *schema.Res output, err := findLocationFSxWindowsByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location FSx for Windows File Server File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_fsx_windows_file_system_test.go b/internal/service/datasync/location_fsx_windows_file_system_test.go index cdc9b1d5535..251ea6d85eb 100644 --- a/internal/service/datasync/location_fsx_windows_file_system_test.go +++ b/internal/service/datasync/location_fsx_windows_file_system_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -189,7 +189,7 @@ func testAccCheckLocationFSxforWindowsFileServerFileSystemDestroy(ctx context.Co _, err := tfdatasync.FindLocationFSxWindowsByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_hdfs.go b/internal/service/datasync/location_hdfs.go index df4e07f4b2b..655d255a9be 100644 --- a/internal/service/datasync/location_hdfs.go +++ b/internal/service/datasync/location_hdfs.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -251,7 +252,7 @@ func resourceLocationHDFSRead(ctx context.Context, d *schema.ResourceData, meta output, err := findLocationHDFSByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location HDFS (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_hdfs_test.go b/internal/service/datasync/location_hdfs_test.go index 0bbae7c75f1..e58b87ce833 100644 --- a/internal/service/datasync/location_hdfs_test.go +++ b/internal/service/datasync/location_hdfs_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +199,7 @@ func testAccCheckLocationHDFSDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdatasync.FindLocationHDFSByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_nfs.go b/internal/service/datasync/location_nfs.go index 5e60dfdc5de..8715d45668f 100644 --- a/internal/service/datasync/location_nfs.go +++ b/internal/service/datasync/location_nfs.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -142,7 +143,7 @@ func resourceLocationNFSRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findLocationNFSByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location NFS (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_nfs_test.go b/internal/service/datasync/location_nfs_test.go index e0675c481a7..c1737f1b2bf 100644 --- a/internal/service/datasync/location_nfs_test.go +++ b/internal/service/datasync/location_nfs_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -236,7 +236,7 @@ func testAccCheckLocationNFSDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdatasync.FindLocationNFSByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_object_storage.go b/internal/service/datasync/location_object_storage.go index dc276140f2d..595b66c5a8e 100644 --- a/internal/service/datasync/location_object_storage.go +++ b/internal/service/datasync/location_object_storage.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -167,7 +168,7 @@ func resourceLocationObjectStorageRead(ctx context.Context, d *schema.ResourceDa output, err := findLocationObjectStorageByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location Object Storage (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_object_storage_test.go b/internal/service/datasync/location_object_storage_test.go index c4753a51df0..3e529529e79 100644 --- a/internal/service/datasync/location_object_storage_test.go +++ b/internal/service/datasync/location_object_storage_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -355,7 +355,7 @@ func testAccCheckLocationObjectStorageDestroy(ctx context.Context) resource.Test _, err := tfdatasync.FindLocationObjectStorageByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_s3.go b/internal/service/datasync/location_s3.go index 0bdc397e913..84db114d026 100644 --- a/internal/service/datasync/location_s3.go +++ b/internal/service/datasync/location_s3.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -161,7 +162,7 @@ func resourceLocationS3Read(ctx context.Context, d *schema.ResourceData, meta an output, err := findLocationS3ByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location S3 (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_s3_test.go b/internal/service/datasync/location_s3_test.go index 92921db00e1..f31159fb223 100644 --- a/internal/service/datasync/location_s3_test.go +++ b/internal/service/datasync/location_s3_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -175,7 +175,7 @@ func testAccCheckLocationS3Destroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdatasync.FindLocationS3ByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/location_smb.go b/internal/service/datasync/location_smb.go index 53315f05987..575c5bc5283 100644 --- a/internal/service/datasync/location_smb.go +++ b/internal/service/datasync/location_smb.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -152,7 +153,7 @@ func resourceLocationSMBRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findLocationSMBByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Location SMB (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/datasync/location_smb_test.go b/internal/service/datasync/location_smb_test.go index a61a192f24d..d31efa0b806 100644 --- a/internal/service/datasync/location_smb_test.go +++ b/internal/service/datasync/location_smb_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func testAccCheckLocationSMBDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdatasync.FindLocationSMBByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datasync/task.go b/internal/service/datasync/task.go index a181007d1cf..0b842c2a08d 100644 --- a/internal/service/datasync/task.go +++ b/internal/service/datasync/task.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -373,7 +374,7 @@ func resourceTaskRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findTaskByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DataSync Task (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -503,7 +504,7 @@ func statusTask(ctx context.Context, conn *datasync.Client, arn string) sdkretry return func() (any, string, error) { output, err := findTaskByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/datasync/task_test.go b/internal/service/datasync/task_test.go index c7cd82c63ab..8db065de750 100644 --- a/internal/service/datasync/task_test.go +++ b/internal/service/datasync/task_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -958,7 +958,7 @@ func testAccCheckTaskDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdatasync.FindTaskByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From f11a7af420a2f63e5d651cf80ecab96c8d26b23b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:55 -0800 Subject: [PATCH 064/227] `datazone` --- internal/service/datazone/asset_type.go | 3 ++- internal/service/datazone/domain.go | 5 +++-- internal/service/datazone/domain_test.go | 4 ++-- internal/service/datazone/environment.go | 5 +++-- .../service/datazone/environment_blueprint_configuration.go | 3 ++- .../datazone/environment_blueprint_configuration_test.go | 4 ++-- internal/service/datazone/environment_profile.go | 3 ++- internal/service/datazone/environment_test.go | 4 ++-- internal/service/datazone/form_type.go | 3 ++- internal/service/datazone/form_type_test.go | 4 ++-- internal/service/datazone/glossary.go | 3 ++- internal/service/datazone/glossary_term.go | 3 ++- internal/service/datazone/project.go | 5 +++-- internal/service/datazone/user_profile.go | 3 ++- 14 files changed, 31 insertions(+), 21 deletions(-) diff --git a/internal/service/datazone/asset_type.go b/internal/service/datazone/asset_type.go index 2a0a8d24f89..a94ec4610de 100644 --- a/internal/service/datazone/asset_type.go +++ b/internal/service/datazone/asset_type.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -193,7 +194,7 @@ func (r *assetTypeResource) Read(ctx context.Context, req resource.ReadRequest, return } out, err := findAssetTypeByID(ctx, conn, state.DomainIdentifier.ValueString(), state.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/datazone/domain.go b/internal/service/datazone/domain.go index 89a4b96f075..3ccd7981905 100644 --- a/internal/service/datazone/domain.go +++ b/internal/service/datazone/domain.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -201,7 +202,7 @@ func (r *domainResource) Read(ctx context.Context, request resource.ReadRequest, output, err := findDomainByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -329,7 +330,7 @@ func statusDomain(ctx context.Context, conn *datazone.Client, id string) sdkretr return func() (any, string, error) { output, err := findDomainByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/datazone/domain_test.go b/internal/service/datazone/domain_test.go index 265e336bbe4..8207bd507b9 100644 --- a/internal/service/datazone/domain_test.go +++ b/internal/service/datazone/domain_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatazone "github.com/hashicorp/terraform-provider-aws/internal/service/datazone" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -281,7 +281,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdatazone.FindDomainByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datazone/environment.go b/internal/service/datazone/environment.go index 78c3f78c44a..b4d53a468e6 100644 --- a/internal/service/datazone/environment.go +++ b/internal/service/datazone/environment.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -240,7 +241,7 @@ func (r *environmentResource) Read(ctx context.Context, req resource.ReadRequest } out, err := findEnvironmentByID(ctx, conn, state.DomainIdentifier.ValueString(), state.Id.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -456,7 +457,7 @@ func waitEnvironmentDeleted(ctx context.Context, conn *datazone.Client, domainId func statusEnvironment(ctx context.Context, conn *datazone.Client, domainId, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findEnvironmentByID(ctx, conn, domainId, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/datazone/environment_blueprint_configuration.go b/internal/service/datazone/environment_blueprint_configuration.go index 024b95cd596..71778f998e5 100644 --- a/internal/service/datazone/environment_blueprint_configuration.go +++ b/internal/service/datazone/environment_blueprint_configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -110,7 +111,7 @@ func (r *environmentBlueprintConfigurationResource) Read(ctx context.Context, re domainID, environmentBlueprintID := fwflex.StringValueFromFramework(ctx, data.DomainIdentifier), fwflex.StringValueFromFramework(ctx, data.EnvironmentBlueprintIdentifier) output, err := findEnvironmentBlueprintConfigurationByTwoPartKey(ctx, conn, domainID, environmentBlueprintID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/datazone/environment_blueprint_configuration_test.go b/internal/service/datazone/environment_blueprint_configuration_test.go index 7263d669bf7..e738f6a1bf1 100644 --- a/internal/service/datazone/environment_blueprint_configuration_test.go +++ b/internal/service/datazone/environment_blueprint_configuration_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatazone "github.com/hashicorp/terraform-provider-aws/internal/service/datazone" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -313,7 +313,7 @@ func testAccCheckEnvironmentBlueprintConfigurationDestroy(ctx context.Context) r _, err := tfdatazone.FindEnvironmentBlueprintConfigurationByTwoPartKey(ctx, conn, rs.Primary.Attributes["domain_id"], rs.Primary.Attributes["environment_blueprint_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datazone/environment_profile.go b/internal/service/datazone/environment_profile.go index da5d7d11b60..46424c319a0 100644 --- a/internal/service/datazone/environment_profile.go +++ b/internal/service/datazone/environment_profile.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +178,7 @@ func (r *environmentProfileResource) Read(ctx context.Context, req resource.Read } out, err := findEnvironmentProfileByID(ctx, conn, state.Id.ValueString(), state.DomainIdentifier.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/datazone/environment_test.go b/internal/service/datazone/environment_test.go index 52e39d31069..cf4fc5a8a49 100644 --- a/internal/service/datazone/environment_test.go +++ b/internal/service/datazone/environment_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatazone "github.com/hashicorp/terraform-provider-aws/internal/service/datazone" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -484,7 +484,7 @@ func testAccCheckEnvironmentDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdatazone.FindEnvironmentByID(ctx, conn, rs.Primary.Attributes["domain_identifier"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datazone/form_type.go b/internal/service/datazone/form_type.go index b05d88d60d6..7f2456d4986 100644 --- a/internal/service/datazone/form_type.go +++ b/internal/service/datazone/form_type.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -217,7 +218,7 @@ func (r *formTypeResource) Read(ctx context.Context, req resource.ReadRequest, r } out, err := findFormTypeByID(ctx, conn, state.DomainIdentifier.ValueString(), state.Name.ValueString(), state.Revision.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/datazone/form_type_test.go b/internal/service/datazone/form_type_test.go index 20bb3c8ff6c..35af0c6512a 100644 --- a/internal/service/datazone/form_type_test.go +++ b/internal/service/datazone/form_type_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdatazone "github.com/hashicorp/terraform-provider-aws/internal/service/datazone" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +114,7 @@ func testAccCheckFormTypeDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfdatazone.FindFormTypeByID(ctx, conn, rs.Primary.Attributes["domain_identifier"], rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes["revision"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/datazone/glossary.go b/internal/service/datazone/glossary.go index bfc8f5a5cac..3a1a6ce5391 100644 --- a/internal/service/datazone/glossary.go +++ b/internal/service/datazone/glossary.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +132,7 @@ func (r *glossaryResource) Read(ctx context.Context, req resource.ReadRequest, r } out, err := findGlossaryByID(ctx, conn, state.Id.ValueString(), state.DomainIdentifier.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/datazone/glossary_term.go b/internal/service/datazone/glossary_term.go index 541c7697248..20ccf537f59 100644 --- a/internal/service/datazone/glossary_term.go +++ b/internal/service/datazone/glossary_term.go @@ -33,6 +33,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +202,7 @@ func (r *glossaryTermResource) Read(ctx context.Context, req resource.ReadReques } out, err := findGlossaryTermByID(ctx, conn, state.ID.ValueString(), state.DomainIdentifier.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/datazone/project.go b/internal/service/datazone/project.go index 1204084e797..60eca0d7763 100644 --- a/internal/service/datazone/project.go +++ b/internal/service/datazone/project.go @@ -33,6 +33,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -208,7 +209,7 @@ func (r *projectResource) Read(ctx context.Context, req resource.ReadRequest, re } out, err := findProjectByID(ctx, conn, state.DomainIdentifier.ValueString(), state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -362,7 +363,7 @@ func waitProjectDeleted(ctx context.Context, conn *datazone.Client, domain strin func statusProject(ctx context.Context, conn *datazone.Client, domain string, identifier string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findProjectByID(ctx, conn, domain, identifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/datazone/user_profile.go b/internal/service/datazone/user_profile.go index 2a3978acc41..73d4d550b51 100644 --- a/internal/service/datazone/user_profile.go +++ b/internal/service/datazone/user_profile.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +172,7 @@ func (r *userProfileResource) Read(ctx context.Context, req resource.ReadRequest } out, err := findUserProfileByID(ctx, conn, state.DomainIdentifier.ValueString(), state.UserIdentifier.ValueString(), state.Type.ValueEnum()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } From ce1da8a0137b15421e4bb72c78e6b018dce97976 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:56 -0800 Subject: [PATCH 065/227] `deploy` --- internal/service/deploy/app.go | 3 ++- internal/service/deploy/app_test.go | 4 ++-- internal/service/deploy/deployment_config.go | 3 ++- internal/service/deploy/deployment_config_test.go | 4 ++-- internal/service/deploy/deployment_group.go | 3 ++- internal/service/deploy/deployment_group_test.go | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/internal/service/deploy/app.go b/internal/service/deploy/app.go index c2202419402..f045bdefbcf 100644 --- a/internal/service/deploy/app.go +++ b/internal/service/deploy/app.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -133,7 +134,7 @@ func resourceAppRead(ctx context.Context, d *schema.ResourceData, meta any) diag app, err := findApplicationByName(ctx, conn, application) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeDeploy Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/deploy/app_test.go b/internal/service/deploy/app_test.go index 7bb62327f0e..d60f7c27801 100644 --- a/internal/service/deploy/app_test.go +++ b/internal/service/deploy/app_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodedeploy "github.com/hashicorp/terraform-provider-aws/internal/service/deploy" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -266,7 +266,7 @@ func testAccCheckAppDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcodedeploy.FindApplicationByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/deploy/deployment_config.go b/internal/service/deploy/deployment_config.go index 974e32df17d..95c18f75e63 100644 --- a/internal/service/deploy/deployment_config.go +++ b/internal/service/deploy/deployment_config.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -209,7 +210,7 @@ func resourceDeploymentConfigRead(ctx context.Context, d *schema.ResourceData, m deploymentConfig, err := findDeploymentConfigByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeDeploy Deployment Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/deploy/deployment_config_test.go b/internal/service/deploy/deployment_config_test.go index 17e5868b249..d3d184421fa 100644 --- a/internal/service/deploy/deployment_config_test.go +++ b/internal/service/deploy/deployment_config_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodedeploy "github.com/hashicorp/terraform-provider-aws/internal/service/deploy" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -324,7 +324,7 @@ func testAccCheckDeploymentConfigDestroy(ctx context.Context) resource.TestCheck _, err := tfcodedeploy.FindDeploymentConfigByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/deploy/deployment_group.go b/internal/service/deploy/deployment_group.go index 8734bcb3f8a..bb2571a3aa3 100644 --- a/internal/service/deploy/deployment_group.go +++ b/internal/service/deploy/deployment_group.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -555,7 +556,7 @@ func resourceDeploymentGroupRead(ctx context.Context, d *schema.ResourceData, me group, err := findDeploymentGroupByTwoPartKey(ctx, conn, d.Get("app_name").(string), d.Get("deployment_group_name").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CodeDeploy Deployment Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/deploy/deployment_group_test.go b/internal/service/deploy/deployment_group_test.go index 14900762c92..3771d9ffeb6 100644 --- a/internal/service/deploy/deployment_group_test.go +++ b/internal/service/deploy/deployment_group_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcodedeploy "github.com/hashicorp/terraform-provider-aws/internal/service/deploy" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1694,7 +1694,7 @@ func testAccCheckDeploymentGroupDestroy(ctx context.Context) resource.TestCheckF _, err := tfcodedeploy.FindDeploymentGroupByTwoPartKey(ctx, conn, rs.Primary.Attributes["app_name"], rs.Primary.Attributes["deployment_group_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 069692fa8e1aa4159448f88e8354b829ed11b60e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:57 -0800 Subject: [PATCH 066/227] `detective` --- internal/service/detective/graph.go | 3 ++- internal/service/detective/graph_test.go | 4 ++-- internal/service/detective/invitation_accepter.go | 3 ++- internal/service/detective/invitation_accepter_test.go | 4 ++-- internal/service/detective/member.go | 5 +++-- internal/service/detective/member_test.go | 4 ++-- internal/service/detective/organization_admin_account.go | 3 ++- .../service/detective/organization_admin_account_test.go | 4 ++-- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/internal/service/detective/graph.go b/internal/service/detective/graph.go index 33cfb29343e..ec623cc4c1e 100644 --- a/internal/service/detective/graph.go +++ b/internal/service/detective/graph.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -82,7 +83,7 @@ func resourceGraphRead(ctx context.Context, d *schema.ResourceData, meta any) di graph, err := FindGraphByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Detective Graph (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/detective/graph_test.go b/internal/service/detective/graph_test.go index 0e8c3b01d23..f35e29c78c3 100644 --- a/internal/service/detective/graph_test.go +++ b/internal/service/detective/graph_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +128,7 @@ func testAccCheckGraphDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdetective.FindGraphByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/detective/invitation_accepter.go b/internal/service/detective/invitation_accepter.go index 1e2ff2522f9..b4b97bf7333 100644 --- a/internal/service/detective/invitation_accepter.go +++ b/internal/service/detective/invitation_accepter.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -70,7 +71,7 @@ func resourceInvitationAccepterRead(ctx context.Context, d *schema.ResourceData, member, err := FindInvitationByGraphARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Detective Invitation Accepter (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/detective/invitation_accepter_test.go b/internal/service/detective/invitation_accepter_test.go index 6084b063443..e217ebe8f7b 100644 --- a/internal/service/detective/invitation_accepter_test.go +++ b/internal/service/detective/invitation_accepter_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -72,7 +72,7 @@ func testAccCheckInvitationAccepterDestroy(ctx context.Context) resource.TestChe _, err := tfdetective.FindInvitationByGraphARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/detective/member.go b/internal/service/detective/member.go index c33dc289be9..429171c7c8e 100644 --- a/internal/service/detective/member.go +++ b/internal/service/detective/member.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -146,7 +147,7 @@ func resourceMemberRead(ctx context.Context, d *schema.ResourceData, meta any) d member, err := FindMemberByGraphByTwoPartKey(ctx, conn, graphARN, accountID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Detective Member (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -269,7 +270,7 @@ func statusMember(ctx context.Context, conn *detective.Client, graphARN, adminAc return func() (any, string, error) { output, err := FindMemberByGraphByTwoPartKey(ctx, conn, graphARN, adminAccountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/detective/member_test.go b/internal/service/detective/member_test.go index ba10e9ecae0..c32358b20ca 100644 --- a/internal/service/detective/member_test.go +++ b/internal/service/detective/member_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -246,7 +246,7 @@ func testAccCheckMemberDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfdetective.FindMemberByGraphByTwoPartKey(ctx, conn, graphARN, accountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/detective/organization_admin_account.go b/internal/service/detective/organization_admin_account.go index 1ff4a110814..a3d67b23071 100644 --- a/internal/service/detective/organization_admin_account.go +++ b/internal/service/detective/organization_admin_account.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -81,7 +82,7 @@ func resourceOrganizationAdminAccountRead(ctx context.Context, d *schema.Resourc administrator, err := findOrganizationAdminAccountByAccountID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Detective Organization Admin Account (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/detective/organization_admin_account_test.go b/internal/service/detective/organization_admin_account_test.go index c45d9dc2cdc..cc798a580de 100644 --- a/internal/service/detective/organization_admin_account_test.go +++ b/internal/service/detective/organization_admin_account_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckOrganizationAdminAccountDestroy(ctx context.Context) resource.T _, err := tfdetective.FindOrganizationAdminAccountByAccountID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 299575af276249609443c40ff905cf0180fc9dc7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:58 -0800 Subject: [PATCH 067/227] `devicefarm` --- internal/service/devicefarm/device_pool.go | 3 ++- internal/service/devicefarm/device_pool_test.go | 4 ++-- internal/service/devicefarm/instance_profile.go | 3 ++- internal/service/devicefarm/instance_profile_test.go | 4 ++-- internal/service/devicefarm/network_profile.go | 3 ++- internal/service/devicefarm/network_profile_test.go | 4 ++-- internal/service/devicefarm/project.go | 3 ++- internal/service/devicefarm/project_test.go | 4 ++-- internal/service/devicefarm/test_grid_project.go | 3 ++- internal/service/devicefarm/test_grid_project_test.go | 4 ++-- internal/service/devicefarm/upload.go | 3 ++- internal/service/devicefarm/upload_test.go | 4 ++-- 12 files changed, 24 insertions(+), 18 deletions(-) diff --git a/internal/service/devicefarm/device_pool.go b/internal/service/devicefarm/device_pool.go index 0e1732c9edc..54f407c7647 100644 --- a/internal/service/devicefarm/device_pool.go +++ b/internal/service/devicefarm/device_pool.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -137,7 +138,7 @@ func resourceDevicePoolRead(ctx context.Context, d *schema.ResourceData, meta an devicePool, err := findDevicePoolByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DeviceFarm Device Pool (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/devicefarm/device_pool_test.go b/internal/service/devicefarm/device_pool_test.go index 795fa78b58b..58a0d0dbff0 100644 --- a/internal/service/devicefarm/device_pool_test.go +++ b/internal/service/devicefarm/device_pool_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -215,7 +215,7 @@ func testAccCheckDevicePoolDestroy(ctx context.Context) resource.TestCheckFunc { // Try to find the resource _, err := tfdevicefarm.FindDevicePoolByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/devicefarm/instance_profile.go b/internal/service/devicefarm/instance_profile.go index 9ab5bf29b94..b92fc8ad29e 100644 --- a/internal/service/devicefarm/instance_profile.go +++ b/internal/service/devicefarm/instance_profile.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -118,7 +119,7 @@ func resourceInstanceProfileRead(ctx context.Context, d *schema.ResourceData, me instanceProf, err := findInstanceProfileByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DeviceFarm Instance Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/devicefarm/instance_profile_test.go b/internal/service/devicefarm/instance_profile_test.go index 86944a065a7..50796594fa4 100644 --- a/internal/service/devicefarm/instance_profile_test.go +++ b/internal/service/devicefarm/instance_profile_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckInstanceProfileDestroy(ctx context.Context) resource.TestCheckF // Try to find the resource _, err := tfdevicefarm.FindInstanceProfileByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/devicefarm/network_profile.go b/internal/service/devicefarm/network_profile.go index b935ddfcffc..92656460aab 100644 --- a/internal/service/devicefarm/network_profile.go +++ b/internal/service/devicefarm/network_profile.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -183,7 +184,7 @@ func resourceNetworkProfileRead(ctx context.Context, d *schema.ResourceData, met project, err := findNetworkProfileByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DeviceFarm Network Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/devicefarm/network_profile_test.go b/internal/service/devicefarm/network_profile_test.go index b03d4fe0801..c036641bb88 100644 --- a/internal/service/devicefarm/network_profile_test.go +++ b/internal/service/devicefarm/network_profile_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -222,7 +222,7 @@ func testAccCheckNetworkProfileDestroy(ctx context.Context) resource.TestCheckFu // Try to find the resource _, err := tfdevicefarm.FindNetworkProfileByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/devicefarm/project.go b/internal/service/devicefarm/project.go index 0fc847d78bc..ebfe7d65c55 100644 --- a/internal/service/devicefarm/project.go +++ b/internal/service/devicefarm/project.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourceProjectRead(ctx context.Context, d *schema.ResourceData, meta any) project, err := findProjectByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DeviceFarm Project (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/devicefarm/project_test.go b/internal/service/devicefarm/project_test.go index 31408973978..34de4cef4cf 100644 --- a/internal/service/devicefarm/project_test.go +++ b/internal/service/devicefarm/project_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -225,7 +225,7 @@ func testAccCheckProjectDestroy(ctx context.Context) resource.TestCheckFunc { // Try to find the resource _, err := tfdevicefarm.FindProjectByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/devicefarm/test_grid_project.go b/internal/service/devicefarm/test_grid_project.go index 5137693824f..9fb88da59c1 100644 --- a/internal/service/devicefarm/test_grid_project.go +++ b/internal/service/devicefarm/test_grid_project.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func resourceTestGridProjectRead(ctx context.Context, d *schema.ResourceData, me project, err := findTestGridProjectByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DeviceFarm Test Grid Project (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/devicefarm/test_grid_project_test.go b/internal/service/devicefarm/test_grid_project_test.go index a486d9d6388..55ffafff996 100644 --- a/internal/service/devicefarm/test_grid_project_test.go +++ b/internal/service/devicefarm/test_grid_project_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -219,7 +219,7 @@ func testAccCheckTestGridProjectDestroy(ctx context.Context) resource.TestCheckF // Try to find the resource _, err := tfdevicefarm.FindTestGridProjectByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/devicefarm/upload.go b/internal/service/devicefarm/upload.go index 83c9e067c90..f85adaa0a0f 100644 --- a/internal/service/devicefarm/upload.go +++ b/internal/service/devicefarm/upload.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceUploadRead(ctx context.Context, d *schema.ResourceData, meta any) d upload, err := findUploadByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DeviceFarm Upload (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/devicefarm/upload_test.go b/internal/service/devicefarm/upload_test.go index 796866cc7ed..1f47e807a2c 100644 --- a/internal/service/devicefarm/upload_test.go +++ b/internal/service/devicefarm/upload_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckUploadDestroy(ctx context.Context) resource.TestCheckFunc { // Try to find the resource _, err := tfdevicefarm.FindUploadByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a705539dc65060b1c16f8a7d583b13de8def1e9b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:31:59 -0800 Subject: [PATCH 068/227] `devopsguru` --- internal/service/devopsguru/event_sources_config.go | 3 ++- internal/service/devopsguru/notification_channel.go | 4 ++-- internal/service/devopsguru/resource_collection.go | 3 ++- internal/service/devopsguru/resource_collection_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/devopsguru/event_sources_config.go b/internal/service/devopsguru/event_sources_config.go index cc0d7ab1904..2a7a13a78c8 100644 --- a/internal/service/devopsguru/event_sources_config.go +++ b/internal/service/devopsguru/event_sources_config.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -118,7 +119,7 @@ func (r *eventSourcesConfigResource) Read(ctx context.Context, req resource.Read } out, err := findEventSourcesConfig(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/devopsguru/notification_channel.go b/internal/service/devopsguru/notification_channel.go index fd30067d57e..7b6e9e4579f 100644 --- a/internal/service/devopsguru/notification_channel.go +++ b/internal/service/devopsguru/notification_channel.go @@ -26,7 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -156,7 +156,7 @@ func (r *notificationChannelResource) Read(ctx context.Context, req resource.Rea } out, err := findNotificationChannelByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/devopsguru/resource_collection.go b/internal/service/devopsguru/resource_collection.go index 07b6499d1ae..342c13970b4 100644 --- a/internal/service/devopsguru/resource_collection.go +++ b/internal/service/devopsguru/resource_collection.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -165,7 +166,7 @@ func (r *resourceCollectionResource) Read(ctx context.Context, req resource.Read } out, err := findResourceCollectionByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/devopsguru/resource_collection_test.go b/internal/service/devopsguru/resource_collection_test.go index aba224f5f20..cb41b058203 100644 --- a/internal/service/devopsguru/resource_collection_test.go +++ b/internal/service/devopsguru/resource_collection_test.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdevopsguru "github.com/hashicorp/terraform-provider-aws/internal/service/devopsguru" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckResourceCollectionDestroy(ctx context.Context) resource.TestChe } _, err := tfdevopsguru.FindResourceCollectionByID(ctx, conn, rs.Primary.ID) - if errs.IsA[*types.ResourceNotFoundException](err) || tfresource.NotFound(err) { + if errs.IsA[*types.ResourceNotFoundException](err) || retry.NotFound(err) { return nil } if err != nil { From 848a819d220c17706452b320237eaaec3dd72521 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:00 -0800 Subject: [PATCH 069/227] `directconnect` --- internal/service/directconnect/bgp_peer.go | 5 +++-- internal/service/directconnect/bgp_peer_test.go | 4 ++-- internal/service/directconnect/connection.go | 5 +++-- internal/service/directconnect/connection_association.go | 3 ++- .../service/directconnect/connection_association_test.go | 4 ++-- internal/service/directconnect/connection_confirmation.go | 4 ++-- internal/service/directconnect/connection_test.go | 4 ++-- internal/service/directconnect/gateway.go | 5 +++-- internal/service/directconnect/gateway_association.go | 5 +++-- .../service/directconnect/gateway_association_proposal.go | 7 ++++--- .../directconnect/gateway_association_proposal_test.go | 4 ++-- internal/service/directconnect/gateway_association_test.go | 4 ++-- internal/service/directconnect/gateway_test.go | 4 ++-- internal/service/directconnect/hosted_connection.go | 5 +++-- internal/service/directconnect/hosted_connection_test.go | 4 ++-- .../directconnect/hosted_private_virtual_interface.go | 4 ++-- .../hosted_private_virtual_interface_accepter.go | 4 ++-- .../directconnect/hosted_public_virtual_interface.go | 4 ++-- .../hosted_public_virtual_interface_accepter.go | 4 ++-- .../directconnect/hosted_transit_virtual_interface.go | 4 ++-- .../hosted_transit_virtual_interface_accepter.go | 4 ++-- internal/service/directconnect/lag.go | 7 ++++--- internal/service/directconnect/lag_test.go | 4 ++-- internal/service/directconnect/macsec_key_association.go | 3 ++- .../service/directconnect/macsec_key_association_test.go | 4 ++-- .../service/directconnect/private_virtual_interface.go | 4 ++-- internal/service/directconnect/public_virtual_interface.go | 4 ++-- .../service/directconnect/transit_virtual_interface.go | 4 ++-- internal/service/directconnect/vif.go | 3 ++- internal/service/directconnect/vif_test.go | 4 ++-- 30 files changed, 69 insertions(+), 59 deletions(-) diff --git a/internal/service/directconnect/bgp_peer.go b/internal/service/directconnect/bgp_peer.go index 042522a6c89..f4392aca8e9 100644 --- a/internal/service/directconnect/bgp_peer.go +++ b/internal/service/directconnect/bgp_peer.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -135,7 +136,7 @@ func resourceBGPPeerRead(ctx context.Context, d *schema.ResourceData, meta any) asn := int32(d.Get("bgp_asn").(int)) bgpPeer, err := findBGPPeerByThreePartKey(ctx, conn, vifID, addrFamily, asn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect BGP Peer (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -214,7 +215,7 @@ func statusBGPPeer(ctx context.Context, conn *directconnect.Client, vifID string return func() (any, string, error) { output, err := findBGPPeerByThreePartKey(ctx, conn, vifID, addrFamily, asn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/bgp_peer_test.go b/internal/service/directconnect/bgp_peer_test.go index bd765db9025..d7a3eec8b3b 100644 --- a/internal/service/directconnect/bgp_peer_test.go +++ b/internal/service/directconnect/bgp_peer_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +78,7 @@ func testAccCheckBGPPeerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdirectconnect.FindBGPPeerByThreePartKey(ctx, conn, rs.Primary.Attributes["virtual_interface_id"], awstypes.AddressFamily(rs.Primary.Attributes["address_family"]), flex.StringValueToInt32Value(rs.Primary.Attributes["bgp_asn"])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/connection.go b/internal/service/directconnect/connection.go index b37de094a39..2b6c125f8dd 100644 --- a/internal/service/directconnect/connection.go +++ b/internal/service/directconnect/connection.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -267,7 +268,7 @@ func resourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta an connection, err := findConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -421,7 +422,7 @@ func statusConnection(ctx context.Context, conn *directconnect.Client, id string return func() (any, string, error) { output, err := findConnectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/connection_association.go b/internal/service/directconnect/connection_association.go index 8c17606381a..4328a483725 100644 --- a/internal/service/directconnect/connection_association.go +++ b/internal/service/directconnect/connection_association.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -73,7 +74,7 @@ func resourceConnectionAssociationRead(ctx context.Context, d *schema.ResourceDa lagID := d.Get("lag_id").(string) err := findConnectionLAGAssociation(ctx, conn, d.Id(), lagID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Connection (%s) LAG (%s) Association not found, removing from state", d.Id(), lagID) d.SetId("") return diags diff --git a/internal/service/directconnect/connection_association_test.go b/internal/service/directconnect/connection_association_test.go index 69d99859595..b31186a1b1c 100644 --- a/internal/service/directconnect/connection_association_test.go +++ b/internal/service/directconnect/connection_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckConnectionAssociationDestroy(ctx context.Context) resource.Test err := tfdirectconnect.FindConnectionLAGAssociation(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["lag_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/connection_confirmation.go b/internal/service/directconnect/connection_confirmation.go index ab3f0675854..b5528bc4fb6 100644 --- a/internal/service/directconnect/connection_confirmation.go +++ b/internal/service/directconnect/connection_confirmation.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -68,7 +68,7 @@ func resourceConnectionConfirmationRead(ctx context.Context, d *schema.ResourceD _, err := findConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/connection_test.go b/internal/service/directconnect/connection_test.go index 6e2a22cf301..403f747c2f8 100644 --- a/internal/service/directconnect/connection_test.go +++ b/internal/service/directconnect/connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -360,7 +360,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdirectconnect.FindConnectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/gateway.go b/internal/service/directconnect/gateway.go index 3e0a11dd19c..3f31d8c2cc4 100644 --- a/internal/service/directconnect/gateway.go +++ b/internal/service/directconnect/gateway.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -100,7 +101,7 @@ func resourceGatewayRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findGatewayByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -221,7 +222,7 @@ func statusGateway(ctx context.Context, conn *directconnect.Client, id string) s return func() (any, string, error) { output, err := findGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/gateway_association.go b/internal/service/directconnect/gateway_association.go index f1a9a9cd26d..c61b75c525f 100644 --- a/internal/service/directconnect/gateway_association.go +++ b/internal/service/directconnect/gateway_association.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -184,7 +185,7 @@ func resourceGatewayAssociationRead(ctx context.Context, d *schema.ResourceData, associationID := d.Get("dx_gateway_association_id").(string) output, err := findGatewayAssociationByID(ctx, conn, associationID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Gateway Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -398,7 +399,7 @@ func statusGatewayAssociation(ctx context.Context, conn *directconnect.Client, i return func() (any, string, error) { output, err := findGatewayAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/gateway_association_proposal.go b/internal/service/directconnect/gateway_association_proposal.go index b3046a68850..68dbf6e7d28 100644 --- a/internal/service/directconnect/gateway_association_proposal.go +++ b/internal/service/directconnect/gateway_association_proposal.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -45,7 +46,7 @@ func resourceGatewayAssociationProposal() *schema.Resource { output, err := findGatewayAssociationProposalByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Proposal may be end-of-life and removed by AWS. return false } @@ -128,14 +129,14 @@ func resourceGatewayAssociationProposalRead(ctx context.Context, d *schema.Resou // First attempt to find by proposal ID. output, err := findGatewayAssociationProposalByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Attempt to find an existing association. directConnectGatewayID := d.Get("dx_gateway_id").(string) associatedGatewayID := d.Get("associated_gateway_id").(string) output, err := findGatewayAssociationByGatewayIDAndAssociatedGatewayID(ctx, conn, directConnectGatewayID, associatedGatewayID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Gateway Association Proposal (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/gateway_association_proposal_test.go b/internal/service/directconnect/gateway_association_proposal_test.go index dd985d66f5d..a0e83b14563 100644 --- a/internal/service/directconnect/gateway_association_proposal_test.go +++ b/internal/service/directconnect/gateway_association_proposal_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -243,7 +243,7 @@ func testAccCheckGatewayAssociationProposalDestroy(ctx context.Context) resource _, err := tfdirectconnect.FindGatewayAssociationProposalByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/gateway_association_test.go b/internal/service/directconnect/gateway_association_test.go index 3abcf11dc7a..3c05b5a183b 100644 --- a/internal/service/directconnect/gateway_association_test.go +++ b/internal/service/directconnect/gateway_association_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -437,7 +437,7 @@ func testAccCheckGatewayAssociationDestroy(ctx context.Context) resource.TestChe _, err := tfdirectconnect.FindGatewayAssociationByID(ctx, conn, rs.Primary.Attributes["dx_gateway_association_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/gateway_test.go b/internal/service/directconnect/gateway_test.go index 5d00a405175..077847fe915 100644 --- a/internal/service/directconnect/gateway_test.go +++ b/internal/service/directconnect/gateway_test.go @@ -21,8 +21,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -290,7 +290,7 @@ func testAccCheckGatewayDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdirectconnect.FindGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/hosted_connection.go b/internal/service/directconnect/hosted_connection.go index ac74e5f7e72..74faa24b940 100644 --- a/internal/service/directconnect/hosted_connection.go +++ b/internal/service/directconnect/hosted_connection.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -145,7 +146,7 @@ func resourceHostedConnectionRead(ctx context.Context, d *schema.ResourceData, m connection, err := findHostedConnectionByID(ctx, conn, hostedConnectionID, parentConnectionID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Connection (%s) not found, removing from state", hostedConnectionID) d.SetId("") return diags @@ -256,7 +257,7 @@ func statusHostedConnection(ctx context.Context, conn *directconnect.Client, hos return func() (any, string, error) { output, err := findHostedConnectionByID(ctx, conn, hostedConnectionID, parentConnectionID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/hosted_connection_test.go b/internal/service/directconnect/hosted_connection_test.go index 7650e9c4619..b7b720a0f7e 100644 --- a/internal/service/directconnect/hosted_connection_test.go +++ b/internal/service/directconnect/hosted_connection_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -64,7 +64,7 @@ func testAccCheckHostedConnectionDestroy(ctx context.Context, providerFunc func( parentConnectionID := rs.Primary.Attributes[names.AttrConnectionID] _, err := tfdirectconnect.FindHostedConnectionByID(ctx, conn, rs.Primary.ID, parentConnectionID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/hosted_private_virtual_interface.go b/internal/service/directconnect/hosted_private_virtual_interface.go index 2aff8fa6673..bcccf57ab59 100644 --- a/internal/service/directconnect/hosted_private_virtual_interface.go +++ b/internal/service/directconnect/hosted_private_virtual_interface.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func resourceHostedPrivateVirtualInterfaceRead(ctx context.Context, d *schema.Re vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Private Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/hosted_private_virtual_interface_accepter.go b/internal/service/directconnect/hosted_private_virtual_interface_accepter.go index 7dfff70fcd2..345dc2ec944 100644 --- a/internal/service/directconnect/hosted_private_virtual_interface_accepter.go +++ b/internal/service/directconnect/hosted_private_virtual_interface_accepter.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func resourceHostedPrivateVirtualInterfaceAccepterRead(ctx context.Context, d *s vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Private Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/hosted_public_virtual_interface.go b/internal/service/directconnect/hosted_public_virtual_interface.go index 17afd52a344..2f1b2f30ccd 100644 --- a/internal/service/directconnect/hosted_public_virtual_interface.go +++ b/internal/service/directconnect/hosted_public_virtual_interface.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -170,7 +170,7 @@ func resourceHostedPublicVirtualInterfaceRead(ctx context.Context, d *schema.Res vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Public Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/hosted_public_virtual_interface_accepter.go b/internal/service/directconnect/hosted_public_virtual_interface_accepter.go index 5cd83a2bf9d..27bc16ca71d 100644 --- a/internal/service/directconnect/hosted_public_virtual_interface_accepter.go +++ b/internal/service/directconnect/hosted_public_virtual_interface_accepter.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +99,7 @@ func resourceHostedPublicVirtualInterfaceAccepterRead(ctx context.Context, d *sc vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Public Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/hosted_transit_virtual_interface.go b/internal/service/directconnect/hosted_transit_virtual_interface.go index 782c7ef5a9b..636de9ec79b 100644 --- a/internal/service/directconnect/hosted_transit_virtual_interface.go +++ b/internal/service/directconnect/hosted_transit_virtual_interface.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func resourceHostedTransitVirtualInterfaceRead(ctx context.Context, d *schema.Re vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Transit Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/hosted_transit_virtual_interface_accepter.go b/internal/service/directconnect/hosted_transit_virtual_interface_accepter.go index fd304580375..b5af676e443 100644 --- a/internal/service/directconnect/hosted_transit_virtual_interface_accepter.go +++ b/internal/service/directconnect/hosted_transit_virtual_interface_accepter.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func resourceHostedTransitVirtualInterfaceAccepterRead(ctx context.Context, d *s vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Hosted Transit Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/lag.go b/internal/service/directconnect/lag.go index 11272cd8512..b5bd35f1997 100644 --- a/internal/service/directconnect/lag.go +++ b/internal/service/directconnect/lag.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -142,7 +143,7 @@ func resourceLagRead(ctx context.Context, d *schema.ResourceData, meta any) diag lag, err := findLagByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect LAG (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -198,7 +199,7 @@ func resourceLagDelete(ctx context.Context, d *schema.ResourceData, meta any) di if d.Get(names.AttrForceDestroy).(bool) { lag, err := findLagByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -293,7 +294,7 @@ func statusLag(ctx context.Context, conn *directconnect.Client, id string) sdkre return func() (any, string, error) { output, err := findLagByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/lag_test.go b/internal/service/directconnect/lag_test.go index d05f2187258..9803d63ca00 100644 --- a/internal/service/directconnect/lag_test.go +++ b/internal/service/directconnect/lag_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckLagDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdirectconnect.FindLagByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/macsec_key_association.go b/internal/service/directconnect/macsec_key_association.go index 8097ceeb12a..8ff80226686 100644 --- a/internal/service/directconnect/macsec_key_association.go +++ b/internal/service/directconnect/macsec_key_association.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -121,7 +122,7 @@ func resourceMacSecKeyAssociationRead(ctx context.Context, d *schema.ResourceDat key, err := findMacSecKeyByTwoPartKey(ctx, conn, connectionID, secretARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect MACSec Key Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/macsec_key_association_test.go b/internal/service/directconnect/macsec_key_association_test.go index 063d6f8a12b..18528330abe 100644 --- a/internal/service/directconnect/macsec_key_association_test.go +++ b/internal/service/directconnect/macsec_key_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func testAccCheckMacSecKeyAssociationDestroy(ctx context.Context) resource.TestC _, err := tfdirectconnect.FindMacSecKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrConnectionID], rs.Primary.Attributes["secret_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/directconnect/private_virtual_interface.go b/internal/service/directconnect/private_virtual_interface.go index a96cf2a4e97..855318eb431 100644 --- a/internal/service/directconnect/private_virtual_interface.go +++ b/internal/service/directconnect/private_virtual_interface.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func resourcePrivateVirtualInterfaceRead(ctx context.Context, d *schema.Resource vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Private Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/public_virtual_interface.go b/internal/service/directconnect/public_virtual_interface.go index 3dfa3cb51d2..b2b99d98d17 100644 --- a/internal/service/directconnect/public_virtual_interface.go +++ b/internal/service/directconnect/public_virtual_interface.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -168,7 +168,7 @@ func resourcePublicVirtualInterfaceRead(ctx context.Context, d *schema.ResourceD vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Public Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/transit_virtual_interface.go b/internal/service/directconnect/transit_virtual_interface.go index a8d90c4167e..0f4dd3c5268 100644 --- a/internal/service/directconnect/transit_virtual_interface.go +++ b/internal/service/directconnect/transit_virtual_interface.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -178,7 +178,7 @@ func resourceTransitVirtualInterfaceRead(ctx context.Context, d *schema.Resource vif, err := findVirtualInterfaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Direct Connect Transit Virtual Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/directconnect/vif.go b/internal/service/directconnect/vif.go index 5a4824b68d3..a97bedc32ba 100644 --- a/internal/service/directconnect/vif.go +++ b/internal/service/directconnect/vif.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -128,7 +129,7 @@ func statusVirtualInterface(ctx context.Context, conn *directconnect.Client, id return func() (any, string, error) { output, err := findVirtualInterfaceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/directconnect/vif_test.go b/internal/service/directconnect/vif_test.go index 1f49e7137ea..f5e0e539732 100644 --- a/internal/service/directconnect/vif_test.go +++ b/internal/service/directconnect/vif_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func testAccCheckVirtualInterfaceExists(ctx context.Context, n string, v *awstypes.VirtualInterface) resource.TestCheckFunc { @@ -47,7 +47,7 @@ func testAccCheckVirtualInterfaceDestroy(ctx context.Context, s *terraform.State _, err := tfdirectconnect.FindVirtualInterfaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From ef013d1705b3faf27a299ef2f76a8a4ef265bba8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:01 -0800 Subject: [PATCH 070/227] `dms` --- internal/service/dms/certificate.go | 3 ++- internal/service/dms/certificate_test.go | 4 ++-- internal/service/dms/endpoint.go | 6 +++--- internal/service/dms/endpoint_test.go | 4 ++-- internal/service/dms/event_subscription.go | 5 +++-- internal/service/dms/event_subscription_test.go | 4 ++-- internal/service/dms/replication_config.go | 7 ++++--- internal/service/dms/replication_config_test.go | 4 ++-- internal/service/dms/replication_instance.go | 4 ++-- internal/service/dms/replication_instance_test.go | 4 ++-- internal/service/dms/replication_subnet_group.go | 3 ++- internal/service/dms/replication_subnet_group_test.go | 4 ++-- internal/service/dms/replication_task.go | 7 ++++--- internal/service/dms/replication_task_test.go | 4 ++-- internal/service/dms/s3_endpoint.go | 3 ++- 15 files changed, 36 insertions(+), 30 deletions(-) diff --git a/internal/service/dms/certificate.go b/internal/service/dms/certificate.go index 991a55439ef..4aa60a8ade8 100644 --- a/internal/service/dms/certificate.go +++ b/internal/service/dms/certificate.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -112,7 +113,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a certificate, err := findCertificateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/dms/certificate_test.go b/internal/service/dms/certificate_test.go index 796aadbc4fb..c8b705c95d3 100644 --- a/internal/service/dms/certificate_test.go +++ b/internal/service/dms/certificate_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdms.FindCertificateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/endpoint.go b/internal/service/dms/endpoint.go index 0b3d468cbd9..bb324e08c9d 100644 --- a/internal/service/dms/endpoint.go +++ b/internal/service/dms/endpoint.go @@ -930,7 +930,7 @@ func resourceEndpointRead(ctx context.Context, d *schema.ResourceData, meta any) endpoint, err := findEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -2485,7 +2485,7 @@ func statusEndpoint(conn *dms.Client, id string) retry.StateRefreshFunc { return func(ctx context.Context) (any, string, error) { output, err := findEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -2501,7 +2501,7 @@ func statusConnection(conn *dms.Client, endpointARN string) retry.StateRefreshFu return func(ctx context.Context) (any, string, error) { output, err := findConnectionByEndpointARN(ctx, conn, endpointARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dms/endpoint_test.go b/internal/service/dms/endpoint_test.go index 3a8b580520b..04018a105e3 100644 --- a/internal/service/dms/endpoint_test.go +++ b/internal/service/dms/endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2214,7 +2214,7 @@ func testAccCheckEndpointDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdms.FindEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/event_subscription.go b/internal/service/dms/event_subscription.go index f4dc516ba21..1aed508d287 100644 --- a/internal/service/dms/event_subscription.go +++ b/internal/service/dms/event_subscription.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -133,7 +134,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, subscription, err := findEventSubscriptionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Event Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -260,7 +261,7 @@ func statusEventSubscription(ctx context.Context, conn *dms.Client, name string) return func() (any, string, error) { output, err := findEventSubscriptionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dms/event_subscription_test.go b/internal/service/dms/event_subscription_test.go index 210f7f0ccea..c9b5aee35db 100644 --- a/internal/service/dms/event_subscription_test.go +++ b/internal/service/dms/event_subscription_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckEventSubscriptionDestroy(ctx context.Context) resource.TestChec _, err := tfdms.FindEventSubscriptionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/replication_config.go b/internal/service/dms/replication_config.go index a1127c0e10a..945f05fb330 100644 --- a/internal/service/dms/replication_config.go +++ b/internal/service/dms/replication_config.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -225,7 +226,7 @@ func resourceReplicationConfigRead(ctx context.Context, d *schema.ResourceData, replicationConfig, err := findReplicationConfigByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Replication Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -446,7 +447,7 @@ func statusReplication(ctx context.Context, conn *dms.Client, arn string) sdkret return func() (any, string, error) { output, err := findReplicationByReplicationConfigARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -577,7 +578,7 @@ func startReplication(ctx context.Context, conn *dms.Client, arn string, timeout func stopReplication(ctx context.Context, conn *dms.Client, arn string, timeout time.Duration) error { replication, err := findReplicationByReplicationConfigARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/dms/replication_config_test.go b/internal/service/dms/replication_config_test.go index d5224187b67..d00b6f9d728 100644 --- a/internal/service/dms/replication_config_test.go +++ b/internal/service/dms/replication_config_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -366,7 +366,7 @@ func testAccCheckReplicationConfigDestroy(ctx context.Context) resource.TestChec _, err := tfdms.FindReplicationConfigByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/replication_instance.go b/internal/service/dms/replication_instance.go index b7088a2e7e4..9e011bc23ec 100644 --- a/internal/service/dms/replication_instance.go +++ b/internal/service/dms/replication_instance.go @@ -248,7 +248,7 @@ func resourceReplicationInstanceRead(ctx context.Context, d *schema.ResourceData instance, err := findReplicationInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Replication Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -465,7 +465,7 @@ func statusReplicationInstance(conn *dms.Client, id string) retry.StateRefreshFu return func(ctx context.Context) (any, string, error) { output, err := findReplicationInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dms/replication_instance_test.go b/internal/service/dms/replication_instance_test.go index 5d1b9847a10..8b9e6a79d0e 100644 --- a/internal/service/dms/replication_instance_test.go +++ b/internal/service/dms/replication_instance_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -528,7 +528,7 @@ func testAccCheckReplicationInstanceDestroy(ctx context.Context) resource.TestCh _, err := tfdms.FindReplicationInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/replication_subnet_group.go b/internal/service/dms/replication_subnet_group.go index 91a9fa58599..5a7344219a7 100644 --- a/internal/service/dms/replication_subnet_group.go +++ b/internal/service/dms/replication_subnet_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -99,7 +100,7 @@ func resourceReplicationSubnetGroupRead(ctx context.Context, d *schema.ResourceD group, err := findReplicationSubnetGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Replication Subnet Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/dms/replication_subnet_group_test.go b/internal/service/dms/replication_subnet_group_test.go index ef3999c1216..0c107213bcb 100644 --- a/internal/service/dms/replication_subnet_group_test.go +++ b/internal/service/dms/replication_subnet_group_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckReplicationSubnetGroupDestroy(ctx context.Context) resource.Tes _, err := tfdms.FindReplicationSubnetGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/replication_task.go b/internal/service/dms/replication_task.go index 843910ed855..b94a91e173e 100644 --- a/internal/service/dms/replication_task.go +++ b/internal/service/dms/replication_task.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -197,7 +198,7 @@ func resourceReplicationTaskRead(ctx context.Context, d *schema.ResourceData, me task, err := findReplicationTaskByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Replication Task (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -400,7 +401,7 @@ func statusReplicationTask(ctx context.Context, conn *dms.Client, id string) sdk return func() (any, string, error) { output, err := findReplicationTaskByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -613,7 +614,7 @@ func startReplicationTask(ctx context.Context, conn *dms.Client, id string) erro func stopReplicationTask(ctx context.Context, conn *dms.Client, id string) error { task, err := findReplicationTaskByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/dms/replication_task_test.go b/internal/service/dms/replication_task_test.go index e7347031b0b..6a8c05e9c22 100644 --- a/internal/service/dms/replication_task_test.go +++ b/internal/service/dms/replication_task_test.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -678,7 +678,7 @@ func testAccCheckReplicationTaskDestroy(ctx context.Context) resource.TestCheckF _, err := tfdms.FindReplicationTaskByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dms/s3_endpoint.go b/internal/service/dms/s3_endpoint.go index 97b430cf4b6..6a711381c70 100644 --- a/internal/service/dms/s3_endpoint.go +++ b/internal/service/dms/s3_endpoint.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -376,7 +377,7 @@ func resourceS3EndpointRead(ctx context.Context, d *schema.ResourceData, meta an endpoint, err := findEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DMS Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags From cde3c1339876ed2b2471162ea3ad0285302329a6 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:02 -0800 Subject: [PATCH 071/227] `docdb` --- internal/service/docdb/cluster.go | 7 ++++--- internal/service/docdb/cluster_instance.go | 5 +++-- internal/service/docdb/cluster_instance_test.go | 4 ++-- internal/service/docdb/cluster_parameter_group.go | 3 ++- internal/service/docdb/cluster_parameter_group_test.go | 4 ++-- internal/service/docdb/cluster_snapshot.go | 5 +++-- internal/service/docdb/cluster_snapshot_test.go | 4 ++-- internal/service/docdb/cluster_test.go | 6 +++--- internal/service/docdb/event_subscription.go | 5 +++-- internal/service/docdb/event_subscription_test.go | 4 ++-- internal/service/docdb/global_cluster.go | 5 +++-- internal/service/docdb/global_cluster_test.go | 4 ++-- internal/service/docdb/subnet_group.go | 3 ++- internal/service/docdb/subnet_group_test.go | 4 ++-- internal/service/docdb/sweep.go | 4 ++-- 15 files changed, 37 insertions(+), 30 deletions(-) diff --git a/internal/service/docdb/cluster.go b/internal/service/docdb/cluster.go index 0383ddc1ff1..3b5dbbd8067 100644 --- a/internal/service/docdb/cluster.go +++ b/internal/service/docdb/cluster.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -733,7 +734,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) dbc, err := findDBClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -745,7 +746,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) // Ignore the following API error for regions/partitions that do not support DocDB Global Clusters: // InvalidParameterValue: Access Denied to API Version: APIGlobalDatabases - if globalCluster, err := findGlobalClusterByClusterARN(ctx, conn, aws.ToString(dbc.DBClusterArn)); tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "Access Denied to API Version: APIGlobalDatabases") { + if globalCluster, err := findGlobalClusterByClusterARN(ctx, conn, aws.ToString(dbc.DBClusterArn)); retry.NotFound(err) || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "Access Denied to API Version: APIGlobalDatabases") { d.Set("global_cluster_identifier", "") } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading DocumentDB Global Cluster information for DocumentDB Cluster (%s): %s", d.Id(), err) @@ -1159,7 +1160,7 @@ func statusDBCluster(ctx context.Context, conn *docdb.Client, id string) sdkretr return func() (any, string, error) { output, err := findDBClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/docdb/cluster_instance.go b/internal/service/docdb/cluster_instance.go index 880539f2f4d..e26612005bf 100644 --- a/internal/service/docdb/cluster_instance.go +++ b/internal/service/docdb/cluster_instance.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -242,7 +243,7 @@ func resourceClusterInstanceRead(ctx context.Context, d *schema.ResourceData, me db, err := findDBInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Cluster Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -440,7 +441,7 @@ func statusDBInstance(ctx context.Context, conn *docdb.Client, id string) sdkret return func() (any, string, error) { output, err := findDBInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/docdb/cluster_instance_test.go b/internal/service/docdb/cluster_instance_test.go index b46a805fbb5..2c774a038b9 100644 --- a/internal/service/docdb/cluster_instance_test.go +++ b/internal/service/docdb/cluster_instance_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -373,7 +373,7 @@ func testAccCheckClusterInstanceDestroy(ctx context.Context) resource.TestCheckF _, err := tfdocdb.FindDBInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/cluster_parameter_group.go b/internal/service/docdb/cluster_parameter_group.go index 2ad01270014..e8811c037c2 100644 --- a/internal/service/docdb/cluster_parameter_group.go +++ b/internal/service/docdb/cluster_parameter_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -137,7 +138,7 @@ func resourceClusterParameterGroupRead(ctx context.Context, d *schema.ResourceDa dbClusterParameterGroup, err := findDBClusterParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Cluster Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/docdb/cluster_parameter_group_test.go b/internal/service/docdb/cluster_parameter_group_test.go index 5c18b0672e7..ba897a2b1e5 100644 --- a/internal/service/docdb/cluster_parameter_group_test.go +++ b/internal/service/docdb/cluster_parameter_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -294,7 +294,7 @@ func testAccCheckClusterParameterGroupDestroy(ctx context.Context) resource.Test _, err := tfdocdb.FindDBClusterParameterGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/cluster_snapshot.go b/internal/service/docdb/cluster_snapshot.go index 7c42f524a7a..552d4023a9d 100644 --- a/internal/service/docdb/cluster_snapshot.go +++ b/internal/service/docdb/cluster_snapshot.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me snapshot, err := findClusterSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Cluster Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -240,7 +241,7 @@ func statusClusterSnapshot(ctx context.Context, conn *docdb.Client, id string) s return func() (any, string, error) { output, err := findClusterSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/docdb/cluster_snapshot_test.go b/internal/service/docdb/cluster_snapshot_test.go index 9c175b1add1..bf5cae25c98 100644 --- a/internal/service/docdb/cluster_snapshot_test.go +++ b/internal/service/docdb/cluster_snapshot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckClusterSnapshotDestroy(ctx context.Context) resource.TestCheckF _, err := tfdocdb.FindClusterSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/cluster_test.go b/internal/service/docdb/cluster_test.go index eb0b03d4eab..7ce188f07ad 100644 --- a/internal/service/docdb/cluster_test.go +++ b/internal/service/docdb/cluster_test.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1158,7 +1158,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdocdb.FindDBClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1219,7 +1219,7 @@ func testAccCheckClusterDestroyWithFinalSnapshot(ctx context.Context) resource.T _, err = tfdocdb.FindDBClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/event_subscription.go b/internal/service/docdb/event_subscription.go index cb0e2477e94..2e039ad03fa 100644 --- a/internal/service/docdb/event_subscription.go +++ b/internal/service/docdb/event_subscription.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -147,7 +148,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, output, err := findEventSubscriptionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Event Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -342,7 +343,7 @@ func statusEventSubscription(ctx context.Context, conn *docdb.Client, name strin return func() (any, string, error) { output, err := findEventSubscriptionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/docdb/event_subscription_test.go b/internal/service/docdb/event_subscription_test.go index 6fefa1d9d0a..65ba73f60c4 100644 --- a/internal/service/docdb/event_subscription_test.go +++ b/internal/service/docdb/event_subscription_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -248,7 +248,7 @@ func testAccCheckEventSubscriptionDestroy(ctx context.Context) resource.TestChec _, err := tfdocdb.FindEventSubscriptionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/global_cluster.go b/internal/service/docdb/global_cluster.go index 05fbec643a2..38aba3c6af4 100644 --- a/internal/service/docdb/global_cluster.go +++ b/internal/service/docdb/global_cluster.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -176,7 +177,7 @@ func resourceGlobalClusterRead(ctx context.Context, d *schema.ResourceData, meta globalCluster, err := findGlobalClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Global Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -390,7 +391,7 @@ func statusGlobalCluster(ctx context.Context, conn *docdb.Client, id string) sdk return func() (any, string, error) { output, err := findGlobalClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/docdb/global_cluster_test.go b/internal/service/docdb/global_cluster_test.go index 293d532f540..9f0a1129e2a 100644 --- a/internal/service/docdb/global_cluster_test.go +++ b/internal/service/docdb/global_cluster_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -340,7 +340,7 @@ func testAccCheckGlobalClusterDestroy(ctx context.Context) resource.TestCheckFun _, err := tfdocdb.FindGlobalClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/subnet_group.go b/internal/service/docdb/subnet_group.go index 379a21a64f7..77d36fb390c 100644 --- a/internal/service/docdb/subnet_group.go +++ b/internal/service/docdb/subnet_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -109,7 +110,7 @@ func resourceSubnetGroupRead(ctx context.Context, d *schema.ResourceData, meta a subnetGroup, err := findDBSubnetGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DocumentDB Subnet Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/docdb/subnet_group_test.go b/internal/service/docdb/subnet_group_test.go index 9680266528b..6c691d2c02d 100644 --- a/internal/service/docdb/subnet_group_test.go +++ b/internal/service/docdb/subnet_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -290,7 +290,7 @@ func testAccCheckSubnetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdocdb.FindDBSubnetGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/docdb/sweep.go b/internal/service/docdb/sweep.go index e4e65dcfca7..b9f2c9f9b44 100644 --- a/internal/service/docdb/sweep.go +++ b/internal/service/docdb/sweep.go @@ -13,9 +13,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/docdb" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func sweepClusters(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepa globalCluster, err := findGlobalClusterByClusterARN(ctx, conn, arn) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { log.Printf("[WARN] Reading DocumentDB Cluster %s Global Cluster information: %s", id, err) continue } From 6e7e65ce8ce421e5404ab82c509339c59f760cc7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:03 -0800 Subject: [PATCH 072/227] `docdbelastic` --- internal/service/docdbelastic/cluster.go | 5 +++-- internal/service/docdbelastic/cluster_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/docdbelastic/cluster.go b/internal/service/docdbelastic/cluster.go index 6a4f5f5a926..b7dda433a39 100644 --- a/internal/service/docdbelastic/cluster.go +++ b/internal/service/docdbelastic/cluster.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -244,7 +245,7 @@ func (r *clusterResource) Read(ctx context.Context, request resource.ReadRequest out, err := findClusterByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -452,7 +453,7 @@ func waitClusterDeleted(ctx context.Context, conn *docdbelastic.Client, id strin func statusCluster(ctx context.Context, conn *docdbelastic.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/docdbelastic/cluster_test.go b/internal/service/docdbelastic/cluster_test.go index 11b3846abfe..0a70fb02097 100644 --- a/internal/service/docdbelastic/cluster_test.go +++ b/internal/service/docdbelastic/cluster_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdocdbelastic "github.com/hashicorp/terraform-provider-aws/internal/service/docdbelastic" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +238,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdocdbelastic.FindClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8393c388eb10fdd5781b4638de0171717ed2d03f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:04 -0800 Subject: [PATCH 073/227] `drs` --- internal/service/drs/replication_configuration_template.go | 5 +++-- .../service/drs/replication_configuration_template_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/drs/replication_configuration_template.go b/internal/service/drs/replication_configuration_template.go index 6a769c5cff9..0ca48b25a4c 100644 --- a/internal/service/drs/replication_configuration_template.go +++ b/internal/service/drs/replication_configuration_template.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -194,7 +195,7 @@ func (r *replicationConfigurationTemplateResource) Read(ctx context.Context, req output, err := findReplicationConfigurationTemplateByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -353,7 +354,7 @@ func statusReplicationConfigurationTemplate(ctx context.Context, conn *drs.Clien return func() (any, string, error) { output, err := findReplicationConfigurationTemplateByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/drs/replication_configuration_template_test.go b/internal/service/drs/replication_configuration_template_test.go index 2bfd647e344..d6529176b3e 100644 --- a/internal/service/drs/replication_configuration_template_test.go +++ b/internal/service/drs/replication_configuration_template_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdrs "github.com/hashicorp/terraform-provider-aws/internal/service/drs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -153,7 +153,7 @@ func testAccCheckReplicationConfigurationTemplateDestroy(ctx context.Context) re _, err := tfdrs.FindReplicationConfigurationTemplateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } if err != nil { From 8480942a7e40ce90a1915bebc309126bc4950bed Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:04 -0800 Subject: [PATCH 074/227] `ds` --- internal/service/ds/conditional_forwarder.go | 3 ++- internal/service/ds/conditional_forwarder_test.go | 4 ++-- internal/service/ds/directory.go | 7 ++++--- internal/service/ds/directory_test.go | 4 ++-- internal/service/ds/log_subscription.go | 3 ++- internal/service/ds/log_subscription_test.go | 4 ++-- internal/service/ds/radius_settings.go | 5 +++-- internal/service/ds/radius_settings_test.go | 4 ++-- internal/service/ds/region.go | 5 +++-- internal/service/ds/region_test.go | 4 ++-- internal/service/ds/shared_directory.go | 5 +++-- internal/service/ds/shared_directory_accepter.go | 5 +++-- internal/service/ds/shared_directory_test.go | 4 ++-- internal/service/ds/trust.go | 5 +++-- internal/service/ds/trust_test.go | 4 ++-- 15 files changed, 37 insertions(+), 29 deletions(-) diff --git a/internal/service/ds/conditional_forwarder.go b/internal/service/ds/conditional_forwarder.go index e08411368b8..3c3e16075b7 100644 --- a/internal/service/ds/conditional_forwarder.go +++ b/internal/service/ds/conditional_forwarder.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -106,7 +107,7 @@ func resourceConditionalForwarderRead(ctx context.Context, d *schema.ResourceDat cfd, err := findConditionalForwarderByTwoPartKey(ctx, conn, directoryID, domainName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Conditional Forwarder (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ds/conditional_forwarder_test.go b/internal/service/ds/conditional_forwarder_test.go index baf56b96064..76ff35a91d0 100644 --- a/internal/service/ds/conditional_forwarder_test.go +++ b/internal/service/ds/conditional_forwarder_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckConditionalForwarderDestroy(ctx context.Context) resource.TestC _, err := tfds.FindConditionalForwarderByTwoPartKey(ctx, conn, rs.Primary.Attributes["directory_id"], rs.Primary.Attributes["remote_domain_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ds/directory.go b/internal/service/ds/directory.go index 6a17273c168..46a5802a728 100644 --- a/internal/service/ds/directory.go +++ b/internal/service/ds/directory.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -289,7 +290,7 @@ func resourceDirectoryRead(ctx context.Context, d *schema.ResourceData, meta any dir, err := findDirectoryByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Directory (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -685,7 +686,7 @@ func statusDirectoryStage(ctx context.Context, conn *directoryservice.Client, id return func() (any, string, error) { output, err := findDirectoryByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -811,7 +812,7 @@ func statusDomainController(ctx context.Context, conn *directoryservice.Client, return func() (any, string, error) { output, err := findDomainControllerByTwoPartKey(ctx, conn, directoryID, domainControllerID, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ds/directory_test.go b/internal/service/ds/directory_test.go index 38beebfac26..34900fb7d55 100644 --- a/internal/service/ds/directory_test.go +++ b/internal/service/ds/directory_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -444,7 +444,7 @@ func testAccCheckDirectoryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfds.FindDirectoryByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ds/log_subscription.go b/internal/service/ds/log_subscription.go index b5c088a553f..79b8e3325dd 100644 --- a/internal/service/ds/log_subscription.go +++ b/internal/service/ds/log_subscription.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -73,7 +74,7 @@ func resourceLogSubscriptionRead(ctx context.Context, d *schema.ResourceData, me logSubscription, err := findLogSubscriptionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Log Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ds/log_subscription_test.go b/internal/service/ds/log_subscription_test.go index 7034ca5cd9e..437ef5d4a01 100644 --- a/internal/service/ds/log_subscription_test.go +++ b/internal/service/ds/log_subscription_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -81,7 +81,7 @@ func testAccCheckLogSubscriptionDestroy(ctx context.Context) resource.TestCheckF _, err := tfds.FindLogSubscriptionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ds/radius_settings.go b/internal/service/ds/radius_settings.go index 644d297772b..34313448a20 100644 --- a/internal/service/ds/radius_settings.go +++ b/internal/service/ds/radius_settings.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -133,7 +134,7 @@ func resourceRadiusSettingsRead(ctx context.Context, d *schema.ResourceData, met output, err := findRadiusSettingsByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Directory (%s) RADIUS Settings not found, removing from state", d.Id()) d.SetId("") return diags @@ -226,7 +227,7 @@ func statusRadius(ctx context.Context, conn *directoryservice.Client, directoryI return func() (any, string, error) { output, err := findDirectoryByID(ctx, conn, directoryID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ds/radius_settings_test.go b/internal/service/ds/radius_settings_test.go index fd5b079520c..1ea186ab7c4 100644 --- a/internal/service/ds/radius_settings_test.go +++ b/internal/service/ds/radius_settings_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +113,7 @@ func testAccCheckRadiusSettingsDestroy(ctx context.Context) resource.TestCheckFu _, err := tfds.FindRadiusSettingsByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ds/region.go b/internal/service/ds/region.go index 236475d3e0f..49ec2019be7 100644 --- a/internal/service/ds/region.go +++ b/internal/service/ds/region.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -149,7 +150,7 @@ func resourceRegionRead(ctx context.Context, d *schema.ResourceData, meta any) d region, err := findRegionByTwoPartKey(ctx, conn, directoryID, regionName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Region (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -329,7 +330,7 @@ func statusRegion(ctx context.Context, conn *directoryservice.Client, directoryI return func() (any, string, error) { output, err := findRegionByTwoPartKey(ctx, conn, directoryID, regionName, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ds/region_test.go b/internal/service/ds/region_test.go index 01b7e352811..adb446ee601 100644 --- a/internal/service/ds/region_test.go +++ b/internal/service/ds/region_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckRegionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfds.FindRegionByTwoPartKey(ctx, conn, rs.Primary.Attributes["directory_id"], rs.Primary.Attributes["region_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ds/shared_directory.go b/internal/service/ds/shared_directory.go index 44846403575..02e8e2ea9a6 100644 --- a/internal/service/ds/shared_directory.go +++ b/internal/service/ds/shared_directory.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +125,7 @@ func resourceSharedDirectoryRead(ctx context.Context, d *schema.ResourceData, me output, err := findSharedDirectoryByTwoPartKey(ctx, conn, ownerDirID, sharedDirID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Shared Directory (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -259,7 +260,7 @@ func statusSharedDirectory(ctx context.Context, conn *directoryservice.Client, o return func() (any, string, error) { output, err := findSharedDirectoryByTwoPartKey(ctx, conn, ownerDirectoryID, sharedDirectoryID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ds/shared_directory_accepter.go b/internal/service/ds/shared_directory_accepter.go index 606a7e19dd7..cebbc5e165c 100644 --- a/internal/service/ds/shared_directory_accepter.go +++ b/internal/service/ds/shared_directory_accepter.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +96,7 @@ func resourceSharedDirectoryAccepterRead(ctx context.Context, d *schema.Resource dir, err := findSharedDirectoryAccepterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Directory Service Shared Directory Accepter (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -157,7 +158,7 @@ func statusDirectoryShareStatus(ctx context.Context, conn *directoryservice.Clie return func() (any, string, error) { output, err := findDirectoryByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ds/shared_directory_test.go b/internal/service/ds/shared_directory_test.go index ecd6eb7dfcc..329e69a1a5b 100644 --- a/internal/service/ds/shared_directory_test.go +++ b/internal/service/ds/shared_directory_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +113,7 @@ func testAccCheckSharedDirectoryDestroy(ctx context.Context) resource.TestCheckF _, err := tfds.FindSharedDirectoryByTwoPartKey(ctx, conn, rs.Primary.Attributes["directory_id"], rs.Primary.Attributes["shared_directory_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ds/trust.go b/internal/service/ds/trust.go index 3d5179f9670..bf82b7c1442 100644 --- a/internal/service/ds/trust.go +++ b/internal/service/ds/trust.go @@ -33,6 +33,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -211,7 +212,7 @@ func (r *trustResource) Read(ctx context.Context, request resource.ReadRequest, trustID := data.ID.ValueString() trust, err := findTrustByTwoPartKey(ctx, conn, directoryID, trustID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -473,7 +474,7 @@ func statusTrust(ctx context.Context, conn *directoryservice.Client, directoryID return func() (any, string, error) { output, err := findTrustByTwoPartKey(ctx, conn, directoryID, trustID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ds/trust_test.go b/internal/service/ds/trust_test.go index dbd5bf8e43a..6e8ff9d5107 100644 --- a/internal/service/ds/trust_test.go +++ b/internal/service/ds/trust_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -560,7 +560,7 @@ func testAccCheckTrustDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfds.FindTrustByTwoPartKey(ctx, conn, rs.Primary.Attributes["directory_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 12635a353257d59f43786d50e7dd9cf70a5fa3c5 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:05 -0800 Subject: [PATCH 075/227] `dsql` --- internal/service/dsql/cluster.go | 7 ++++--- internal/service/dsql/cluster_peering.go | 3 ++- internal/service/dsql/cluster_test.go | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/dsql/cluster.go b/internal/service/dsql/cluster.go index 516d91476d3..2ea55b326e9 100644 --- a/internal/service/dsql/cluster.go +++ b/internal/service/dsql/cluster.go @@ -35,6 +35,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -204,7 +205,7 @@ func (r *clusterResource) Read(ctx context.Context, request resource.ReadRequest id := fwflex.StringValueFromFramework(ctx, data.Identifier) output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -417,7 +418,7 @@ func statusCluster(ctx context.Context, conn *dsql.Client, id string) sdkretry.S return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -487,7 +488,7 @@ func statusClusterEncryption(ctx context.Context, conn *dsql.Client, id string) return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dsql/cluster_peering.go b/internal/service/dsql/cluster_peering.go index 3389b1d1e39..225b4897330 100644 --- a/internal/service/dsql/cluster_peering.go +++ b/internal/service/dsql/cluster_peering.go @@ -26,6 +26,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +149,7 @@ func (r *clusterPeeringResource) Read(ctx context.Context, request resource.Read err = tfresource.NewEmptyResultError(nil) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/dsql/cluster_test.go b/internal/service/dsql/cluster_test.go index f7455ffc745..ca8a54065c4 100644 --- a/internal/service/dsql/cluster_test.go +++ b/internal/service/dsql/cluster_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdsql "github.com/hashicorp/terraform-provider-aws/internal/service/dsql" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -265,7 +265,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdsql.FindClusterByID(ctx, conn, rs.Primary.Attributes[names.AttrIdentifier]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5a90267978cf3ac7c89e0d918ae6fa4de472e9be Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:06 -0800 Subject: [PATCH 076/227] `dynamodb` --- .../service/dynamodb/contributor_insights.go | 5 +++-- .../dynamodb/contributor_insights_test.go | 4 ++-- internal/service/dynamodb/global_table.go | 5 +++-- .../service/dynamodb/global_table_test.go | 4 ++-- .../dynamodb/kinesis_streaming_destination.go | 7 +++--- .../kinesis_streaming_destination_test.go | 4 ++-- internal/service/dynamodb/resource_policy.go | 3 ++- .../service/dynamodb/resource_policy_test.go | 4 ++-- internal/service/dynamodb/status.go | 22 +++++++++---------- internal/service/dynamodb/table.go | 3 ++- internal/service/dynamodb/table_export.go | 5 +++-- internal/service/dynamodb/table_item.go | 3 ++- internal/service/dynamodb/table_item_test.go | 4 ++-- internal/service/dynamodb/table_replica.go | 5 +++-- .../service/dynamodb/table_replica_test.go | 4 ++-- internal/service/dynamodb/table_test.go | 4 ++-- internal/service/dynamodb/tag_gen.go | 4 ++-- internal/service/dynamodb/tag_gen_test.go | 4 ++-- internal/service/dynamodb/tags_gen.go | 2 +- .../dynamodb/update_tags_for_resource_gen.go | 3 ++- 20 files changed, 54 insertions(+), 45 deletions(-) diff --git a/internal/service/dynamodb/contributor_insights.go b/internal/service/dynamodb/contributor_insights.go index c8bd0abfe70..9408ad04497 100644 --- a/internal/service/dynamodb/contributor_insights.go +++ b/internal/service/dynamodb/contributor_insights.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +108,7 @@ func resourceContributorInsightsRead(ctx context.Context, d *schema.ResourceData output, err := findContributorInsightsByTwoPartKey(ctx, conn, tableName, indexName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DynamoDB Contributor Insights (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -230,7 +231,7 @@ func statusContributorInsights(ctx context.Context, conn *dynamodb.Client, table return func() (any, string, error) { output, err := findContributorInsightsByTwoPartKey(ctx, conn, tableName, indexName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dynamodb/contributor_insights_test.go b/internal/service/dynamodb/contributor_insights_test.go index 831a28d1d00..352ac1345e0 100644 --- a/internal/service/dynamodb/contributor_insights_test.go +++ b/internal/service/dynamodb/contributor_insights_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -248,7 +248,7 @@ func testAccCheckContributorInsightsDestroy(ctx context.Context) resource.TestCh _, err = tfdynamodb.FindContributorInsightsByTwoPartKey(ctx, conn, tableName, indexName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/global_table.go b/internal/service/dynamodb/global_table.go index cf311055f89..d567237b04f 100644 --- a/internal/service/dynamodb/global_table.go +++ b/internal/service/dynamodb/global_table.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +99,7 @@ func resourceGlobalTableRead(ctx context.Context, d *schema.ResourceData, meta a globalTableDescription, err := findGlobalTableByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DynamoDB Global Table %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -211,7 +212,7 @@ func statusGlobalTable(ctx context.Context, conn *dynamodb.Client, name string) return func() (any, string, error) { output, err := findGlobalTableByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dynamodb/global_table_test.go b/internal/service/dynamodb/global_table_test.go index 92954a5a5a4..eee57a09e9b 100644 --- a/internal/service/dynamodb/global_table_test.go +++ b/internal/service/dynamodb/global_table_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func testAccCheckGlobalTableDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfdynamodb.FindGlobalTableByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/kinesis_streaming_destination.go b/internal/service/dynamodb/kinesis_streaming_destination.go index 4c662b75b5c..9433ed6d923 100644 --- a/internal/service/dynamodb/kinesis_streaming_destination.go +++ b/internal/service/dynamodb/kinesis_streaming_destination.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -111,7 +112,7 @@ func resourceKinesisStreamingDestinationRead(ctx context.Context, d *schema.Reso tableName, streamARN := parts[0], parts[1] output, err := findKinesisDataStreamDestinationByTwoPartKey(ctx, conn, streamARN, tableName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DynamoDB Kinesis Streaming Destination (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -140,7 +141,7 @@ func resourceKinesisStreamingDestinationDelete(ctx context.Context, d *schema.Re tableName, streamARN := parts[0], parts[1] _, err = findKinesisDataStreamDestinationByTwoPartKey(ctx, conn, streamARN, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -231,7 +232,7 @@ func statusKinesisStreamingDestination(ctx context.Context, conn *dynamodb.Clien } output, err := findKinesisDataStreamDestination(ctx, conn, input, kinesisDataStreamDestinationForStream(streamARN)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dynamodb/kinesis_streaming_destination_test.go b/internal/service/dynamodb/kinesis_streaming_destination_test.go index 02c234d35a1..b4bc93ad756 100644 --- a/internal/service/dynamodb/kinesis_streaming_destination_test.go +++ b/internal/service/dynamodb/kinesis_streaming_destination_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -191,7 +191,7 @@ func testAccCheckKinesisStreamingDestinationDestroy(ctx context.Context) resourc _, err := tfdynamodb.FindKinesisDataStreamDestinationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrStreamARN], rs.Primary.Attributes[names.AttrTableName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/resource_policy.go b/internal/service/dynamodb/resource_policy.go index d1bee21250f..0c0558eb7e1 100644 --- a/internal/service/dynamodb/resource_policy.go +++ b/internal/service/dynamodb/resource_policy.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +122,7 @@ func (r *resourcePolicyResource) Read(ctx context.Context, request resource.Read output, err := findResourcePolicyByARN(ctx, conn, data.ResourceARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/dynamodb/resource_policy_test.go b/internal/service/dynamodb/resource_policy_test.go index c8be381c039..2b522db74d8 100644 --- a/internal/service/dynamodb/resource_policy_test.go +++ b/internal/service/dynamodb/resource_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfdynamodb.FindResourcePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/status.go b/internal/service/dynamodb/status.go index 2a0fbd90f16..1da316a8279 100644 --- a/internal/service/dynamodb/status.go +++ b/internal/service/dynamodb/status.go @@ -10,14 +10,14 @@ import ( "github.com/aws/aws-sdk-go-v2/service/dynamodb" awstypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusTable(ctx context.Context, conn *dynamodb.Client, tableName string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := findTableByName(ctx, conn, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -33,7 +33,7 @@ func statusTableWarmThroughput(ctx context.Context, conn *dynamodb.Client, table return func() (any, string, error) { output, err := findTableByName(ctx, conn, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -53,7 +53,7 @@ func statusImport(ctx context.Context, conn *dynamodb.Client, importARN string) return func() (any, string, error) { output, err := findImportByARN(ctx, conn, importARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -73,7 +73,7 @@ func statusReplicaUpdate(ctx context.Context, conn *dynamodb.Client, tableName, return func() (any, string, error) { output, err := findTableByName(ctx, conn, tableName, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -95,7 +95,7 @@ func statusReplicaDelete(ctx context.Context, conn *dynamodb.Client, tableName, return func() (any, string, error) { output, err := findTableByName(ctx, conn, tableName, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -117,7 +117,7 @@ func statusGSI(ctx context.Context, conn *dynamodb.Client, tableName, indexName return func() (any, string, error) { output, err := findGSIByTwoPartKey(ctx, conn, tableName, indexName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -137,7 +137,7 @@ func statusGSIWarmThroughput(ctx context.Context, conn *dynamodb.Client, tableNa return func() (any, string, error) { output, err := findGSIByTwoPartKey(ctx, conn, tableName, indexName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -157,7 +157,7 @@ func statusPITR(ctx context.Context, conn *dynamodb.Client, tableName string, op return func() (any, string, error) { output, err := findPITRByTableName(ctx, conn, tableName, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -177,7 +177,7 @@ func statusTTL(ctx context.Context, conn *dynamodb.Client, tableName string) sdk return func() (any, string, error) { output, err := findTTLByTableName(ctx, conn, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -197,7 +197,7 @@ func statusSSE(ctx context.Context, conn *dynamodb.Client, tableName string, opt return func() (any, string, error) { output, err := findTableByName(ctx, conn, tableName, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index 542cdc0a606..35e493691e9 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/service/kms" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -919,7 +920,7 @@ func resourceTableRead(ctx context.Context, d *schema.ResourceData, meta any) di table, err := findTableByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.DynamoDB, create.ErrActionReading, resNameTable, d.Id()) d.SetId("") return diags diff --git a/internal/service/dynamodb/table_export.go b/internal/service/dynamodb/table_export.go index 7295fccd9cc..80d5cae7d1e 100644 --- a/internal/service/dynamodb/table_export.go +++ b/internal/service/dynamodb/table_export.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -228,7 +229,7 @@ func resourceTableExportRead(ctx context.Context, d *schema.ResourceData, meta a desc, err := findTableExportByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] DynamoDB Table Export (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -338,7 +339,7 @@ func statusTableExport(ctx context.Context, conn *dynamodb.Client, arn string) s return func() (any, string, error) { output, err := findTableExportByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/dynamodb/table_item.go b/internal/service/dynamodb/table_item.go index 80b3671903f..877f05cdb8b 100644 --- a/internal/service/dynamodb/table_item.go +++ b/internal/service/dynamodb/table_item.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -112,7 +113,7 @@ func resourceTableItemRead(ctx context.Context, d *schema.ResourceData, meta any key := expandTableItemQueryKey(attributes, hashKey, rangeKey) item, err := findTableItemByTwoPartKey(ctx, conn, tableName, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Dynamodb Table Item (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/dynamodb/table_item_test.go b/internal/service/dynamodb/table_item_test.go index 4e0d23a2574..003d9284658 100644 --- a/internal/service/dynamodb/table_item_test.go +++ b/internal/service/dynamodb/table_item_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -495,7 +495,7 @@ func testAccCheckTableItemDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfdynamodb.FindTableItemByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrTableName], key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/table_replica.go b/internal/service/dynamodb/table_replica.go index a14bb59cffe..280e3bbbdb9 100644 --- a/internal/service/dynamodb/table_replica.go +++ b/internal/service/dynamodb/table_replica.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/service/kms" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -220,7 +221,7 @@ func resourceTableReplicaRead(ctx context.Context, d *schema.ResourceData, meta table, err := findTableByName(ctx, conn, tableName, optFn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Dynamodb Table (%s) not found, removing replica from state", d.Id()) d.SetId("") return diags @@ -273,7 +274,7 @@ func resourceTableReplicaReadReplica(ctx context.Context, d *schema.ResourceData table, err := findTableByName(ctx, conn, tableName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Dynamodb Table Replica (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/dynamodb/table_replica_test.go b/internal/service/dynamodb/table_replica_test.go index 52a477ae4de..84dad5f4607 100644 --- a/internal/service/dynamodb/table_replica_test.go +++ b/internal/service/dynamodb/table_replica_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -355,7 +355,7 @@ func testAccCheckTableReplicaDestroy(ctx context.Context) resource.TestCheckFunc } output, err := tfdynamodb.FindTableByName(ctx, conn, tableName, optFn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index 9c1c50609a0..3f2fe9e0609 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -30,9 +30,9 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -5918,7 +5918,7 @@ func testAccCheckTableDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfdynamodb.FindTableByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/tag_gen.go b/internal/service/dynamodb/tag_gen.go index 9d509056da9..bcbe73cee59 100644 --- a/internal/service/dynamodb/tag_gen.go +++ b/internal/service/dynamodb/tag_gen.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -74,7 +74,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, meta any) diag value, err := findTag(ctx, conn, identifier, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] %s resource (%s) tag (%s) not found, removing from state", names.DynamoDB, identifier, key) d.SetId("") return diags diff --git a/internal/service/dynamodb/tag_gen_test.go b/internal/service/dynamodb/tag_gen_test.go index 9dde766bdb9..ca6d4dcf8ad 100644 --- a/internal/service/dynamodb/tag_gen_test.go +++ b/internal/service/dynamodb/tag_gen_test.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -32,7 +32,7 @@ func testAccCheckTagDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfdynamodb.FindTag(ctx, conn, identifier, key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/dynamodb/tags_gen.go b/internal/service/dynamodb/tags_gen.go index 2285eda2d8f..86fc7be26ba 100644 --- a/internal/service/dynamodb/tags_gen.go +++ b/internal/service/dynamodb/tags_gen.go @@ -200,7 +200,7 @@ func waitTagsPropagated(ctx context.Context, conn *dynamodb.Client, id string, t checkFunc := func(ctx context.Context) (bool, error) { output, err := listTags(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } diff --git a/internal/service/dynamodb/update_tags_for_resource_gen.go b/internal/service/dynamodb/update_tags_for_resource_gen.go index 16cc83dadf4..3f554033aa0 100644 --- a/internal/service/dynamodb/update_tags_for_resource_gen.go +++ b/internal/service/dynamodb/update_tags_for_resource_gen.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/dynamodb" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -74,7 +75,7 @@ func waitTagsPropagedForResource(ctx context.Context, conn *dynamodb.Client, id checkFunc := func(ctx context.Context) (bool, error) { output, err := listTags(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } From 6c8ff9a8eab3d5b9edd7c3e53eb86ad6d1edfb75 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:07 -0800 Subject: [PATCH 077/227] `ec2` --- .../service/ec2/ebs_fast_snapshot_restore.go | 4 +- .../ec2/ebs_fast_snapshot_restore_test.go | 4 +- internal/service/ec2/ebs_snapshot.go | 3 +- .../ebs_snapshot_create_volume_permission.go | 3 +- ..._snapshot_create_volume_permission_test.go | 4 +- internal/service/ec2/ebs_snapshot_import.go | 3 +- internal/service/ec2/ebs_snapshot_test.go | 4 +- internal/service/ec2/ebs_volume.go | 3 +- internal/service/ec2/ebs_volume_attachment.go | 6 +- .../service/ec2/ebs_volume_attachment_test.go | 4 +- internal/service/ec2/ebs_volume_test.go | 4 +- .../ec2/ec2_allowed_images_settings.go | 4 +- .../ec2/ec2_allowed_images_settings_test.go | 4 +- internal/service/ec2/ec2_ami.go | 9 +- .../service/ec2/ec2_ami_launch_permission.go | 4 +- .../ec2/ec2_ami_launch_permission_test.go | 4 +- internal/service/ec2/ec2_ami_test.go | 4 +- .../ec2/ec2_capacity_block_reservation.go | 4 +- .../service/ec2/ec2_capacity_reservation.go | 4 +- .../ec2/ec2_capacity_reservation_test.go | 4 +- .../ec2/ec2_default_credit_specification.go | 3 +- internal/service/ec2/ec2_eip.go | 7 +- internal/service/ec2/ec2_eip_association.go | 5 +- .../service/ec2/ec2_eip_association_test.go | 4 +- internal/service/ec2/ec2_eip_data_source.go | 3 +- internal/service/ec2/ec2_eip_domain_name.go | 4 +- .../service/ec2/ec2_eip_domain_name_test.go | 4 +- internal/service/ec2/ec2_eip_test.go | 4 +- internal/service/ec2/ec2_fleet.go | 4 +- internal/service/ec2/ec2_fleet_test.go | 4 +- internal/service/ec2/ec2_host.go | 4 +- internal/service/ec2/ec2_host_test.go | 4 +- .../ec2/ec2_image_block_public_access.go | 4 +- internal/service/ec2/ec2_instance.go | 7 +- .../ec2/ec2_instance_connect_endpoint.go | 4 +- .../ec2/ec2_instance_connect_endpoint_test.go | 4 +- .../ec2/ec2_instance_metadata_defaults.go | 3 +- .../ec2_instance_metadata_defaults_test.go | 4 +- internal/service/ec2/ec2_instance_state.go | 4 +- internal/service/ec2/ec2_instance_test.go | 4 +- internal/service/ec2/ec2_key_pair.go | 4 +- internal/service/ec2/ec2_key_pair_test.go | 4 +- internal/service/ec2/ec2_launch_template.go | 4 +- .../service/ec2/ec2_launch_template_test.go | 4 +- internal/service/ec2/ec2_placement_group.go | 4 +- .../service/ec2/ec2_placement_group_test.go | 4 +- .../service/ec2/ec2_serial_console_access.go | 4 +- .../ec2/ec2_serial_console_access_test.go | 4 +- .../ec2/ec2_spot_datafeed_subscription.go | 4 +- .../ec2_spot_datafeed_subscription_test.go | 4 +- .../service/ec2/ec2_spot_fleet_request.go | 3 +- .../ec2/ec2_spot_fleet_request_test.go | 4 +- .../service/ec2/ec2_spot_instance_request.go | 3 +- .../ec2/ec2_spot_instance_request_test.go | 6 +- .../ec2/outposts_local_gateway_route.go | 3 +- ...cal_gateway_route_table_vpc_association.go | 4 +- ...ateway_route_table_vpc_association_test.go | 4 +- .../ec2/outposts_local_gateway_route_test.go | 4 +- internal/service/ec2/status.go | 216 +++++++++--------- internal/service/ec2/tag_gen.go | 4 +- internal/service/ec2/tag_gen_test.go | 4 +- internal/service/ec2/transitgateway_.go | 3 +- .../service/ec2/transitgateway_connect.go | 8 +- .../ec2/transitgateway_connect_peer.go | 4 +- .../ec2/transitgateway_connect_peer_test.go | 4 +- .../ec2/transitgateway_connect_test.go | 4 +- ...gateway_default_route_table_association.go | 4 +- ...ay_default_route_table_association_test.go | 4 +- ...gateway_default_route_table_propagation.go | 4 +- ...ay_default_route_table_propagation_test.go | 4 +- .../ec2/transitgateway_multicast_domain.go | 8 +- ...sitgateway_multicast_domain_association.go | 4 +- ...teway_multicast_domain_association_test.go | 4 +- .../transitgateway_multicast_domain_test.go | 4 +- .../transitgateway_multicast_group_member.go | 3 +- ...nsitgateway_multicast_group_member_test.go | 4 +- .../transitgateway_multicast_group_source.go | 3 +- ...nsitgateway_multicast_group_source_test.go | 4 +- .../ec2/transitgateway_peering_attachment.go | 4 +- ...nsitgateway_peering_attachment_accepter.go | 4 +- .../transitgateway_peering_attachment_test.go | 4 +- .../ec2/transitgateway_policy_table.go | 4 +- ...transitgateway_policy_table_association.go | 4 +- ...itgateway_policy_table_association_test.go | 4 +- .../ec2/transitgateway_policy_table_test.go | 4 +- .../transitgateway_prefix_list_reference.go | 4 +- ...ansitgateway_prefix_list_reference_test.go | 4 +- internal/service/ec2/transitgateway_route.go | 3 +- .../service/ec2/transitgateway_route_table.go | 4 +- .../transitgateway_route_table_association.go | 6 +- ...sitgateway_route_table_association_test.go | 4 +- .../transitgateway_route_table_propagation.go | 6 +- ...sitgateway_route_table_propagation_test.go | 4 +- .../ec2/transitgateway_route_table_test.go | 4 +- .../service/ec2/transitgateway_route_test.go | 4 +- internal/service/ec2/transitgateway_test.go | 12 +- .../ec2/transitgateway_vpc_attachment.go | 8 +- .../transitgateway_vpc_attachment_accepter.go | 8 +- .../ec2/transitgateway_vpc_attachment_test.go | 4 +- .../service/ec2/verifiedaccess_endpoint.go | 4 +- .../ec2/verifiedaccess_endpoint_test.go | 4 +- internal/service/ec2/verifiedaccess_group.go | 4 +- .../service/ec2/verifiedaccess_group_test.go | 4 +- .../service/ec2/verifiedaccess_instance.go | 4 +- ...edaccess_instance_logging_configuration.go | 4 +- ...ess_instance_logging_configuration_test.go | 4 +- .../ec2/verifiedaccess_instance_test.go | 4 +- ...cess_instance_trust_provider_attachment.go | 4 +- ...instance_trust_provider_attachment_test.go | 4 +- .../ec2/verifiedaccess_trust_provider.go | 4 +- .../ec2/verifiedaccess_trust_provider_test.go | 4 +- internal/service/ec2/vpc_.go | 2 +- .../ec2/vpc_block_public_access_exclusion.go | 4 +- .../vpc_block_public_access_exclusion_test.go | 4 +- .../ec2/vpc_block_public_access_options.go | 4 +- .../ec2/vpc_default_route_table_test.go | 4 +- internal/service/ec2/vpc_default_subnet.go | 4 +- .../service/ec2/vpc_default_subnet_test.go | 4 +- internal/service/ec2/vpc_default_vpc.go | 4 +- internal/service/ec2/vpc_default_vpc_test.go | 6 +- internal/service/ec2/vpc_dhcp_options.go | 3 +- .../ec2/vpc_dhcp_options_association.go | 3 +- .../ec2/vpc_dhcp_options_association_test.go | 4 +- internal/service/ec2/vpc_dhcp_options_test.go | 4 +- .../ec2/vpc_egress_only_internet_gateway.go | 3 +- .../vpc_egress_only_internet_gateway_test.go | 4 +- internal/service/ec2/vpc_endpoint.go | 6 +- .../ec2/vpc_endpoint_connection_accepter.go | 4 +- .../vpc_endpoint_connection_accepter_test.go | 4 +- .../vpc_endpoint_connection_notification.go | 4 +- ...c_endpoint_connection_notification_test.go | 4 +- .../service/ec2/vpc_endpoint_data_source.go | 3 +- internal/service/ec2/vpc_endpoint_policy.go | 4 +- .../service/ec2/vpc_endpoint_private_dns.go | 4 +- .../vpc_endpoint_route_table_association.go | 3 +- ...c_endpoint_route_table_association_test.go | 4 +- ...vpc_endpoint_security_group_association.go | 4 +- ...ndpoint_security_group_association_test.go | 4 +- internal/service/ec2/vpc_endpoint_service.go | 4 +- .../vpc_endpoint_service_allowed_principal.go | 4 +- ...endpoint_service_allowed_principal_test.go | 4 +- .../service/ec2/vpc_endpoint_service_test.go | 4 +- .../ec2/vpc_endpoint_subnet_association.go | 3 +- .../vpc_endpoint_subnet_association_test.go | 4 +- internal/service/ec2/vpc_endpoint_test.go | 4 +- internal/service/ec2/vpc_flow_log.go | 3 +- internal/service/ec2/vpc_flow_log_test.go | 4 +- internal/service/ec2/vpc_internet_gateway.go | 5 +- .../ec2/vpc_internet_gateway_attachment.go | 5 +- .../vpc_internet_gateway_attachment_test.go | 4 +- .../service/ec2/vpc_internet_gateway_test.go | 4 +- internal/service/ec2/vpc_ipam.go | 4 +- .../vpc_ipam_organization_admin_account.go | 4 +- ...pc_ipam_organization_admin_account_test.go | 4 +- internal/service/ec2/vpc_ipam_pool.go | 4 +- internal/service/ec2/vpc_ipam_pool_cidr.go | 4 +- .../ec2/vpc_ipam_pool_cidr_allocation.go | 3 +- .../ec2/vpc_ipam_pool_cidr_allocation_test.go | 4 +- .../service/ec2/vpc_ipam_pool_cidr_test.go | 4 +- internal/service/ec2/vpc_ipam_pool_test.go | 4 +- .../ec2/vpc_ipam_resource_discovery.go | 4 +- ...vpc_ipam_resource_discovery_association.go | 4 +- ...pam_resource_discovery_association_test.go | 4 +- .../ec2/vpc_ipam_resource_discovery_test.go | 4 +- internal/service/ec2/vpc_ipam_scope.go | 4 +- internal/service/ec2/vpc_ipam_scope_test.go | 4 +- internal/service/ec2/vpc_ipam_test.go | 4 +- .../ec2/vpc_ipv4_cidr_block_association.go | 4 +- .../vpc_ipv4_cidr_block_association_test.go | 3 +- .../ec2/vpc_ipv6_cidr_block_association.go | 4 +- .../vpc_ipv6_cidr_block_association_test.go | 4 +- .../ec2/vpc_main_route_table_association.go | 4 +- .../vpc_main_route_table_association_test.go | 4 +- .../service/ec2/vpc_managed_prefix_list.go | 4 +- .../ec2/vpc_managed_prefix_list_entry.go | 3 +- .../ec2/vpc_managed_prefix_list_entry_test.go | 4 +- .../ec2/vpc_managed_prefix_list_test.go | 4 +- internal/service/ec2/vpc_nat_gateway.go | 4 +- .../ec2/vpc_nat_gateway_eip_association.go | 4 +- .../vpc_nat_gateway_eip_association_test.go | 4 +- internal/service/ec2/vpc_nat_gateway_test.go | 4 +- internal/service/ec2/vpc_network_acl.go | 5 +- .../ec2/vpc_network_acl_association.go | 9 +- .../ec2/vpc_network_acl_association_test.go | 4 +- internal/service/ec2/vpc_network_acl_rule.go | 5 +- .../service/ec2/vpc_network_acl_rule_test.go | 4 +- internal/service/ec2/vpc_network_acl_test.go | 4 +- .../ec2/vpc_network_insights_analysis.go | 4 +- .../ec2/vpc_network_insights_analysis_test.go | 4 +- .../service/ec2/vpc_network_insights_path.go | 3 +- .../ec2/vpc_network_insights_path_test.go | 4 +- internal/service/ec2/vpc_network_interface.go | 7 +- .../ec2/vpc_network_interface_attachment.go | 4 +- .../ec2/vpc_network_interface_permission.go | 4 +- .../vpc_network_interface_permission_test.go | 4 +- .../vpc_network_interface_sg_attachment.go | 5 +- ...pc_network_interface_sg_attachment_test.go | 4 +- .../service/ec2/vpc_network_interface_test.go | 4 +- ...network_performance_metric_subscription.go | 4 +- ...rk_performance_metric_subscription_test.go | 4 +- .../service/ec2/vpc_peering_connection.go | 3 +- .../ec2/vpc_peering_connection_options.go | 4 +- .../ec2/vpc_peering_connection_test.go | 4 +- internal/service/ec2/vpc_route.go | 5 +- internal/service/ec2/vpc_route_server.go | 4 +- .../service/ec2/vpc_route_server_endpoint.go | 4 +- .../ec2/vpc_route_server_endpoint_test.go | 4 +- internal/service/ec2/vpc_route_server_peer.go | 4 +- .../service/ec2/vpc_route_server_peer_test.go | 4 +- .../ec2/vpc_route_server_propagation.go | 4 +- .../ec2/vpc_route_server_propagation_test.go | 4 +- internal/service/ec2/vpc_route_server_test.go | 4 +- .../ec2/vpc_route_server_vpc_association.go | 4 +- .../vpc_route_server_vpc_association_test.go | 4 +- internal/service/ec2/vpc_route_table.go | 7 +- .../ec2/vpc_route_table_association.go | 3 +- .../ec2/vpc_route_table_association_test.go | 4 +- internal/service/ec2/vpc_route_table_test.go | 3 +- internal/service/ec2/vpc_route_test.go | 4 +- internal/service/ec2/vpc_security_group.go | 3 +- .../vpc_security_group_egress_rule_test.go | 4 +- .../ec2/vpc_security_group_ingress_rule.go | 4 +- .../vpc_security_group_ingress_rule_test.go | 4 +- .../service/ec2/vpc_security_group_rule.go | 3 +- .../service/ec2/vpc_security_group_test.go | 8 +- .../ec2/vpc_security_group_vpc_association.go | 4 +- ...vpc_security_group_vpc_association_test.go | 4 +- internal/service/ec2/vpc_subnet.go | 3 +- .../ec2/vpc_subnet_cidr_reservation.go | 4 +- .../ec2/vpc_subnet_cidr_reservation_test.go | 4 +- internal/service/ec2/vpc_subnet_test.go | 4 +- .../service/ec2/vpc_traffic_mirror_filter.go | 4 +- .../ec2/vpc_traffic_mirror_filter_rule.go | 4 +- .../vpc_traffic_mirror_filter_rule_test.go | 4 +- .../ec2/vpc_traffic_mirror_filter_test.go | 4 +- .../service/ec2/vpc_traffic_mirror_session.go | 4 +- .../ec2/vpc_traffic_mirror_session_test.go | 4 +- .../service/ec2/vpc_traffic_mirror_target.go | 4 +- .../ec2/vpc_traffic_mirror_target_test.go | 4 +- .../ec2/vpnclient_authorization_rule.go | 4 +- .../ec2/vpnclient_authorization_rule_test.go | 4 +- internal/service/ec2/vpnclient_endpoint.go | 4 +- .../service/ec2/vpnclient_endpoint_test.go | 4 +- .../ec2/vpnclient_network_association.go | 4 +- .../ec2/vpnclient_network_association_test.go | 4 +- internal/service/ec2/vpnclient_route.go | 3 +- internal/service/ec2/vpnclient_route_test.go | 4 +- internal/service/ec2/vpnsite_concentrator.go | 4 +- .../service/ec2/vpnsite_concentrator_test.go | 4 +- internal/service/ec2/vpnsite_connection.go | 4 +- .../service/ec2/vpnsite_connection_route.go | 4 +- .../ec2/vpnsite_connection_route_test.go | 4 +- .../service/ec2/vpnsite_connection_test.go | 4 +- .../service/ec2/vpnsite_customer_gateway.go | 4 +- .../ec2/vpnsite_customer_gateway_test.go | 4 +- internal/service/ec2/vpnsite_gateway.go | 3 +- .../service/ec2/vpnsite_gateway_attachment.go | 4 +- .../ec2/vpnsite_gateway_attachment_test.go | 4 +- .../ec2/vpnsite_gateway_route_propagation.go | 4 +- .../vpnsite_gateway_route_propagation_test.go | 4 +- internal/service/ec2/vpnsite_gateway_test.go | 4 +- .../service/ec2/wavelength_carrier_gateway.go | 4 +- .../ec2/wavelength_carrier_gateway_test.go | 4 +- 263 files changed, 671 insertions(+), 627 deletions(-) diff --git a/internal/service/ec2/ebs_fast_snapshot_restore.go b/internal/service/ec2/ebs_fast_snapshot_restore.go index 4e96301a627..37d59ff54bf 100644 --- a/internal/service/ec2/ebs_fast_snapshot_restore.go +++ b/internal/service/ec2/ebs_fast_snapshot_restore.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +135,7 @@ func (r *ebsFastSnapshotRestoreResource) Read(ctx context.Context, request resou v, err := findFastSnapshotRestoreByTwoPartKey(ctx, conn, data.AvailabilityZone.ValueString(), data.SnapshotID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/ebs_fast_snapshot_restore_test.go b/internal/service/ec2/ebs_fast_snapshot_restore_test.go index 7ef4c892dd8..3a29ac6d18b 100644 --- a/internal/service/ec2/ebs_fast_snapshot_restore_test.go +++ b/internal/service/ec2/ebs_fast_snapshot_restore_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +113,7 @@ func testAccCheckEBSFastSnapshotRestoreDestroy(ctx context.Context) resource.Tes _, err := tfec2.FindFastSnapshotRestoreByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAvailabilityZone], rs.Primary.Attributes[names.AttrSnapshotID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ebs_snapshot.go b/internal/service/ec2/ebs_snapshot.go index 09d6ae27148..601d22052a0 100644 --- a/internal/service/ec2/ebs_snapshot.go +++ b/internal/service/ec2/ebs_snapshot.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -174,7 +175,7 @@ func resourceEBSSnapshotRead(ctx context.Context, d *schema.ResourceData, meta a snapshot, err := findSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EBS Snapshot %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ebs_snapshot_create_volume_permission.go b/internal/service/ec2/ebs_snapshot_create_volume_permission.go index 6269c140cc4..3761c111150 100644 --- a/internal/service/ec2/ebs_snapshot_create_volume_permission.go +++ b/internal/service/ec2/ebs_snapshot_create_volume_permission.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +99,7 @@ func resourceSnapshotCreateVolumePermissionRead(ctx context.Context, d *schema.R _, err = findCreateSnapshotCreateVolumePermissionByTwoPartKey(ctx, conn, snapshotID, accountID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EBS Snapshot CreateVolumePermission %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go b/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go index 2dbcd9090e8..11f4b824b50 100644 --- a/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go +++ b/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func testAccCheckSnapshotCreateVolumePermissionDestroy(ctx context.Context) reso _, err := tfec2.FindCreateSnapshotCreateVolumePermissionByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrSnapshotID], rs.Primary.Attributes[names.AttrAccountID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ebs_snapshot_import.go b/internal/service/ec2/ebs_snapshot_import.go index ea5e63331d5..432865bcc44 100644 --- a/internal/service/ec2/ebs_snapshot_import.go +++ b/internal/service/ec2/ebs_snapshot_import.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -273,7 +274,7 @@ func resourceEBSSnapshotImportRead(ctx context.Context, d *schema.ResourceData, snapshot, err := findSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EBS Snapshot %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ebs_snapshot_test.go b/internal/service/ec2/ebs_snapshot_test.go index c359fa8a03e..da0a2969071 100644 --- a/internal/service/ec2/ebs_snapshot_test.go +++ b/internal/service/ec2/ebs_snapshot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -273,7 +273,7 @@ func testAccCheckEBSSnapshotDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfec2.FindSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ebs_volume.go b/internal/service/ec2/ebs_volume.go index ed3bc026f98..f0609aed650 100644 --- a/internal/service/ec2/ebs_volume.go +++ b/internal/service/ec2/ebs_volume.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -202,7 +203,7 @@ func resourceEBSVolumeRead(ctx context.Context, d *schema.ResourceData, meta any volume, err := findEBSVolumeByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EBS Volume %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ebs_volume_attachment.go b/internal/service/ec2/ebs_volume_attachment.go index 9e456432d84..0e9c5ad9000 100644 --- a/internal/service/ec2/ebs_volume_attachment.go +++ b/internal/service/ec2/ebs_volume_attachment.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func resourceVolumeAttachmentCreate(ctx context.Context, d *schema.ResourceData, _, err := findVolumeAttachment(ctx, conn, volumeID, instanceID, deviceName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // This handles the situation where the instance is created by // a spot request and whilst the request has been fulfilled the // instance is not running yet. @@ -139,7 +139,7 @@ func resourceVolumeAttachmentRead(ctx context.Context, d *schema.ResourceData, m _, err := findVolumeAttachment(ctx, conn, volumeID, instanceID, deviceName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EBS Volume Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ebs_volume_attachment_test.go b/internal/service/ec2/ebs_volume_attachment_test.go index 0e497c3296e..cd3471bfcd5 100644 --- a/internal/service/ec2/ebs_volume_attachment_test.go +++ b/internal/service/ec2/ebs_volume_attachment_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -288,7 +288,7 @@ func testAccCheckVolumeAttachmentDestroy(ctx context.Context) resource.TestCheck _, err := tfec2.FindEBSVolumeAttachment(ctx, conn, rs.Primary.Attributes["volume_id"], rs.Primary.Attributes[names.AttrInstanceID], rs.Primary.Attributes[names.AttrDeviceName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ebs_volume_test.go b/internal/service/ec2/ebs_volume_test.go index 76988e0f298..0a094715c22 100644 --- a/internal/service/ec2/ebs_volume_test.go +++ b/internal/service/ec2/ebs_volume_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -979,7 +979,7 @@ func testAccCheckVolumeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindEBSVolumeByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_allowed_images_settings.go b/internal/service/ec2/ec2_allowed_images_settings.go index eda41506c2f..5dc77e24b15 100644 --- a/internal/service/ec2/ec2_allowed_images_settings.go +++ b/internal/service/ec2/ec2_allowed_images_settings.go @@ -23,8 +23,8 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/smerr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func (r *allowedImagesSettingsResource) Read(ctx context.Context, request resour conn := r.Meta().EC2Client(ctx) out, err := findAllowedImagesSettings(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/ec2/ec2_allowed_images_settings_test.go b/internal/service/ec2/ec2_allowed_images_settings_test.go index b6c95db8244..939542d1a14 100644 --- a/internal/service/ec2/ec2_allowed_images_settings_test.go +++ b/internal/service/ec2/ec2_allowed_images_settings_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -450,7 +450,7 @@ func testAccCheckAllowedImagesSettingsDestroy(ctx context.Context) resource.Test _, err := tfec2.FindAllowedImagesSettings(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_ami.go b/internal/service/ec2/ec2_ami.go index c77b32b0a35..3e86fc02fe0 100644 --- a/internal/service/ec2/ec2_ami.go +++ b/internal/service/ec2/ec2_ami.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -407,7 +408,7 @@ func resourceAMIRead(ctx context.Context, d *schema.ResourceData, meta any) diag return findImageByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 AMI %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -817,7 +818,7 @@ func waitImageDescriptionUpdated(ctx context.Context, conn *ec2.Client, imageID, return tfresource.WaitUntil(ctx, imageDeprecationPropagationTimeout, func(ctx context.Context) (bool, error) { output, err := findImageByID(ctx, conn, imageID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } @@ -844,7 +845,7 @@ func waitImageDeprecationTimeUpdated(ctx context.Context, conn *ec2.Client, imag return tfresource.WaitUntil(ctx, imageDeprecationPropagationTimeout, func(ctx context.Context) (bool, error) { output, err := findImageByID(ctx, conn, imageID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } @@ -875,7 +876,7 @@ func waitImageDeprecationTimeDisabled(ctx context.Context, conn *ec2.Client, ima return tfresource.WaitUntil(ctx, imageDeprecationPropagationTimeout, func(ctx context.Context) (bool, error) { output, err := findImageByID(ctx, conn, imageID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } diff --git a/internal/service/ec2/ec2_ami_launch_permission.go b/internal/service/ec2/ec2_ami_launch_permission.go index e742c0b52eb..f433b4eec2b 100644 --- a/internal/service/ec2/ec2_ami_launch_permission.go +++ b/internal/service/ec2/ec2_ami_launch_permission.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +114,7 @@ func resourceAMILaunchPermissionRead(ctx context.Context, d *schema.ResourceData _, err = findImageLaunchPermission(ctx, conn, imageID, accountID, group, organizationARN, organizationalUnitARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AMI Launch Permission %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_ami_launch_permission_test.go b/internal/service/ec2/ec2_ami_launch_permission_test.go index 4704b5f1e5f..c650d422d55 100644 --- a/internal/service/ec2/ec2_ami_launch_permission_test.go +++ b/internal/service/ec2/ec2_ami_launch_permission_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckAMILaunchPermissionDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindImageLaunchPermission(ctx, conn, rs.Primary.Attributes["image_id"], rs.Primary.Attributes[names.AttrAccountID], rs.Primary.Attributes["group"], rs.Primary.Attributes["organization_arn"], rs.Primary.Attributes["organizational_unit_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_ami_test.go b/internal/service/ec2/ec2_ami_test.go index fec353f98ff..6a1136800d3 100644 --- a/internal/service/ec2/ec2_ami_test.go +++ b/internal/service/ec2/ec2_ami_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -541,7 +541,7 @@ func testAccCheckAMIDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindImageByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_capacity_block_reservation.go b/internal/service/ec2/ec2_capacity_block_reservation.go index 171e200ebd0..5132a197530 100644 --- a/internal/service/ec2/ec2_capacity_block_reservation.go +++ b/internal/service/ec2/ec2_capacity_block_reservation.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -216,7 +216,7 @@ func (r *capacityBlockReservationResource) Read(ctx context.Context, request res cr, err := findCapacityReservationByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/ec2_capacity_reservation.go b/internal/service/ec2/ec2_capacity_reservation.go index 9e6298966f8..0db11f4876d 100644 --- a/internal/service/ec2/ec2_capacity_reservation.go +++ b/internal/service/ec2/ec2_capacity_reservation.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func resourceCapacityReservationRead(ctx context.Context, d *schema.ResourceData reservation, err := findCapacityReservationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Capacity Reservation %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_capacity_reservation_test.go b/internal/service/ec2/ec2_capacity_reservation_test.go index 02ce772d504..4c3ebb47673 100644 --- a/internal/service/ec2/ec2_capacity_reservation_test.go +++ b/internal/service/ec2/ec2_capacity_reservation_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -434,7 +434,7 @@ func testAccCheckCapacityReservationDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindCapacityReservationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_default_credit_specification.go b/internal/service/ec2/ec2_default_credit_specification.go index b5b19b0f4c6..ce73bb7d133 100644 --- a/internal/service/ec2/ec2_default_credit_specification.go +++ b/internal/service/ec2/ec2_default_credit_specification.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +125,7 @@ func (r *defaultCreditSpecificationResource) Read(ctx context.Context, request r output, err := findDefaultCreditSpecificationByInstanceFamily(ctx, conn, data.InstanceFamily.ValueEnum()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/ec2_eip.go b/internal/service/ec2/ec2_eip.go index 8dbfdcde180..3dbe2de3586 100644 --- a/internal/service/ec2/ec2_eip.go +++ b/internal/service/ec2/ec2_eip.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -214,7 +215,7 @@ func resourceEIPRead(ctx context.Context, d *schema.ResourceData, meta any) diag return findEIPByAllocationID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 EIP (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -259,7 +260,7 @@ func resourceEIPRead(ctx context.Context, d *schema.ResourceData, meta any) diag switch { case err == nil: d.Set("ptr_record", strings.TrimSuffix(aws.ToString(addressAttr.PtrRecord), ".")) - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("ptr_record", nil) case tfawserr.ErrMessageContains(err, "InvalidAction", "not valid for this web service"): d.Set("ptr_record", nil) @@ -383,7 +384,7 @@ func associateEIP(ctx context.Context, conn *ec2.Client, allocationID, instanceI return findEIPByAssociationID(ctx, conn, aws.ToString(output.AssociationId)) }, func(err error) (bool, error) { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return true, err } diff --git a/internal/service/ec2/ec2_eip_association.go b/internal/service/ec2/ec2_eip_association.go index b5b3b5d08cd..bbe428dfe7d 100644 --- a/internal/service/ec2/ec2_eip_association.go +++ b/internal/service/ec2/ec2_eip_association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +123,7 @@ func resourceEIPAssociationCreate(ctx context.Context, d *schema.ResourceData, m return findEIPByAssociationID(ctx, conn, d.Id()) }, func(err error) (bool, error) { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return true, err } @@ -152,7 +153,7 @@ func resourceEIPAssociationRead(ctx context.Context, d *schema.ResourceData, met address, err := findEIPByAssociationID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 EIP Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_eip_association_test.go b/internal/service/ec2/ec2_eip_association_test.go index 7e9d9ed5069..84c36450ab8 100644 --- a/internal/service/ec2/ec2_eip_association_test.go +++ b/internal/service/ec2/ec2_eip_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -234,7 +234,7 @@ func testAccCheckEIPAssociationDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindEIPByAssociationID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_eip_data_source.go b/internal/service/ec2/ec2_eip_data_source.go index 5d72e075d82..92a4a3d6b36 100644 --- a/internal/service/ec2/ec2_eip_data_source.go +++ b/internal/service/ec2/ec2_eip_data_source.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -151,7 +152,7 @@ func dataSourceEIPRead(ctx context.Context, d *schema.ResourceData, meta any) di switch { case err == nil: d.Set("ptr_record", addressAttr.PtrRecord) - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("ptr_record", nil) default: return sdkdiag.AppendErrorf(diags, "reading EC2 EIP (%s) domain name attribute: %s", d.Id(), err) diff --git a/internal/service/ec2/ec2_eip_domain_name.go b/internal/service/ec2/ec2_eip_domain_name.go index dedf9d15185..7ef5da0ecc0 100644 --- a/internal/service/ec2/ec2_eip_domain_name.go +++ b/internal/service/ec2/ec2_eip_domain_name.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func (r *eipDomainNameResource) Read(ctx context.Context, request resource.ReadR output, err := findEIPDomainNameAttributeByAllocationID(ctx, conn, data.AllocationID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/ec2_eip_domain_name_test.go b/internal/service/ec2/ec2_eip_domain_name_test.go index e3924bf2298..fce7a0cc24f 100644 --- a/internal/service/ec2/ec2_eip_domain_name_test.go +++ b/internal/service/ec2/ec2_eip_domain_name_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -125,7 +125,7 @@ func testAccCheckEIPDomainNameDestroy(ctx context.Context) resource.TestCheckFun _, err := tfec2.FindEIPDomainNameAttributeByAllocationID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_eip_test.go b/internal/service/ec2/ec2_eip_test.go index c4643e81272..81191adea98 100644 --- a/internal/service/ec2/ec2_eip_test.go +++ b/internal/service/ec2/ec2_eip_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -750,7 +750,7 @@ func testAccCheckEIPDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindEIPByAllocationID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_fleet.go b/internal/service/ec2/ec2_fleet.go index 735f1bc6c32..2d06fbd334b 100644 --- a/internal/service/ec2/ec2_fleet.go +++ b/internal/service/ec2/ec2_fleet.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -811,7 +811,7 @@ func resourceFleetRead(ctx context.Context, d *schema.ResourceData, meta any) di fleet, err := findFleetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Fleet %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_fleet_test.go b/internal/service/ec2/ec2_fleet_test.go index a4810767952..a8e852e104c 100644 --- a/internal/service/ec2/ec2_fleet_test.go +++ b/internal/service/ec2/ec2_fleet_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -3359,7 +3359,7 @@ func testAccCheckFleetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindFleetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_host.go b/internal/service/ec2/ec2_host.go index e5a3f31479a..e34eb5be836 100644 --- a/internal/service/ec2/ec2_host.go +++ b/internal/service/ec2/ec2_host.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func resourceHostRead(ctx context.Context, d *schema.ResourceData, meta any) dia host, err := findHostByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Host %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_host_test.go b/internal/service/ec2/ec2_host_test.go index cbd05987218..748bc96e8be 100644 --- a/internal/service/ec2/ec2_host_test.go +++ b/internal/service/ec2/ec2_host_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -259,7 +259,7 @@ func testAccCheckHostDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindHostByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_image_block_public_access.go b/internal/service/ec2/ec2_image_block_public_access.go index a9445d0cb4c..c078faf8299 100644 --- a/internal/service/ec2/ec2_image_block_public_access.go +++ b/internal/service/ec2/ec2_image_block_public_access.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func resourceImageBlockPublicAccessRead(ctx context.Context, d *schema.ResourceD output, err := findImageBlockPublicAccessState(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Image Block Public Access %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_instance.go b/internal/service/ec2/ec2_instance.go index 6ca54b7b12a..e9b558bd352 100644 --- a/internal/service/ec2/ec2_instance.go +++ b/internal/service/ec2/ec2_instance.go @@ -45,6 +45,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -1238,7 +1239,7 @@ func resourceInstanceRead(ctx context.Context, rd *schema.ResourceData, meta any instance, err := findInstanceByID(ctx, conn, rd.Id()) - if !rd.IsNewResource() && tfresource.NotFound(err) { + if !rd.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Instance %s not found, removing from state", rd.Id()) rd.SetId("") return diags @@ -3894,7 +3895,7 @@ func flattenInstanceLaunchTemplate(ctx context.Context, conn *ec2.Client, instan name, defaultVersion, latestVersion, err := findLaunchTemplateNameAndVersions(ctx, conn, launchTemplateID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, nil } @@ -3915,7 +3916,7 @@ func flattenInstanceLaunchTemplate(ctx context.Context, conn *ec2.Client, instan _, err = findLaunchTemplateVersionByTwoPartKey(ctx, conn, launchTemplateID, currentLaunchTemplateVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return []any{tfMap}, nil } diff --git a/internal/service/ec2/ec2_instance_connect_endpoint.go b/internal/service/ec2/ec2_instance_connect_endpoint.go index 0d9c6cd0b1b..d5d14a7eb47 100644 --- a/internal/service/ec2/ec2_instance_connect_endpoint.go +++ b/internal/service/ec2/ec2_instance_connect_endpoint.go @@ -27,8 +27,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -205,7 +205,7 @@ func (r *instanceConnectEndpointResource) Read(ctx context.Context, request reso id := data.InstanceConnectEndpointID.ValueString() instanceConnectEndpoint, err := findInstanceConnectEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/ec2_instance_connect_endpoint_test.go b/internal/service/ec2/ec2_instance_connect_endpoint_test.go index 109f198ba9b..02b15ebf4cd 100644 --- a/internal/service/ec2/ec2_instance_connect_endpoint_test.go +++ b/internal/service/ec2/ec2_instance_connect_endpoint_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -331,7 +331,7 @@ func testAccCheckInstanceConnectEndpointDestroy(ctx context.Context) resource.Te _, err := tfec2.FindInstanceConnectEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_instance_metadata_defaults.go b/internal/service/ec2/ec2_instance_metadata_defaults.go index 8347f4ee2b1..1c9a53d924c 100644 --- a/internal/service/ec2/ec2_instance_metadata_defaults.go +++ b/internal/service/ec2/ec2_instance_metadata_defaults.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -137,7 +138,7 @@ func (r *instanceMetadataDefaultsResource) Read(ctx context.Context, request res case err == nil && inttypes.IsZero(output): err = tfresource.NewEmptyResultError(nil) fallthrough - case tfresource.NotFound(err): + case retry.NotFound(err): response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/ec2_instance_metadata_defaults_test.go b/internal/service/ec2/ec2_instance_metadata_defaults_test.go index 311648d42e0..34a12709583 100644 --- a/internal/service/ec2/ec2_instance_metadata_defaults_test.go +++ b/internal/service/ec2/ec2_instance_metadata_defaults_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +115,7 @@ func testAccCheckInstanceMetadataDefaultsDestroy(ctx context.Context) resource.T output, err := tfec2.FindInstanceMetadataDefaults(ctx, conn) - if tfresource.NotFound(err) || err == nil && inttypes.IsZero(output) { + if retry.NotFound(err) || err == nil && inttypes.IsZero(output) { continue } diff --git a/internal/service/ec2/ec2_instance_state.go b/internal/service/ec2/ec2_instance_state.go index 92b4059066f..9d18d9f31d3 100644 --- a/internal/service/ec2/ec2_instance_state.go +++ b/internal/service/ec2/ec2_instance_state.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +84,7 @@ func resourceInstanceStateRead(ctx context.Context, d *schema.ResourceData, meta state, err := findInstanceStateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Instance State %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_instance_test.go b/internal/service/ec2/ec2_instance_test.go index 8a352776ea1..b03d36b0534 100644 --- a/internal/service/ec2/ec2_instance_test.go +++ b/internal/service/ec2/ec2_instance_test.go @@ -33,8 +33,8 @@ import ( tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -6364,7 +6364,7 @@ func testAccCheckInstanceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_key_pair.go b/internal/service/ec2/ec2_key_pair.go index 63370f54150..2509b0cf4dd 100644 --- a/internal/service/ec2/ec2_key_pair.go +++ b/internal/service/ec2/ec2_key_pair.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" "golang.org/x/crypto/ssh" ) @@ -124,7 +124,7 @@ func resourceKeyPairRead(ctx context.Context, d *schema.ResourceData, meta any) keyPair, err := findKeyPairByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Key Pair (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_key_pair_test.go b/internal/service/ec2/ec2_key_pair_test.go index b376dbac5bf..523d8b3cf53 100644 --- a/internal/service/ec2/ec2_key_pair_test.go +++ b/internal/service/ec2/ec2_key_pair_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -218,7 +218,7 @@ func testAccCheckKeyPairDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindKeyPairByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_launch_template.go b/internal/service/ec2/ec2_launch_template.go index ed43eb21692..fcc7473f4d2 100644 --- a/internal/service/ec2/ec2_launch_template.go +++ b/internal/service/ec2/ec2_launch_template.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1081,7 +1081,7 @@ func resourceLaunchTemplateRead(ctx context.Context, d *schema.ResourceData, met lt, err := findLaunchTemplateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Launch Template %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_launch_template_test.go b/internal/service/ec2/ec2_launch_template_test.go index e90787efed9..e3004b4c11a 100644 --- a/internal/service/ec2/ec2_launch_template_test.go +++ b/internal/service/ec2/ec2_launch_template_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -3578,7 +3578,7 @@ func testAccCheckLaunchTemplateDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindLaunchTemplateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_placement_group.go b/internal/service/ec2/ec2_placement_group.go index 2b9928c705c..695dae309cd 100644 --- a/internal/service/ec2/ec2_placement_group.go +++ b/internal/service/ec2/ec2_placement_group.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -123,7 +123,7 @@ func resourcePlacementGroupRead(ctx context.Context, d *schema.ResourceData, met pg, err := findPlacementGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Placement Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_placement_group_test.go b/internal/service/ec2/ec2_placement_group_test.go index 9aaba95d27e..c6b76e808a4 100644 --- a/internal/service/ec2/ec2_placement_group_test.go +++ b/internal/service/ec2/ec2_placement_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -220,7 +220,7 @@ func testAccCheckPlacementGroupDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindPlacementGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_serial_console_access.go b/internal/service/ec2/ec2_serial_console_access.go index b2762e1c245..a9ffd81901f 100644 --- a/internal/service/ec2/ec2_serial_console_access.go +++ b/internal/service/ec2/ec2_serial_console_access.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -62,7 +62,7 @@ func resourceSerialConsoleAccessRead(ctx context.Context, d *schema.ResourceData output, err := findSerialConsoleAccessStatus(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Serial Console Access %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_serial_console_access_test.go b/internal/service/ec2/ec2_serial_console_access_test.go index 8895ba94b98..bc8ef63cba6 100644 --- a/internal/service/ec2/ec2_serial_console_access_test.go +++ b/internal/service/ec2/ec2_serial_console_access_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -73,7 +73,7 @@ func testAccCheckSerialConsoleAccessDestroy(ctx context.Context) resource.TestCh output, err := tfec2.FindSerialConsoleAccessStatus(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/ec2/ec2_spot_datafeed_subscription.go b/internal/service/ec2/ec2_spot_datafeed_subscription.go index 6dde3c6e464..211f8312d43 100644 --- a/internal/service/ec2/ec2_spot_datafeed_subscription.go +++ b/internal/service/ec2/ec2_spot_datafeed_subscription.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -72,7 +72,7 @@ func resourceSpotDataFeedSubscriptionRead(ctx context.Context, d *schema.Resourc subscription, err := findSpotDatafeedSubscription(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Spot Datafeed Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_spot_datafeed_subscription_test.go b/internal/service/ec2/ec2_spot_datafeed_subscription_test.go index 88f8da4f8b9..9c7d1491159 100644 --- a/internal/service/ec2/ec2_spot_datafeed_subscription_test.go +++ b/internal/service/ec2/ec2_spot_datafeed_subscription_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func testAccCheckSpotDatafeedSubscriptionDestroy(ctx context.Context) resource.T _, err := tfec2.FindSpotDatafeedSubscription(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_spot_fleet_request.go b/internal/service/ec2/ec2_spot_fleet_request.go index 9519d9fdbe6..9d6ba84b33b 100644 --- a/internal/service/ec2/ec2_spot_fleet_request.go +++ b/internal/service/ec2/ec2_spot_fleet_request.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -1029,7 +1030,7 @@ func resourceSpotFleetRequestRead(ctx context.Context, d *schema.ResourceData, m output, err := findSpotFleetRequestByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Spot Fleet Request %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_spot_fleet_request_test.go b/internal/service/ec2/ec2_spot_fleet_request_test.go index fa157f32ee6..0240424b55a 100644 --- a/internal/service/ec2/ec2_spot_fleet_request_test.go +++ b/internal/service/ec2/ec2_spot_fleet_request_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1822,7 +1822,7 @@ func testAccCheckSpotFleetRequestDestroy(ctx context.Context) resource.TestCheck _, err := tfec2.FindSpotFleetRequestByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/ec2_spot_instance_request.go b/internal/service/ec2/ec2_spot_instance_request.go index b7d9e1875c2..83f2230f959 100644 --- a/internal/service/ec2/ec2_spot_instance_request.go +++ b/internal/service/ec2/ec2_spot_instance_request.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -257,7 +258,7 @@ func resourceSpotInstanceRequestRead(ctx context.Context, d *schema.ResourceData return findSpotInstanceRequestByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Spot Instance Request (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/ec2_spot_instance_request_test.go b/internal/service/ec2/ec2_spot_instance_request_test.go index 9048a6c9d03..d8dfddc3211 100644 --- a/internal/service/ec2/ec2_spot_instance_request_test.go +++ b/internal/service/ec2/ec2_spot_instance_request_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -575,12 +575,12 @@ func testAccCheckSpotInstanceRequestDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindSpotInstanceRequestByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Now check if the associated Spot Instance was also destroyed. instanceID := rs.Primary.Attributes["spot_instance_id"] _, err := tfec2.FindInstanceByID(ctx, conn, instanceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/outposts_local_gateway_route.go b/internal/service/ec2/outposts_local_gateway_route.go index 92716303819..7a84aa47626 100644 --- a/internal/service/ec2/outposts_local_gateway_route.go +++ b/internal/service/ec2/outposts_local_gateway_route.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -94,7 +95,7 @@ func resourceLocalGatewayRouteRead(ctx context.Context, d *schema.ResourceData, return findLocalGatewayRouteByTwoPartKey(ctx, conn, localGatewayRouteTableID, destination) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Local Gateway Route (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/outposts_local_gateway_route_table_vpc_association.go b/internal/service/ec2/outposts_local_gateway_route_table_vpc_association.go index 7d7bb84fc61..62ac03a0a30 100644 --- a/internal/service/ec2/outposts_local_gateway_route_table_vpc_association.go +++ b/internal/service/ec2/outposts_local_gateway_route_table_vpc_association.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -86,7 +86,7 @@ func resourceLocalGatewayRouteTableVPCAssociationRead(ctx context.Context, d *sc association, err := findLocalGatewayRouteTableVPCAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Local Gateway Route Table VPC Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go b/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go index 68c9214242a..ba5f273dacd 100644 --- a/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckLocalGatewayRouteTableVPCAssociationDestroy(ctx context.Context _, err := tfec2.FindLocalGatewayRouteTableVPCAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/outposts_local_gateway_route_test.go b/internal/service/ec2/outposts_local_gateway_route_test.go index 016b5d70543..fc6521cd75a 100644 --- a/internal/service/ec2/outposts_local_gateway_route_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func testAccCheckLocalGatewayRouteDestroy(ctx context.Context) resource.TestChec _, err := tfec2.FindLocalGatewayRouteByTwoPartKey(ctx, conn, rs.Primary.Attributes["local_gateway_route_table_id"], rs.Primary.Attributes["destination_cidr_block"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/status.go b/internal/service/ec2/status.go index bc02932e426..aa86a4db2d3 100644 --- a/internal/service/ec2/status.go +++ b/internal/service/ec2/status.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" awstypes "github.com/aws/aws-sdk-go-v2/service/ec2/types" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) const ( @@ -23,7 +23,7 @@ func statusAvailabilityZoneGroupOptInStatus(ctx context.Context, conn *ec2.Clien return func() (any, string, error) { output, err := findAvailabilityZoneGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -39,7 +39,7 @@ func statusCapacityReservation(ctx context.Context, conn *ec2.Client, id string) return func() (any, string, error) { output, err := findCapacityReservationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -55,7 +55,7 @@ func statusCarrierGateway(ctx context.Context, conn *ec2.Client, id string) sdkr return func() (any, string, error) { output, err := findCarrierGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -74,7 +74,7 @@ func statusFleet(ctx context.Context, conn *ec2.Client, id string) sdkretry.Stat FleetIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -90,7 +90,7 @@ func statusHost(ctx context.Context, conn *ec2.Client, id string) sdkretry.State return func() (any, string, error) { output, err := findHostByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -109,7 +109,7 @@ func statusInstance(ctx context.Context, conn *ec2.Client, id string) sdkretry.S InstanceIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -125,7 +125,7 @@ func statusInstanceIAMInstanceProfile(ctx context.Context, conn *ec2.Client, id return func() (any, string, error) { instance, err := findInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -151,7 +151,7 @@ func statusInstanceCapacityReservationSpecificationEquals(ctx context.Context, c return func() (any, string, error) { output, err := findInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -167,7 +167,7 @@ func statusInstanceMaintenanceOptionsAutoRecovery(ctx context.Context, conn *ec2 return func() (any, string, error) { output, err := findInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -187,7 +187,7 @@ func statusInstanceMetadataOptions(ctx context.Context, conn *ec2.Client, id str return func() (any, string, error) { output, err := findInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -207,7 +207,7 @@ func statusInstanceRootBlockDeviceDeleteOnTermination(ctx context.Context, conn return func() (any, string, error) { output, err := findInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -235,7 +235,7 @@ func statusLaunchTemplate(ctx context.Context, conn *ec2.Client, id string, idIs output, err = findLaunchTemplateByID(ctx, conn, id) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -251,7 +251,7 @@ func statusLocalGatewayRoute(ctx context.Context, conn *ec2.Client, localGateway return func() (any, string, error) { output, err := findLocalGatewayRouteByTwoPartKey(ctx, conn, localGatewayRouteTableID, destinationCIDRBlock) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -267,7 +267,7 @@ func statusLocalGatewayRouteTableVPCAssociation(ctx context.Context, conn *ec2.C return func() (any, string, error) { output, err := findLocalGatewayRouteTableVPCAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -283,7 +283,7 @@ func statusManagedPrefixListState(ctx context.Context, conn *ec2.Client, id stri return func() (any, string, error) { output, err := findManagedPrefixListByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -299,7 +299,7 @@ func statusPlacementGroup(ctx context.Context, conn *ec2.Client, name string) sd return func() (any, string, error) { output, err := findPlacementGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -319,7 +319,7 @@ func statusSecurityGroup(ctx context.Context, conn *ec2.Client, id string) sdkre return func() (any, string, error) { output, err := findSecurityGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -335,7 +335,7 @@ func statusSecurityGroupVPCAssociation(ctx context.Context, conn *ec2.Client, gr return func() (any, string, error) { output, err := findSecurityGroupVPCAssociationByTwoPartKey(ctx, conn, groupID, vpcID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -351,7 +351,7 @@ func statusSpotFleetActivityStatus(ctx context.Context, conn *ec2.Client, id str return func() (any, string, error) { output, err := findSpotFleetRequestByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -370,7 +370,7 @@ func statusSpotFleetRequest(ctx context.Context, conn *ec2.Client, id string) sd SpotFleetRequestIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -386,7 +386,7 @@ func statusSpotInstanceRequest(ctx context.Context, conn *ec2.Client, id string) return func() (any, string, error) { output, err := findSpotInstanceRequestByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -402,7 +402,7 @@ func statusSubnetState(ctx context.Context, conn *ec2.Client, id string) sdkretr return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -418,7 +418,7 @@ func statusSubnetIPv6CIDRBlockAssociationState(ctx context.Context, conn *ec2.Cl return func() (any, string, error) { output, err := findSubnetIPv6CIDRBlockAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -434,7 +434,7 @@ func statusSubnetAssignIPv6AddressOnCreation(ctx context.Context, conn *ec2.Clie return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -450,7 +450,7 @@ func statusSubnetEnableDNS64(ctx context.Context, conn *ec2.Client, id string) s return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -466,7 +466,7 @@ func statusSubnetEnableLniAtDeviceIndex(ctx context.Context, conn *ec2.Client, i return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -482,7 +482,7 @@ func statusSubnetEnableResourceNameDNSAAAARecordOnLaunch(ctx context.Context, co return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -498,7 +498,7 @@ func statusSubnetEnableResourceNameDNSARecordOnLaunch(ctx context.Context, conn return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -514,7 +514,7 @@ func statusSubnetMapCustomerOwnedIPOnLaunch(ctx context.Context, conn *ec2.Clien return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -530,7 +530,7 @@ func statusSubnetMapPublicIPOnLaunch(ctx context.Context, conn *ec2.Client, id s return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -546,7 +546,7 @@ func statusSubnetPrivateDNSHostnameTypeOnLaunch(ctx context.Context, conn *ec2.C return func() (any, string, error) { output, err := findSubnetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -562,7 +562,7 @@ func statusVolume(ctx context.Context, conn *ec2.Client, id string) sdkretry.Sta return func() (any, string, error) { output, err := findEBSVolumeByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -578,7 +578,7 @@ func statusVolumeAttachment(ctx context.Context, conn *ec2.Client, volumeID, ins return func() (any, string, error) { output, err := findVolumeAttachment(ctx, conn, volumeID, instanceID, deviceName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -597,7 +597,7 @@ func statusVolumeAttachmentInstanceState(ctx context.Context, conn *ec2.Client, InstanceIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -613,7 +613,7 @@ func statusVolumeModification(ctx context.Context, conn *ec2.Client, id string) return func() (any, string, error) { output, err := findVolumeModificationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -629,7 +629,7 @@ func statusVPC(ctx context.Context, conn *ec2.Client, id string) sdkretry.StateR return func() (any, string, error) { output, err := findVPCByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -645,7 +645,7 @@ func statusVPCCIDRBlockAssociationState(ctx context.Context, conn *ec2.Client, i return func() (any, string, error) { output, _, err := findVPCCIDRBlockAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -661,7 +661,7 @@ func statusVPCIPv6CIDRBlockAssociation(ctx context.Context, conn *ec2.Client, id return func() (any, string, error) { output, _, err := findVPCIPv6CIDRBlockAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -677,7 +677,7 @@ func statusVPCAttributeValue(ctx context.Context, conn *ec2.Client, id string, a return func() (any, string, error) { attributeValue, err := findVPCAttribute(ctx, conn, id, attribute) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -693,7 +693,7 @@ func statusNetworkInterface(ctx context.Context, conn *ec2.Client, id string) sd return func() (any, string, error) { output, err := findNetworkInterfaceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -709,7 +709,7 @@ func statusNetworkInterfaceAttachment(ctx context.Context, conn *ec2.Client, id return func() (any, string, error) { output, err := findNetworkInterfaceAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -725,7 +725,7 @@ func statusNetworkInterfacePermission(ctx context.Context, conn *ec2.Client, id return func() (any, string, error) { output, err := findNetworkInterfacePermissionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -741,7 +741,7 @@ func statusVPCEndpoint(ctx context.Context, conn *ec2.Client, id string) sdkretr return func() (any, string, error) { output, err := findVPCEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -761,7 +761,7 @@ func statusRoute(ctx context.Context, conn *ec2.Client, routeFinder routeFinder, return func() (any, string, error) { output, err := routeFinder(ctx, conn, routeTableID, destination) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -781,7 +781,7 @@ func statusRouteTable(ctx context.Context, conn *ec2.Client, id string) sdkretry return func() (any, string, error) { output, err := findRouteTableByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -797,7 +797,7 @@ func statusRouteTableAssociation(ctx context.Context, conn *ec2.Client, id strin return func() (any, string, error) { output, err := findRouteTableAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -824,7 +824,7 @@ func statusVPCEndpointServiceAvailable(ctx context.Context, conn *ec2.Client, id ServiceIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -840,7 +840,7 @@ func fetchVPCEndpointServiceDeletionStatus(ctx context.Context, conn *ec2.Client return func() (any, string, error) { output, err := findVPCEndpointServiceConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -860,7 +860,7 @@ func statusVPCEndpointRouteTableAssociation(ctx context.Context, conn *ec2.Clien return func() (any, string, error) { err := findVPCEndpointRouteTableAssociationExists(ctx, conn, vpcEndpointID, routeTableID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -876,7 +876,7 @@ func statusVPCEndpointConnectionVPCEndpoint(ctx context.Context, conn *ec2.Clien return func() (any, string, error) { output, err := findVPCEndpointConnectionByServiceIDAndVPCEndpointID(ctx, conn, serviceID, vpcEndpointID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -892,7 +892,7 @@ func statusVPCEndpointServicePrivateDNSNameConfiguration(ctx context.Context, co return func() (any, string, error) { output, err := findVPCEndpointServicePrivateDNSNameConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -911,7 +911,7 @@ func statusVPCPeeringConnectionActive(ctx context.Context, conn *ec2.Client, id VpcPeeringConnectionIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -927,7 +927,7 @@ func statusVPCPeeringConnectionDeleted(ctx context.Context, conn *ec2.Client, id return func() (any, string, error) { output, err := findVPCPeeringConnectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -943,7 +943,7 @@ func statusClientVPNEndpoint(ctx context.Context, conn *ec2.Client, id string) s return func() (any, string, error) { output, err := findClientVPNEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -959,7 +959,7 @@ func statusClientVPNEndpointClientConnectResponseOptions(ctx context.Context, co return func() (any, string, error) { output, err := findClientVPNEndpointClientConnectResponseOptionsByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -975,7 +975,7 @@ func statusClientVPNAuthorizationRule(ctx context.Context, conn *ec2.Client, end return func() (any, string, error) { output, err := findClientVPNAuthorizationRuleByThreePartKey(ctx, conn, endpointID, targetNetworkCIDR, accessGroupID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -991,7 +991,7 @@ func statusClientVPNNetworkAssociation(ctx context.Context, conn *ec2.Client, as return func() (any, string, error) { output, err := findClientVPNNetworkAssociationByTwoPartKey(ctx, conn, associationID, endpointID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1007,7 +1007,7 @@ func statusClientVPNRoute(ctx context.Context, conn *ec2.Client, endpointID, tar return func() (any, string, error) { output, err := findClientVPNRouteByThreePartKey(ctx, conn, endpointID, targetSubnetID, destinationCIDR) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1023,7 +1023,7 @@ func statusVPNConnection(ctx context.Context, conn *ec2.Client, id string) sdkre return func() (any, string, error) { output, err := findVPNConnectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1039,7 +1039,7 @@ func statusVPNConnectionRoute(ctx context.Context, conn *ec2.Client, vpnConnecti return func() (any, string, error) { output, err := findVPNConnectionRouteByTwoPartKey(ctx, conn, vpnConnectionID, cidrBlock) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1055,7 +1055,7 @@ func statusVPNGateway(ctx context.Context, conn *ec2.Client, id string) sdkretry return func() (any, string, error) { output, err := findVPNGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1071,7 +1071,7 @@ func statusVPNGatewayVPCAttachment(ctx context.Context, conn *ec2.Client, vpnGat return func() (any, string, error) { output, err := findVPNGatewayVPCAttachmentByTwoPartKey(ctx, conn, vpnGatewayID, vpcID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1087,7 +1087,7 @@ func statusVPNConcentrator(ctx context.Context, conn *ec2.Client, id string) sdk return func() (any, string, error) { output, err := findVPNConcentratorByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1103,7 +1103,7 @@ func statusCustomerGateway(ctx context.Context, conn *ec2.Client, id string) sdk return func() (any, string, error) { output, err := findCustomerGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1119,7 +1119,7 @@ func statusInternetGatewayAttachmentState(ctx context.Context, conn *ec2.Client, return func() (any, string, error) { output, err := findInternetGatewayAttachment(ctx, conn, internetGatewayID, vpcID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1135,7 +1135,7 @@ func statusIPAM(ctx context.Context, conn *ec2.Client, id string) sdkretry.State return func() (any, string, error) { output, err := findIPAMByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1151,7 +1151,7 @@ func statusIPAMPool(ctx context.Context, conn *ec2.Client, id string) sdkretry.S return func() (any, string, error) { output, err := findIPAMPoolByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1168,7 +1168,7 @@ func statusIPAMPoolCIDR(ctx context.Context, conn *ec2.Client, cidrBlock, poolID if cidrBlock == "" { output, err := findIPAMPoolCIDRByPoolCIDRIDAndPoolID(ctx, conn, poolCIDRID, poolID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1181,7 +1181,7 @@ func statusIPAMPoolCIDR(ctx context.Context, conn *ec2.Client, cidrBlock, poolID output, err := findIPAMPoolCIDRByTwoPartKey(ctx, conn, cidrBlock, poolID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1197,7 +1197,7 @@ func statusIPAMResourceDiscovery(ctx context.Context, conn *ec2.Client, id strin return func() (any, string, error) { output, err := findIPAMResourceDiscoveryByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1213,7 +1213,7 @@ func statusIPAMResourceDiscoveryAssociation(ctx context.Context, conn *ec2.Clien return func() (any, string, error) { output, err := findIPAMResourceDiscoveryAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1229,7 +1229,7 @@ func statusIPAMScope(ctx context.Context, conn *ec2.Client, id string) sdkretry. return func() (any, string, error) { output, err := findIPAMScopeByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1245,7 +1245,7 @@ func statusImage(ctx context.Context, conn *ec2.Client, id string) sdkretry.Stat return func() (any, string, error) { output, err := findImageByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1261,7 +1261,7 @@ func statusImageBlockPublicAccess(ctx context.Context, conn *ec2.Client) sdkretr return func() (any, string, error) { output, err := findImageBlockPublicAccessState(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1277,7 +1277,7 @@ func statusTransitGateway(ctx context.Context, conn *ec2.Client, id string) sdkr return func() (any, string, error) { output, err := findTransitGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1293,7 +1293,7 @@ func statusTransitGatewayAttachment(ctx context.Context, conn *ec2.Client, id st return func() (any, string, error) { output, err := findTransitGatewayAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1309,7 +1309,7 @@ func statusTransitGatewayConnect(ctx context.Context, conn *ec2.Client, id strin return func() (any, string, error) { output, err := findTransitGatewayConnectByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1325,7 +1325,7 @@ func statusTransitGatewayConnectPeer(ctx context.Context, conn *ec2.Client, id s return func() (any, string, error) { output, err := findTransitGatewayConnectPeerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1341,7 +1341,7 @@ func statusTransitGatewayMulticastDomain(ctx context.Context, conn *ec2.Client, return func() (any, string, error) { output, err := findTransitGatewayMulticastDomainByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1357,7 +1357,7 @@ func statusTransitGatewayMulticastDomainAssociation(ctx context.Context, conn *e return func() (any, string, error) { output, err := findTransitGatewayMulticastDomainAssociationByThreePartKey(ctx, conn, multicastDomainID, attachmentID, subnetID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1376,7 +1376,7 @@ func statusTransitGatewayPeeringAttachment(ctx context.Context, conn *ec2.Client TransitGatewayAttachmentIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1392,7 +1392,7 @@ func statusTransitGatewayPrefixListReference(ctx context.Context, conn *ec2.Clie return func() (any, string, error) { output, err := findTransitGatewayPrefixListReferenceByTwoPartKey(ctx, conn, transitGatewayRouteTableID, prefixListID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1408,7 +1408,7 @@ func statusTransitGatewayStaticRoute(ctx context.Context, conn *ec2.Client, tran return func() (any, string, error) { output, err := findTransitGatewayStaticRoute(ctx, conn, transitGatewayRouteTableID, destination) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1424,7 +1424,7 @@ func statusTransitGatewayRouteTable(ctx context.Context, conn *ec2.Client, id st return func() (any, string, error) { output, err := findTransitGatewayRouteTableByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1440,7 +1440,7 @@ func statusTransitGatewayPolicyTable(ctx context.Context, conn *ec2.Client, id s return func() (any, string, error) { output, err := findTransitGatewayPolicyTableByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1456,7 +1456,7 @@ func statusTransitGatewayPolicyTableAssociation(ctx context.Context, conn *ec2.C return func() (any, string, error) { output, err := findTransitGatewayPolicyTableAssociationByTwoPartKey(ctx, conn, transitGatewayPolicyTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1472,7 +1472,7 @@ func statusTransitGatewayRouteTableAssociation(ctx context.Context, conn *ec2.Cl return func() (any, string, error) { output, err := findTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1488,7 +1488,7 @@ func statusTransitGatewayRouteTablePropagation(ctx context.Context, conn *ec2.Cl return func() (any, string, error) { output, err := findTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1507,7 +1507,7 @@ func statusTransitGatewayVPCAttachment(ctx context.Context, conn *ec2.Client, id TransitGatewayAttachmentIds: []string{id}, }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1523,7 +1523,7 @@ func statusEIPDomainNameAttribute(ctx context.Context, conn *ec2.Client, allocat return func() (any, string, error) { output, err := findEIPDomainNameAttributeByAllocationID(ctx, conn, allocationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1543,7 +1543,7 @@ func statusSnapshot(ctx context.Context, conn *ec2.Client, id string) sdkretry.S return func() (any, string, error) { output, err := findSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1559,7 +1559,7 @@ func statusSnapshotStorageTier(ctx context.Context, conn *ec2.Client, id string) return func() (any, string, error) { output, err := findSnapshotTierStatusBySnapshotID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1575,7 +1575,7 @@ func statusInstanceConnectEndpoint(ctx context.Context, conn *ec2.Client, id str return func() (any, string, error) { output, err := findInstanceConnectEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1591,7 +1591,7 @@ func statusVerifiedAccessEndpoint(ctx context.Context, conn *ec2.Client, id stri return func() (any, string, error) { output, err := findVerifiedAccessEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1607,7 +1607,7 @@ func statusFastSnapshotRestore(ctx context.Context, conn *ec2.Client, availabili return func() (any, string, error) { output, err := findFastSnapshotRestoreByTwoPartKey(ctx, conn, availabilityZone, snapshotID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1623,7 +1623,7 @@ func statusSnapshotImport(ctx context.Context, conn *ec2.Client, id string) sdkr return func() (any, string, error) { output, err := findImportSnapshotTaskByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1639,7 +1639,7 @@ func statusNATGatewayState(ctx context.Context, conn *ec2.Client, id string) sdk return func() (any, string, error) { output, err := findNATGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1655,7 +1655,7 @@ func statusNATGatewayAddressByNATGatewayIDAndAllocationID(ctx context.Context, c return func() (any, string, error) { output, err := findNATGatewayAddressByNATGatewayIDAndAllocationID(ctx, conn, natGatewayID, allocationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1671,7 +1671,7 @@ func statusNATGatewayAddressByNATGatewayIDAndPrivateIP(ctx context.Context, conn return func() (any, string, error) { output, err := findNATGatewayAddressByNATGatewayIDAndPrivateIP(ctx, conn, natGatewayID, privateIP) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1687,7 +1687,7 @@ func statusNetworkInsightsAnalysis(ctx context.Context, conn *ec2.Client, id str return func() (any, string, error) { output, err := findNetworkInsightsAnalysisByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1703,7 +1703,7 @@ func statusVPCBlockPublicAccessOptions(ctx context.Context, conn *ec2.Client) sd return func() (any, string, error) { output, err := findVPCBlockPublicAccessOptions(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1719,7 +1719,7 @@ func statusVPCBlockPublicAccessExclusion(ctx context.Context, conn *ec2.Client, return func() (any, string, error) { output, err := findVPCBlockPublicAccessExclusionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1735,7 +1735,7 @@ func statusRouteServer(ctx context.Context, conn *ec2.Client, id string) sdkretr return func() (any, string, error) { output, err := findRouteServerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1751,7 +1751,7 @@ func statusRouteServerAssociation(ctx context.Context, conn *ec2.Client, routeSe return func() (any, string, error) { output, err := findRouteServerAssociationByTwoPartKey(ctx, conn, routeServerID, vpcID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1767,7 +1767,7 @@ func statusRouteServerEndpoint(ctx context.Context, conn *ec2.Client, id string) return func() (any, string, error) { output, err := findRouteServerEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1783,7 +1783,7 @@ func statusRouteServerPeer(ctx context.Context, conn *ec2.Client, id string) sdk return func() (any, string, error) { output, err := findRouteServerPeerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1799,7 +1799,7 @@ func statusRouteServerPropagation(ctx context.Context, conn *ec2.Client, routeSe return func() (any, string, error) { output, err := findRouteServerPropagationByTwoPartKey(ctx, conn, routeServerID, routeTableID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ec2/tag_gen.go b/internal/service/ec2/tag_gen.go index 379e83ed60b..d1da840becc 100644 --- a/internal/service/ec2/tag_gen.go +++ b/internal/service/ec2/tag_gen.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -74,7 +74,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, meta any) diag value, err := findTag(ctx, conn, identifier, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] %s resource (%s) tag (%s) not found, removing from state", names.EC2, identifier, key) d.SetId("") return diags diff --git a/internal/service/ec2/tag_gen_test.go b/internal/service/ec2/tag_gen_test.go index 0c86ef00994..b1336c02daa 100644 --- a/internal/service/ec2/tag_gen_test.go +++ b/internal/service/ec2/tag_gen_test.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -32,7 +32,7 @@ func testAccCheckTagDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfec2.FindTag(ctx, conn, identifier, key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_.go b/internal/service/ec2/transitgateway_.go index 0a761d5d81f..dc44c702ab6 100644 --- a/internal/service/ec2/transitgateway_.go +++ b/internal/service/ec2/transitgateway_.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -199,7 +200,7 @@ func resourceTransitGatewayRead(ctx context.Context, d *schema.ResourceData, met transitGateway, err := findTransitGatewayByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_connect.go b/internal/service/ec2/transitgateway_connect.go index 3e07d4e9702..8e7637d2956 100644 --- a/internal/service/ec2/transitgateway_connect.go +++ b/internal/service/ec2/transitgateway_connect.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func resourceTransitGatewayConnectRead(ctx context.Context, d *schema.ResourceDa transitGatewayConnect, err := findTransitGatewayConnectByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Connect %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -171,7 +171,7 @@ func resourceTransitGatewayConnectRead(ctx context.Context, d *schema.ResourceDa if transitGatewayRouteTableID := aws.ToString(transitGateway.Options.AssociationDefaultRouteTableId); transitGatewayRouteTableID != "" { _, err := findTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { transitGatewayDefaultRouteTableAssociation = false } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route Table Association (%s): %s", transitGatewayRouteTableAssociationCreateResourceID(transitGatewayRouteTableID, d.Id()), err) @@ -183,7 +183,7 @@ func resourceTransitGatewayConnectRead(ctx context.Context, d *schema.ResourceDa if transitGatewayRouteTableID := aws.ToString(transitGateway.Options.PropagationDefaultRouteTableId); transitGatewayRouteTableID != "" { _, err := findTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { transitGatewayDefaultRouteTablePropagation = false } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route Table Propagation (%s): %s", transitGatewayRouteTablePropagationCreateResourceID(transitGatewayRouteTableID, d.Id()), err) diff --git a/internal/service/ec2/transitgateway_connect_peer.go b/internal/service/ec2/transitgateway_connect_peer.go index 9bf281c828b..f85e8949fa6 100644 --- a/internal/service/ec2/transitgateway_connect_peer.go +++ b/internal/service/ec2/transitgateway_connect_peer.go @@ -20,9 +20,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -164,7 +164,7 @@ func resourceTransitGatewayConnectPeerRead(ctx context.Context, d *schema.Resour transitGatewayConnectPeer, err := findTransitGatewayConnectPeerByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Connect Peer %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_connect_peer_test.go b/internal/service/ec2/transitgateway_connect_peer_test.go index 70bf3798127..2033512d2bb 100644 --- a/internal/service/ec2/transitgateway_connect_peer_test.go +++ b/internal/service/ec2/transitgateway_connect_peer_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -262,7 +262,7 @@ func testAccCheckTransitGatewayConnectPeerDestroy(ctx context.Context) resource. _, err := tfec2.FindTransitGatewayConnectPeerByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_connect_test.go b/internal/service/ec2/transitgateway_connect_test.go index 1be9098af2c..3c07c0ccbae 100644 --- a/internal/service/ec2/transitgateway_connect_test.go +++ b/internal/service/ec2/transitgateway_connect_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -325,7 +325,7 @@ func testAccCheckTransitGatewayConnectDestroy(ctx context.Context) resource.Test _, err := tfec2.FindTransitGatewayConnectByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_default_route_table_association.go b/internal/service/ec2/transitgateway_default_route_table_association.go index 63057c2ef83..93eca36b79e 100644 --- a/internal/service/ec2/transitgateway_default_route_table_association.go +++ b/internal/service/ec2/transitgateway_default_route_table_association.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +128,7 @@ func (r *transitGatewayDefaultRouteTableAssociationResource) Read(ctx context.Co tgw, err := findTransitGatewayByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/ec2/transitgateway_default_route_table_association_test.go b/internal/service/ec2/transitgateway_default_route_table_association_test.go index 1b6fd44e48e..95698fe0b35 100644 --- a/internal/service/ec2/transitgateway_default_route_table_association_test.go +++ b/internal/service/ec2/transitgateway_default_route_table_association_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func testAccCheckTransitGatewayDefaultRouteTableAssociationDestroy(ctx context.C output, err := tfec2.FindTransitGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_default_route_table_propagation.go b/internal/service/ec2/transitgateway_default_route_table_propagation.go index a0605e688a7..0298498069d 100644 --- a/internal/service/ec2/transitgateway_default_route_table_propagation.go +++ b/internal/service/ec2/transitgateway_default_route_table_propagation.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +128,7 @@ func (r *transitGatewayDefaultRouteTablePropagationResource) Read(ctx context.Co tgw, err := findTransitGatewayByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/ec2/transitgateway_default_route_table_propagation_test.go b/internal/service/ec2/transitgateway_default_route_table_propagation_test.go index caa661ab51e..ed0e0f21388 100644 --- a/internal/service/ec2/transitgateway_default_route_table_propagation_test.go +++ b/internal/service/ec2/transitgateway_default_route_table_propagation_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -125,7 +125,7 @@ func testAccCheckTransitGatewayDefaultRouteTablePropagationDestroy(ctx context.C output, err := tfec2.FindTransitGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_multicast_domain.go b/internal/service/ec2/transitgateway_multicast_domain.go index 0f5f4d2f681..5cf6c88fbe0 100644 --- a/internal/service/ec2/transitgateway_multicast_domain.go +++ b/internal/service/ec2/transitgateway_multicast_domain.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func resourceTransitGatewayMulticastDomainRead(ctx context.Context, d *schema.Re multicastDomain, err := findTransitGatewayMulticastDomainByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Multicast Domain %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -156,7 +156,7 @@ func resourceTransitGatewayMulticastDomainDelete(ctx context.Context, d *schema. TransitGatewayMulticastDomainId: aws.String(d.Id()), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { err = nil } @@ -188,7 +188,7 @@ func resourceTransitGatewayMulticastDomainDelete(ctx context.Context, d *schema. TransitGatewayMulticastDomainId: aws.String(d.Id()), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { err = nil } diff --git a/internal/service/ec2/transitgateway_multicast_domain_association.go b/internal/service/ec2/transitgateway_multicast_domain_association.go index 2e8421c8a1e..ed83e3f30ba 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_association.go +++ b/internal/service/ec2/transitgateway_multicast_domain_association.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func resourceTransitGatewayMulticastDomainAssociationRead(ctx context.Context, d multicastDomainAssociation, err := findTransitGatewayMulticastDomainAssociationByThreePartKey(ctx, conn, multicastDomainID, attachmentID, subnetID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Multicast Domain Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_multicast_domain_association_test.go b/internal/service/ec2/transitgateway_multicast_domain_association_test.go index 3776380b6d8..9ec8864a0a8 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_association_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -163,7 +163,7 @@ func testAccCheckTransitGatewayMulticastDomainAssociationDestroy(ctx context.Con _, err := tfec2.FindTransitGatewayMulticastDomainAssociationByThreePartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_multicast_domain_id"], rs.Primary.Attributes[names.AttrTransitGatewayAttachmentID], rs.Primary.Attributes[names.AttrSubnetID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_multicast_domain_test.go b/internal/service/ec2/transitgateway_multicast_domain_test.go index 4f9f4e12963..cfe94d5ed95 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -205,7 +205,7 @@ func testAccCheckTransitGatewayMulticastDomainDestroy(ctx context.Context) resou _, err := tfec2.FindTransitGatewayMulticastDomainByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_multicast_group_member.go b/internal/service/ec2/transitgateway_multicast_group_member.go index 89396d32705..4f1ab2a43d1 100644 --- a/internal/service/ec2/transitgateway_multicast_group_member.go +++ b/internal/service/ec2/transitgateway_multicast_group_member.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -89,7 +90,7 @@ func resourceTransitGatewayMulticastGroupMemberRead(ctx context.Context, d *sche return findTransitGatewayMulticastGroupMemberByThreePartKey(ctx, conn, multicastDomainID, groupIPAddress, eniID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Multicast Group Member %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_multicast_group_member_test.go b/internal/service/ec2/transitgateway_multicast_group_member_test.go index 103276e8259..c8ef7c8039d 100644 --- a/internal/service/ec2/transitgateway_multicast_group_member_test.go +++ b/internal/service/ec2/transitgateway_multicast_group_member_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -163,7 +163,7 @@ func testAccCheckTransitGatewayMulticastGroupMemberDestroy(ctx context.Context) _, err := tfec2.FindTransitGatewayMulticastGroupMemberByThreePartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_multicast_domain_id"], rs.Primary.Attributes["group_ip_address"], rs.Primary.Attributes[names.AttrNetworkInterfaceID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_multicast_group_source.go b/internal/service/ec2/transitgateway_multicast_group_source.go index 44eb3a50302..21627ea863f 100644 --- a/internal/service/ec2/transitgateway_multicast_group_source.go +++ b/internal/service/ec2/transitgateway_multicast_group_source.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -91,7 +92,7 @@ func resourceTransitGatewayMulticastGroupSourceRead(ctx context.Context, d *sche return findTransitGatewayMulticastGroupSourceByThreePartKey(ctx, conn, multicastDomainID, groupIPAddress, eniID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Multicast Group Source %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_multicast_group_source_test.go b/internal/service/ec2/transitgateway_multicast_group_source_test.go index ba659893259..bc4d231af8c 100644 --- a/internal/service/ec2/transitgateway_multicast_group_source_test.go +++ b/internal/service/ec2/transitgateway_multicast_group_source_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +135,7 @@ func testAccCheckTransitGatewayMulticastGroupSourceDestroy(ctx context.Context) _, err := tfec2.FindTransitGatewayMulticastGroupSourceByThreePartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_multicast_domain_id"], rs.Primary.Attributes["group_ip_address"], rs.Primary.Attributes[names.AttrNetworkInterfaceID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_peering_attachment.go b/internal/service/ec2/transitgateway_peering_attachment.go index c3c6846d8a5..3e749b933ad 100644 --- a/internal/service/ec2/transitgateway_peering_attachment.go +++ b/internal/service/ec2/transitgateway_peering_attachment.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +131,7 @@ func resourceTransitGatewayPeeringAttachmentRead(ctx context.Context, d *schema. transitGatewayPeeringAttachment, err := findTransitGatewayPeeringAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Peering Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_peering_attachment_accepter.go b/internal/service/ec2/transitgateway_peering_attachment_accepter.go index 561a7f826e0..24c114b39f2 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_accepter.go +++ b/internal/service/ec2/transitgateway_peering_attachment_accepter.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func resourceTransitGatewayPeeringAttachmentAccepterRead(ctx context.Context, d transitGatewayPeeringAttachment, err := findTransitGatewayPeeringAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Peering Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_peering_attachment_test.go b/internal/service/ec2/transitgateway_peering_attachment_test.go index 8973af086e9..ccadda15551 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -266,7 +266,7 @@ func testAccCheckTransitGatewayPeeringAttachmentDestroy(ctx context.Context) res _, err := tfec2.FindTransitGatewayPeeringAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_policy_table.go b/internal/service/ec2/transitgateway_policy_table.go index 3ceacb77340..317ce449d2c 100644 --- a/internal/service/ec2/transitgateway_policy_table.go +++ b/internal/service/ec2/transitgateway_policy_table.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +89,7 @@ func resourceTransitGatewayPolicyTableRead(ctx context.Context, d *schema.Resour transitGatewayPolicyTable, err := findTransitGatewayPolicyTableByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Policy Table (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_policy_table_association.go b/internal/service/ec2/transitgateway_policy_table_association.go index b10dbca92a2..0d975ce7cdb 100644 --- a/internal/service/ec2/transitgateway_policy_table_association.go +++ b/internal/service/ec2/transitgateway_policy_table_association.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func resourceTransitGatewayPolicyTableAssociationRead(ctx context.Context, d *sc transitGatewayPolicyTableAssociation, err := findTransitGatewayPolicyTableAssociationByTwoPartKey(ctx, conn, transitGatewayPolicyTableID, transitGatewayAttachmentID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Policy Table Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_policy_table_association_test.go b/internal/service/ec2/transitgateway_policy_table_association_test.go index 01745b561ae..7f6ab9684cd 100644 --- a/internal/service/ec2/transitgateway_policy_table_association_test.go +++ b/internal/service/ec2/transitgateway_policy_table_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckTransitGatewayPolicyTableAssociationDestroy(ctx context.Context _, err := tfec2.FindTransitGatewayPolicyTableAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_policy_table_id"], rs.Primary.Attributes[names.AttrTransitGatewayAttachmentID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_policy_table_test.go b/internal/service/ec2/transitgateway_policy_table_test.go index e5f0243eb08..b670581cb70 100644 --- a/internal/service/ec2/transitgateway_policy_table_test.go +++ b/internal/service/ec2/transitgateway_policy_table_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -206,7 +206,7 @@ func testAccCheckTransitGatewayPolicyTableDestroy(ctx context.Context) resource. _, err := tfec2.FindTransitGatewayPolicyTableByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_prefix_list_reference.go b/internal/service/ec2/transitgateway_prefix_list_reference.go index 206e856beec..b3333fb2641 100644 --- a/internal/service/ec2/transitgateway_prefix_list_reference.go +++ b/internal/service/ec2/transitgateway_prefix_list_reference.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func resourceTransitGatewayPrefixListReferenceRead(ctx context.Context, d *schem transitGatewayPrefixListReference, err := findTransitGatewayPrefixListReferenceByTwoPartKey(ctx, conn, transitGatewayRouteTableID, prefixListID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Prefix List Reference (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_prefix_list_reference_test.go b/internal/service/ec2/transitgateway_prefix_list_reference_test.go index b9eaa352466..8b359acd7c4 100644 --- a/internal/service/ec2/transitgateway_prefix_list_reference_test.go +++ b/internal/service/ec2/transitgateway_prefix_list_reference_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -168,7 +168,7 @@ func testAccCheckTransitGatewayPrefixListReferenceDestroy(ctx context.Context) r _, err := tfec2.FindTransitGatewayPrefixListReferenceByTwoPartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_route_table_id"], rs.Primary.Attributes["prefix_list_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_route.go b/internal/service/ec2/transitgateway_route.go index c0d306c0d54..7eb78d06338 100644 --- a/internal/service/ec2/transitgateway_route.go +++ b/internal/service/ec2/transitgateway_route.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -106,7 +107,7 @@ func resourceTransitGatewayRouteRead(ctx context.Context, d *schema.ResourceData return findTransitGatewayStaticRoute(ctx, conn, transitGatewayRouteTableID, destination) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Route %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_route_table.go b/internal/service/ec2/transitgateway_route_table.go index 6eb706e5cd1..0209d13e6dd 100644 --- a/internal/service/ec2/transitgateway_route_table.go +++ b/internal/service/ec2/transitgateway_route_table.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func resourceTransitGatewayRouteTableRead(ctx context.Context, d *schema.Resourc transitGatewayRouteTable, err := findTransitGatewayRouteTableByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Route Table (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/transitgateway_route_table_association.go b/internal/service/ec2/transitgateway_route_table_association.go index 252c0160466..a1fdd8734b5 100644 --- a/internal/service/ec2/transitgateway_route_table_association.go +++ b/internal/service/ec2/transitgateway_route_table_association.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func resourceTransitGatewayRouteTableAssociationRead(ctx context.Context, d *sch transitGatewayRouteTableAssociation, err := findTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Route Table Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -176,7 +176,7 @@ func transitGatewayRouteTableAssociationUpdate(ctx context.Context, conn *ec2.Cl id := transitGatewayRouteTableAssociationCreateResourceID(transitGatewayRouteTableID, transitGatewayAttachmentID) _, err := findTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { if associate { input := &ec2.AssociateTransitGatewayRouteTableInput{ TransitGatewayAttachmentId: aws.String(transitGatewayAttachmentID), diff --git a/internal/service/ec2/transitgateway_route_table_association_test.go b/internal/service/ec2/transitgateway_route_table_association_test.go index 9127862709f..bf30a2c7306 100644 --- a/internal/service/ec2/transitgateway_route_table_association_test.go +++ b/internal/service/ec2/transitgateway_route_table_association_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -259,7 +259,7 @@ func testAccCheckTransitGatewayRouteTableAssociationDestroy(ctx context.Context) _, err := tfec2.FindTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_route_table_id"], rs.Primary.Attributes[names.AttrTransitGatewayAttachmentID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_route_table_propagation.go b/internal/service/ec2/transitgateway_route_table_propagation.go index 4da71edad6c..953f258fa23 100644 --- a/internal/service/ec2/transitgateway_route_table_propagation.go +++ b/internal/service/ec2/transitgateway_route_table_propagation.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func resourceTransitGatewayRouteTablePropagationRead(ctx context.Context, d *sch transitGatewayPropagation, err := findTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway Route Table Propagation %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -155,7 +155,7 @@ func transitGatewayRouteTablePropagationUpdate(ctx context.Context, conn *ec2.Cl id := transitGatewayRouteTablePropagationCreateResourceID(transitGatewayRouteTableID, transitGatewayAttachmentID) _, err := findTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { if enable { input := &ec2.EnableTransitGatewayRouteTablePropagationInput{ TransitGatewayAttachmentId: aws.String(transitGatewayAttachmentID), diff --git a/internal/service/ec2/transitgateway_route_table_propagation_test.go b/internal/service/ec2/transitgateway_route_table_propagation_test.go index fa04407bf59..f9bcaa6e10c 100644 --- a/internal/service/ec2/transitgateway_route_table_propagation_test.go +++ b/internal/service/ec2/transitgateway_route_table_propagation_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -200,7 +200,7 @@ func testAccCheckTransitGatewayRouteTablePropagationDestroy(ctx context.Context) _, err := tfec2.FindTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, rs.Primary.Attributes["transit_gateway_route_table_id"], rs.Primary.Attributes[names.AttrTransitGatewayAttachmentID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_route_table_test.go b/internal/service/ec2/transitgateway_route_table_test.go index 544d582f4ee..86df63170a2 100644 --- a/internal/service/ec2/transitgateway_route_table_test.go +++ b/internal/service/ec2/transitgateway_route_table_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func testAccCheckTransitGatewayRouteTableDestroy(ctx context.Context) resource.T _, err := tfec2.FindTransitGatewayRouteTableByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_route_test.go b/internal/service/ec2/transitgateway_route_test.go index 8d54cfb6876..f6713870cd9 100644 --- a/internal/service/ec2/transitgateway_route_test.go +++ b/internal/service/ec2/transitgateway_route_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -219,7 +219,7 @@ func testAccCheckTransitGatewayRouteDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindTransitGatewayStaticRoute(ctx, conn, rs.Primary.Attributes["transit_gateway_route_table_id"], rs.Primary.Attributes["destination_cidr_block"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/transitgateway_test.go b/internal/service/ec2/transitgateway_test.go index 74231560712..e23d96cc402 100644 --- a/internal/service/ec2/transitgateway_test.go +++ b/internal/service/ec2/transitgateway_test.go @@ -25,8 +25,8 @@ import ( tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -820,7 +820,7 @@ func testAccCheckTransitGatewayDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindTransitGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -875,7 +875,7 @@ func testAccCheckTransitGatewayAssociationDefaultRouteTableAttachmentAssociated( _, err := tfec2.FindTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return errors.New("EC2 Transit Gateway Route Table Association not found") } @@ -903,7 +903,7 @@ func testAccCheckTransitGatewayAssociationDefaultRouteTableAttachmentNotAssociat _, err := tfec2.FindTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } @@ -935,7 +935,7 @@ func testAccCheckTransitGatewayPropagationDefaultRouteTableAttachmentPropagated( _, err := tfec2.FindTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return errors.New("EC2 Transit Gateway Route Table Propagation not enabled") } @@ -963,7 +963,7 @@ func testAccCheckTransitGatewayPropagationDefaultRouteTableAttachmentNotPropagat _, err := tfec2.FindTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, transitGatewayAttachmentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/ec2/transitgateway_vpc_attachment.go b/internal/service/ec2/transitgateway_vpc_attachment.go index 25a5cb859a4..06f15f99871 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment.go +++ b/internal/service/ec2/transitgateway_vpc_attachment.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -175,7 +175,7 @@ func resourceTransitGatewayVPCAttachmentRead(ctx context.Context, d *schema.Reso transitGatewayVPCAttachment, err := findTransitGatewayVPCAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway VPC Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -200,7 +200,7 @@ func resourceTransitGatewayVPCAttachmentRead(ctx context.Context, d *schema.Reso if transitGatewayRouteTableID := aws.ToString(transitGateway.Options.AssociationDefaultRouteTableId); transitGatewayRouteTableID != "" { _, err := findTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { transitGatewayDefaultRouteTableAssociation = false } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route Table Association (%s): %s", transitGatewayRouteTableAssociationCreateResourceID(transitGatewayRouteTableID, d.Id()), err) @@ -212,7 +212,7 @@ func resourceTransitGatewayVPCAttachmentRead(ctx context.Context, d *schema.Reso if transitGatewayRouteTableID := aws.ToString(transitGateway.Options.PropagationDefaultRouteTableId); transitGatewayRouteTableID != "" { _, err := findTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { transitGatewayDefaultRouteTablePropagation = false } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route Table Propagation (%s): %s", transitGatewayRouteTablePropagationCreateResourceID(transitGatewayRouteTableID, d.Id()), err) diff --git a/internal/service/ec2/transitgateway_vpc_attachment_accepter.go b/internal/service/ec2/transitgateway_vpc_attachment_accepter.go index 83069c4c2c7..edc2e0947b0 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_accepter.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_accepter.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func resourceTransitGatewayVPCAttachmentAccepterRead(ctx context.Context, d *sch transitGatewayVPCAttachment, err := findTransitGatewayVPCAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Transit Gateway VPC Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -161,7 +161,7 @@ func resourceTransitGatewayVPCAttachmentAccepterRead(ctx context.Context, d *sch if transitGatewayRouteTableID := aws.ToString(transitGateway.Options.AssociationDefaultRouteTableId); transitGatewayRouteTableID != "" { _, err := findTransitGatewayRouteTableAssociationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { transitGatewayDefaultRouteTableAssociation = false } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route Table Association (%s): %s", transitGatewayRouteTableAssociationCreateResourceID(transitGatewayRouteTableID, d.Id()), err) @@ -173,7 +173,7 @@ func resourceTransitGatewayVPCAttachmentAccepterRead(ctx context.Context, d *sch if transitGatewayRouteTableID := aws.ToString(transitGateway.Options.PropagationDefaultRouteTableId); transitGatewayRouteTableID != "" { _, err := findTransitGatewayRouteTablePropagationByTwoPartKey(ctx, conn, transitGatewayRouteTableID, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { transitGatewayDefaultRouteTablePropagation = false } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route Table Propagation (%s): %s", transitGatewayRouteTablePropagationCreateResourceID(transitGatewayRouteTableID, d.Id()), err) diff --git a/internal/service/ec2/transitgateway_vpc_attachment_test.go b/internal/service/ec2/transitgateway_vpc_attachment_test.go index c7eeffae1be..5c7b46b8d7a 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_test.go @@ -23,8 +23,8 @@ import ( tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -701,7 +701,7 @@ func testAccCheckTransitGatewayVPCAttachmentDestroy(ctx context.Context) resourc _, err := tfec2.FindTransitGatewayVPCAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/verifiedaccess_endpoint.go b/internal/service/ec2/verifiedaccess_endpoint.go index 6c8d9c8e49c..63a3dcf6d8c 100644 --- a/internal/service/ec2/verifiedaccess_endpoint.go +++ b/internal/service/ec2/verifiedaccess_endpoint.go @@ -20,9 +20,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -390,7 +390,7 @@ func resourceVerifiedAccessEndpointRead(ctx context.Context, d *schema.ResourceD ep, err := findVerifiedAccessEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Verified Access Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/verifiedaccess_endpoint_test.go b/internal/service/ec2/verifiedaccess_endpoint_test.go index a170b3d5310..03949e2a6ac 100644 --- a/internal/service/ec2/verifiedaccess_endpoint_test.go +++ b/internal/service/ec2/verifiedaccess_endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -559,7 +559,7 @@ func testAccCheckVerifiedAccessEndpointDestroy(ctx context.Context) resource.Tes _, err := tfec2.FindVerifiedAccessEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/verifiedaccess_group.go b/internal/service/ec2/verifiedaccess_group.go index 0a93eabd848..94cf9543c8a 100644 --- a/internal/service/ec2/verifiedaccess_group.go +++ b/internal/service/ec2/verifiedaccess_group.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func resourceVerifiedAccessGroupRead(ctx context.Context, d *schema.ResourceData group, err := findVerifiedAccessGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Verified Access Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/verifiedaccess_group_test.go b/internal/service/ec2/verifiedaccess_group_test.go index 738cf2e0060..7db44f49780 100644 --- a/internal/service/ec2/verifiedaccess_group_test.go +++ b/internal/service/ec2/verifiedaccess_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -414,7 +414,7 @@ func testAccCheckVerifiedAccessGroupDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindVerifiedAccessGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/verifiedaccess_instance.go b/internal/service/ec2/verifiedaccess_instance.go index e12732025b8..a266bd484b9 100644 --- a/internal/service/ec2/verifiedaccess_instance.go +++ b/internal/service/ec2/verifiedaccess_instance.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +134,7 @@ func resourceVerifiedAccessInstanceRead(ctx context.Context, d *schema.ResourceD output, err := findVerifiedAccessInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Verified Access Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/verifiedaccess_instance_logging_configuration.go b/internal/service/ec2/verifiedaccess_instance_logging_configuration.go index f07fdf714b5..5a57c13193d 100644 --- a/internal/service/ec2/verifiedaccess_instance_logging_configuration.go +++ b/internal/service/ec2/verifiedaccess_instance_logging_configuration.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -165,7 +165,7 @@ func resourceVerifiedAccessInstanceLoggingConfigurationRead(ctx context.Context, vaiID := d.Id() output, err := findVerifiedAccessInstanceLoggingConfigurationByInstanceID(ctx, conn, vaiID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Verified Access Instance Logging Configuration (%s) not found, removing from state", vaiID) d.SetId("") return diags diff --git a/internal/service/ec2/verifiedaccess_instance_logging_configuration_test.go b/internal/service/ec2/verifiedaccess_instance_logging_configuration_test.go index 5fc732f42c4..cbe4a00b4da 100644 --- a/internal/service/ec2/verifiedaccess_instance_logging_configuration_test.go +++ b/internal/service/ec2/verifiedaccess_instance_logging_configuration_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -437,7 +437,7 @@ func testAccCheckVerifiedAccessInstanceLoggingConfigurationDestroy(ctx context.C _, err := tfec2.FindVerifiedAccessInstanceLoggingConfigurationByInstanceID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/verifiedaccess_instance_test.go b/internal/service/ec2/verifiedaccess_instance_test.go index 58d36dce4ba..259f578eb46 100644 --- a/internal/service/ec2/verifiedaccess_instance_test.go +++ b/internal/service/ec2/verifiedaccess_instance_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -304,7 +304,7 @@ func testAccCheckVerifiedAccessInstanceDestroy(ctx context.Context) resource.Tes _, err := tfec2.FindVerifiedAccessInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment.go b/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment.go index d486aae4117..5b233e31ed8 100644 --- a/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment.go +++ b/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_verifiedaccess_instance_trust_provider_attachment", name="Verified Access Instance Trust Provider Attachment") @@ -81,7 +81,7 @@ func resourceVerifiedAccessInstanceTrustProviderAttachmentRead(ctx context.Conte err = findVerifiedAccessInstanceTrustProviderAttachmentExists(ctx, conn, vaiID, vatpID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Verified Access Instance Trust Provider Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment_test.go b/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment_test.go index e297ab1f789..11b5f5eff46 100644 --- a/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment_test.go +++ b/internal/service/ec2/verifiedaccess_instance_trust_provider_attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +103,7 @@ func testAccCheckVerifiedAccessInstanceTrustProviderAttachmentDestroy(ctx contex err := tfec2.FindVerifiedAccessInstanceTrustProviderAttachmentExists(ctx, conn, rs.Primary.Attributes["verifiedaccess_instance_id"], rs.Primary.Attributes["verifiedaccess_trust_provider_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/verifiedaccess_trust_provider.go b/internal/service/ec2/verifiedaccess_trust_provider.go index d92b905c765..0bdffb4a72f 100644 --- a/internal/service/ec2/verifiedaccess_trust_provider.go +++ b/internal/service/ec2/verifiedaccess_trust_provider.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -268,7 +268,7 @@ func resourceVerifiedAccessTrustProviderRead(ctx context.Context, d *schema.Reso output, err := findVerifiedAccessTrustProviderByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Verified Access Trust Provider (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/verifiedaccess_trust_provider_test.go b/internal/service/ec2/verifiedaccess_trust_provider_test.go index 3eadd9f2646..e81180a61be 100644 --- a/internal/service/ec2/verifiedaccess_trust_provider_test.go +++ b/internal/service/ec2/verifiedaccess_trust_provider_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -268,7 +268,7 @@ func testAccCheckVerifiedAccessTrustProviderDestroy(ctx context.Context) resourc _, err := tfec2.FindVerifiedAccessTrustProviderByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_.go b/internal/service/ec2/vpc_.go index 7779b0a7f27..13cfa0e06b5 100644 --- a/internal/service/ec2/vpc_.go +++ b/internal/service/ec2/vpc_.go @@ -297,7 +297,7 @@ func resourceVPCRead(ctx context.Context, d *schema.ResourceData, meta any) diag return findVPCByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_block_public_access_exclusion.go b/internal/service/ec2/vpc_block_public_access_exclusion.go index cfc1892af71..59e3ad84bb0 100644 --- a/internal/service/ec2/vpc_block_public_access_exclusion.go +++ b/internal/service/ec2/vpc_block_public_access_exclusion.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -136,7 +136,7 @@ func (r *vpcBlockPublicAccessExclusionResource) Read(ctx context.Context, reques output, err := findVPCBlockPublicAccessExclusionByID(ctx, conn, data.ExclusionID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_block_public_access_exclusion_test.go b/internal/service/ec2/vpc_block_public_access_exclusion_test.go index 893ffec911f..b61ad67df1c 100644 --- a/internal/service/ec2/vpc_block_public_access_exclusion_test.go +++ b/internal/service/ec2/vpc_block_public_access_exclusion_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -175,7 +175,7 @@ func testAccCheckVPCBlockPublicAccessExclusionDestroy(ctx context.Context) resou _, err := tfec2.FindVPCBlockPublicAccessExclusionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_block_public_access_options.go b/internal/service/ec2/vpc_block_public_access_options.go index 46925238d7d..560480a77bc 100644 --- a/internal/service/ec2/vpc_block_public_access_options.go +++ b/internal/service/ec2/vpc_block_public_access_options.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func (r *vpcBlockPublicAccessOptionsResource) Read(ctx context.Context, request options, err := findVPCBlockPublicAccessOptions(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_default_route_table_test.go b/internal/service/ec2/vpc_default_route_table_test.go index 2796fd7dafb..3d56abd8f5f 100644 --- a/internal/service/ec2/vpc_default_route_table_test.go +++ b/internal/service/ec2/vpc_default_route_table_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -543,7 +543,7 @@ func testAccCheckDefaultRouteTableDestroy(ctx context.Context) resource.TestChec _, err := tfec2.FindRouteTableByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_default_subnet.go b/internal/service/ec2/vpc_default_subnet.go index 202b372404a..5bed9ab844c 100644 --- a/internal/service/ec2/vpc_default_subnet.go +++ b/internal/service/ec2/vpc_default_subnet.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +184,7 @@ func resourceDefaultSubnetCreate(ctx context.Context, d *schema.ResourceData, me log.Printf("[INFO] Found existing EC2 Default Subnet (%s)", availabilityZone) d.SetId(aws.ToString(subnet.SubnetId)) d.Set("existing_default_subnet", true) - } else if tfresource.NotFound(err) { + } else if retry.NotFound(err) { input := &ec2.CreateDefaultSubnetInput{ AvailabilityZone: aws.String(availabilityZone), } diff --git a/internal/service/ec2/vpc_default_subnet_test.go b/internal/service/ec2/vpc_default_subnet_test.go index 917c3389d36..1f8137ba55a 100644 --- a/internal/service/ec2/vpc_default_subnet_test.go +++ b/internal/service/ec2/vpc_default_subnet_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -375,7 +375,7 @@ func testAccCheckDefaultSubnetDestroyNotFound(ctx context.Context) resource.Test _, err := tfec2.FindSubnetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_default_vpc.go b/internal/service/ec2/vpc_default_vpc.go index 27c57b2d45a..19d4f8950db 100644 --- a/internal/service/ec2/vpc_default_vpc.go +++ b/internal/service/ec2/vpc_default_vpc.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func resourceDefaultVPCCreate(ctx context.Context, d *schema.ResourceData, meta } else { vpcInfo.enableNetworkAddressUsageMetrics = v } - } else if tfresource.NotFound(err) { + } else if retry.NotFound(err) { input := &ec2.CreateDefaultVpcInput{} output, err := conn.CreateDefaultVpc(ctx, input) diff --git a/internal/service/ec2/vpc_default_vpc_test.go b/internal/service/ec2/vpc_default_vpc_test.go index 28cb7fd3c07..8b4443a88f1 100644 --- a/internal/service/ec2/vpc_default_vpc_test.go +++ b/internal/service/ec2/vpc_default_vpc_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -447,7 +447,7 @@ func testAccCheckDefaultVPCDestroyNotFound(ctx context.Context) resource.TestChe _, err := tfec2.FindVPCByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -501,7 +501,7 @@ func testAccEmptyDefaultVPC(ctx context.Context, vpcID string) error { if err != nil { return err } - } else if !tfresource.NotFound(err) { + } else if !retry.NotFound(err) { return err } diff --git a/internal/service/ec2/vpc_dhcp_options.go b/internal/service/ec2/vpc_dhcp_options.go index 696457271ee..e88289e0d96 100644 --- a/internal/service/ec2/vpc_dhcp_options.go +++ b/internal/service/ec2/vpc_dhcp_options.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -137,7 +138,7 @@ func resourceVPCDHCPOptionsRead(ctx context.Context, d *schema.ResourceData, met return findDHCPOptionsByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 DHCP Options Set %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_dhcp_options_association.go b/internal/service/ec2/vpc_dhcp_options_association.go index 3683c7238e0..58cff968525 100644 --- a/internal/service/ec2/vpc_dhcp_options_association.go +++ b/internal/service/ec2/vpc_dhcp_options_association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +85,7 @@ func resourceVPCDHCPOptionsAssociationRead(ctx context.Context, d *schema.Resour return nil, findVPCDHCPOptionsAssociation(ctx, conn, vpcID, dhcpOptionsID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC DHCP Options Set Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_dhcp_options_association_test.go b/internal/service/ec2/vpc_dhcp_options_association_test.go index 18f0b893a28..cc658aa3202 100644 --- a/internal/service/ec2/vpc_dhcp_options_association_test.go +++ b/internal/service/ec2/vpc_dhcp_options_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckVPCDHCPOptionsAssociationDestroy(ctx context.Context) resource. err = tfec2.FindVPCDHCPOptionsAssociation(ctx, conn, vpcID, dhcpOptionsID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_dhcp_options_test.go b/internal/service/ec2/vpc_dhcp_options_test.go index 29a5221b109..343e64b3147 100644 --- a/internal/service/ec2/vpc_dhcp_options_test.go +++ b/internal/service/ec2/vpc_dhcp_options_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -176,7 +176,7 @@ func testAccCheckDHCPOptionsDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfec2.FindDHCPOptionsByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_egress_only_internet_gateway.go b/internal/service/ec2/vpc_egress_only_internet_gateway.go index db1e16538f6..516d660cad5 100644 --- a/internal/service/ec2/vpc_egress_only_internet_gateway.go +++ b/internal/service/ec2/vpc_egress_only_internet_gateway.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -76,7 +77,7 @@ func resourceEgressOnlyInternetGatewayRead(ctx context.Context, d *schema.Resour return findEgressOnlyInternetGatewayByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Egress-only Internet Gateway %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_egress_only_internet_gateway_test.go b/internal/service/ec2/vpc_egress_only_internet_gateway_test.go index bdca2e7c481..e08e0d21a9d 100644 --- a/internal/service/ec2/vpc_egress_only_internet_gateway_test.go +++ b/internal/service/ec2/vpc_egress_only_internet_gateway_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +104,7 @@ func testAccCheckEgressOnlyInternetGatewayDestroy(ctx context.Context) resource. _, err := tfec2.FindEgressOnlyInternetGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint.go b/internal/service/ec2/vpc_endpoint.go index e960ad20367..f40a8ae60be 100644 --- a/internal/service/ec2/vpc_endpoint.go +++ b/internal/service/ec2/vpc_endpoint.go @@ -25,9 +25,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -342,7 +342,7 @@ func resourceVPCEndpointRead(ctx context.Context, d *schema.ResourceData, meta a vpce, err := findVPCEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -388,7 +388,7 @@ func resourceVPCEndpointRead(ctx context.Context, d *schema.ResourceData, meta a serviceName := aws.ToString(vpce.ServiceName) if pl, err := findPrefixListByName(ctx, conn, serviceName); err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { d.Set("cidr_blocks", nil) } else { return sdkdiag.AppendErrorf(diags, "reading EC2 Prefix List (%s): %s", serviceName, err) diff --git a/internal/service/ec2/vpc_endpoint_connection_accepter.go b/internal/service/ec2/vpc_endpoint_connection_accepter.go index 2c2076a8d80..5ee289072ee 100644 --- a/internal/service/ec2/vpc_endpoint_connection_accepter.go +++ b/internal/service/ec2/vpc_endpoint_connection_accepter.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func resourceVPCEndpointConnectionAccepterRead(ctx context.Context, d *schema.Re vpcEndpointConnection, err := findVPCEndpointConnectionByServiceIDAndVPCEndpointID(ctx, conn, serviceID, vpcEndpointID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Endpoint Connection Accepter %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go index fe14bb1a938..8fa8dec8933 100644 --- a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -59,7 +59,7 @@ func testAccCheckVPCEndpointConnectionAccepterDestroy(ctx context.Context) resou _, err := tfec2.FindVPCEndpointConnectionByServiceIDAndVPCEndpointID(ctx, conn, rs.Primary.Attributes["vpc_endpoint_service_id"], rs.Primary.Attributes[names.AttrVPCEndpointID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_connection_notification.go b/internal/service/ec2/vpc_endpoint_connection_notification.go index 8cb51045ed2..75a151a7d15 100644 --- a/internal/service/ec2/vpc_endpoint_connection_notification.go +++ b/internal/service/ec2/vpc_endpoint_connection_notification.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +104,7 @@ func resourceVPCEndpointConnectionNotificationRead(ctx context.Context, d *schem cn, err := findVPCEndpointConnectionNotificationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC Endpoint Connection Notification %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_connection_notification_test.go b/internal/service/ec2/vpc_endpoint_connection_notification_test.go index c6cbcd4eac5..ec2d1bbb595 100644 --- a/internal/service/ec2/vpc_endpoint_connection_notification_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_notification_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -67,7 +67,7 @@ func testAccCheckVPCEndpointConnectionNotificationDestroy(ctx context.Context) r _, err := tfec2.FindVPCEndpointConnectionNotificationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_data_source.go b/internal/service/ec2/vpc_endpoint_data_source.go index 11a1e1656c9..66758e0081f 100644 --- a/internal/service/ec2/vpc_endpoint_data_source.go +++ b/internal/service/ec2/vpc_endpoint_data_source.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -215,7 +216,7 @@ func dataSourceVPCEndpointRead(ctx context.Context, d *schema.ResourceData, meta d.Set(names.AttrVPCID, vpce.VpcId) if pl, err := findPrefixListByName(ctx, conn, serviceName); err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { d.Set("cidr_blocks", nil) } else { return sdkdiag.AppendErrorf(diags, "reading EC2 Prefix List (%s): %s", serviceName, err) diff --git a/internal/service/ec2/vpc_endpoint_policy.go b/internal/service/ec2/vpc_endpoint_policy.go index f7561294eca..9d1c244f24f 100644 --- a/internal/service/ec2/vpc_endpoint_policy.go +++ b/internal/service/ec2/vpc_endpoint_policy.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -90,7 +90,7 @@ func resourceVPCEndpointPolicyRead(ctx context.Context, d *schema.ResourceData, vpce, err := findVPCEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Endpoint Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_private_dns.go b/internal/service/ec2/vpc_endpoint_private_dns.go index f1b4d73cd09..09f36826e3d 100644 --- a/internal/service/ec2/vpc_endpoint_private_dns.go +++ b/internal/service/ec2/vpc_endpoint_private_dns.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func (r *vpcEndpointPrivateDNSResource) Read(ctx context.Context, request resour vpce, err := findVPCEndpointByID(ctx, conn, data.VPCEndpointID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_endpoint_route_table_association.go b/internal/service/ec2/vpc_endpoint_route_table_association.go index c2995cff4bc..a5fe0243aca 100644 --- a/internal/service/ec2/vpc_endpoint_route_table_association.go +++ b/internal/service/ec2/vpc_endpoint_route_table_association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +90,7 @@ func resourceVPCEndpointRouteTableAssociationRead(ctx context.Context, d *schema return nil, findVPCEndpointRouteTableAssociationExists(ctx, conn, endpointID, routeTableID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Endpoint Route Table Association (%s) not found, removing from state", id) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_route_table_association_test.go b/internal/service/ec2/vpc_endpoint_route_table_association_test.go index f40d123d257..f3f6b25123f 100644 --- a/internal/service/ec2/vpc_endpoint_route_table_association_test.go +++ b/internal/service/ec2/vpc_endpoint_route_table_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -79,7 +79,7 @@ func testAccCheckVPCEndpointRouteTableAssociationDestroy(ctx context.Context) re err := tfec2.FindVPCEndpointRouteTableAssociationExists(ctx, conn, rs.Primary.Attributes[names.AttrVPCEndpointID], rs.Primary.Attributes["route_table_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_security_group_association.go b/internal/service/ec2/vpc_endpoint_security_group_association.go index cacd612fb53..5e019406273 100644 --- a/internal/service/ec2/vpc_endpoint_security_group_association.go +++ b/internal/service/ec2/vpc_endpoint_security_group_association.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func resourceVPCEndpointSecurityGroupAssociationRead(ctx context.Context, d *sch err := findVPCEndpointSecurityGroupAssociationExists(ctx, conn, vpcEndpointID, securityGroupID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Endpoint Security Group Association (%s) not found, removing from state", id) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_security_group_association_test.go b/internal/service/ec2/vpc_endpoint_security_group_association_test.go index ef943d87ca4..f487d846dfd 100644 --- a/internal/service/ec2/vpc_endpoint_security_group_association_test.go +++ b/internal/service/ec2/vpc_endpoint_security_group_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckVPCEndpointSecurityGroupAssociationDestroy(ctx context.Context) err := tfec2.FindVPCEndpointSecurityGroupAssociationExists(ctx, conn, rs.Primary.Attributes[names.AttrVPCEndpointID], rs.Primary.Attributes["security_group_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_service.go b/internal/service/ec2/vpc_endpoint_service.go index e6f45cfb6fa..d405b661ad5 100644 --- a/internal/service/ec2/vpc_endpoint_service.go +++ b/internal/service/ec2/vpc_endpoint_service.go @@ -19,9 +19,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -220,7 +220,7 @@ func resourceVPCEndpointServiceRead(ctx context.Context, d *schema.ResourceData, svcCfg, err := findVPCEndpointServiceConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC Endpoint Service %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_service_allowed_principal.go b/internal/service/ec2/vpc_endpoint_service_allowed_principal.go index 6c476c7afac..317af57cdc9 100644 --- a/internal/service/ec2/vpc_endpoint_service_allowed_principal.go +++ b/internal/service/ec2/vpc_endpoint_service_allowed_principal.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_vpc_endpoint_service_allowed_principal", name="Endpoint Service Allowed Principal") @@ -74,7 +74,7 @@ func resourceVPCEndpointServiceAllowedPrincipalRead(ctx context.Context, d *sche output, err := findVPCEndpointServicePermission(ctx, conn, serviceID, principalARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC Endpoint Service Allowed Principal %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go b/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go index 62be61c1509..2a9ef164e06 100644 --- a/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go +++ b/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -183,7 +183,7 @@ func testAccCheckVPCEndpointServiceAllowedPrincipalDestroy(ctx context.Context) _, err := tfec2.FindVPCEndpointServicePermission(ctx, conn, rs.Primary.Attributes["vpc_endpoint_service_id"], rs.Primary.Attributes["principal_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_service_test.go b/internal/service/ec2/vpc_endpoint_service_test.go index 41270434ebe..ff47e8112e4 100644 --- a/internal/service/ec2/vpc_endpoint_service_test.go +++ b/internal/service/ec2/vpc_endpoint_service_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -406,7 +406,7 @@ func testAccCheckVPCEndpointServiceDestroy(ctx context.Context) resource.TestChe _, err := tfec2.FindVPCEndpointServiceConfigurationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_subnet_association.go b/internal/service/ec2/vpc_endpoint_subnet_association.go index 7d41e956b22..8d963b16b12 100644 --- a/internal/service/ec2/vpc_endpoint_subnet_association.go +++ b/internal/service/ec2/vpc_endpoint_subnet_association.go @@ -20,7 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -90,7 +89,7 @@ func resourceVPCEndpointSubnetAssociationRead(ctx context.Context, d *schema.Res err := findVPCEndpointSubnetAssociationExists(ctx, conn, vpceID, subnetID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Endpoint Subnet Association (%s) not found, removing from state", id) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_endpoint_subnet_association_test.go b/internal/service/ec2/vpc_endpoint_subnet_association_test.go index 2ae4c2a044c..1a49d9ae0ba 100644 --- a/internal/service/ec2/vpc_endpoint_subnet_association_test.go +++ b/internal/service/ec2/vpc_endpoint_subnet_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +104,7 @@ func testAccCheckVPCEndpointSubnetAssociationDestroy(ctx context.Context) resour err := tfec2.FindVPCEndpointSubnetAssociationExists(ctx, conn, rs.Primary.Attributes[names.AttrVPCEndpointID], rs.Primary.Attributes[names.AttrSubnetID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_endpoint_test.go b/internal/service/ec2/vpc_endpoint_test.go index 0774ec7047d..56ddfa812da 100644 --- a/internal/service/ec2/vpc_endpoint_test.go +++ b/internal/service/ec2/vpc_endpoint_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1169,7 +1169,7 @@ func testAccCheckVPCEndpointDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfec2.FindVPCEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_flow_log.go b/internal/service/ec2/vpc_flow_log.go index 384a2a05e37..e4ed39aaa0d 100644 --- a/internal/service/ec2/vpc_flow_log.go +++ b/internal/service/ec2/vpc_flow_log.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -264,7 +265,7 @@ func resourceLogFlowRead(ctx context.Context, d *schema.ResourceData, meta any) fl, err := findFlowLogByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Flow Log %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_flow_log_test.go b/internal/service/ec2/vpc_flow_log_test.go index 0a1ec87b79c..356da8d2161 100644 --- a/internal/service/ec2/vpc_flow_log_test.go +++ b/internal/service/ec2/vpc_flow_log_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -718,7 +718,7 @@ func testAccCheckFlowLogDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindFlowLogByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_internet_gateway.go b/internal/service/ec2/vpc_internet_gateway.go index ba7d5a0eaac..f0e1736db12 100644 --- a/internal/service/ec2/vpc_internet_gateway.go +++ b/internal/service/ec2/vpc_internet_gateway.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func resourceInternetGatewayRead(ctx context.Context, d *schema.ResourceData, me return findInternetGatewayByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Internet Gateway %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -154,7 +155,7 @@ func resourceInternetGatewayDelete(ctx context.Context, d *schema.ResourceData, if v, ok := d.GetOk(names.AttrVPCID); ok { err := detachInternetGateway(ctx, conn, d.Id(), v.(string), d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "deleting EC2 Internet Gateway (%s): %s", d.Id(), err) } } diff --git a/internal/service/ec2/vpc_internet_gateway_attachment.go b/internal/service/ec2/vpc_internet_gateway_attachment.go index b92b333d15e..0d1ac170626 100644 --- a/internal/service/ec2/vpc_internet_gateway_attachment.go +++ b/internal/service/ec2/vpc_internet_gateway_attachment.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -80,7 +81,7 @@ func resourceInternetGatewayAttachmentRead(ctx context.Context, d *schema.Resour return findInternetGatewayAttachment(ctx, conn, igwID, vpcID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Internet Gateway Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -109,7 +110,7 @@ func resourceInternetGatewayAttachmentDelete(ctx context.Context, d *schema.Reso err = detachInternetGateway(ctx, conn, igwID, vpcID, d.Timeout(schema.TimeoutDelete)) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): return diags case err != nil: return sdkdiag.AppendErrorf(diags, "deleting EC2 Internet Gateway Attachment (%s): %s", d.Id(), err) diff --git a/internal/service/ec2/vpc_internet_gateway_attachment_test.go b/internal/service/ec2/vpc_internet_gateway_attachment_test.go index a9a8aa84880..ec999b92870 100644 --- a/internal/service/ec2/vpc_internet_gateway_attachment_test.go +++ b/internal/service/ec2/vpc_internet_gateway_attachment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckInternetGatewayAttachmentDestroy(ctx context.Context) resource. _, err = tfec2.FindInternetGatewayAttachment(ctx, conn, igwID, vpcID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_internet_gateway_test.go b/internal/service/ec2/vpc_internet_gateway_test.go index f78670dc92c..d768fa48e1a 100644 --- a/internal/service/ec2/vpc_internet_gateway_test.go +++ b/internal/service/ec2/vpc_internet_gateway_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func testAccCheckInternetGatewayDestroy(ctx context.Context) resource.TestCheckF _, err := tfec2.FindInternetGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam.go b/internal/service/ec2/vpc_ipam.go index 5bed7b3e516..3e8e3b56248 100644 --- a/internal/service/ec2/vpc_ipam.go +++ b/internal/service/ec2/vpc_ipam.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func resourceIPAMRead(ctx context.Context, d *schema.ResourceData, meta any) dia ipam, err := findIPAMByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_organization_admin_account.go b/internal/service/ec2/vpc_ipam_organization_admin_account.go index 50b7027bef3..d34e4bb58d6 100644 --- a/internal/service/ec2/vpc_ipam_organization_admin_account.go +++ b/internal/service/ec2/vpc_ipam_organization_admin_account.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func resourceIPAMOrganizationAdminAccountRead(ctx context.Context, d *schema.Res account, err := tforganizations.FindDelegatedAdministratorByTwoPartKey(ctx, conn, d.Id(), ipamServicePrincipal) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Organization Admin Account (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_organization_admin_account_test.go b/internal/service/ec2/vpc_ipam_organization_admin_account_test.go index 9a461fe779b..ec62d9f28fa 100644 --- a/internal/service/ec2/vpc_ipam_organization_admin_account_test.go +++ b/internal/service/ec2/vpc_ipam_organization_admin_account_test.go @@ -15,9 +15,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func testAccCheckIPAMOrganizationAdminAccountDestroy(ctx context.Context) resour _, err := tforganizations.FindDelegatedAdministratorByTwoPartKey(ctx, conn, rs.Primary.Attributes["delegated_admin_account_id"], rs.Primary.Attributes["service_principal"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_pool.go b/internal/service/ec2/vpc_ipam_pool.go index 73524969ef0..d3db5dea505 100644 --- a/internal/service/ec2/vpc_ipam_pool.go +++ b/internal/service/ec2/vpc_ipam_pool.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -234,7 +234,7 @@ func resourceIPAMPoolRead(ctx context.Context, d *schema.ResourceData, meta any) pool, err := findIPAMPoolByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Pool (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_pool_cidr.go b/internal/service/ec2/vpc_ipam_pool_cidr.go index 1883fa77000..3dfe6b52dc6 100644 --- a/internal/service/ec2/vpc_ipam_pool_cidr.go +++ b/internal/service/ec2/vpc_ipam_pool_cidr.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -152,7 +152,7 @@ func resourceIPAMPoolCIDRRead(ctx context.Context, d *schema.ResourceData, meta output, err := findIPAMPoolCIDRByTwoPartKey(ctx, conn, cidrBlock, poolID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Pool CIDR (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_pool_cidr_allocation.go b/internal/service/ec2/vpc_ipam_pool_cidr_allocation.go index ad2b5bc479c..e1ab44d4a0b 100644 --- a/internal/service/ec2/vpc_ipam_pool_cidr_allocation.go +++ b/internal/service/ec2/vpc_ipam_pool_cidr_allocation.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -156,7 +157,7 @@ func resourceIPAMPoolCIDRAllocationRead(ctx context.Context, d *schema.ResourceD allocation, err := findIPAMPoolAllocationByTwoPartKey(ctx, conn, allocationID, poolID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Pool CIDR Allocation (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_pool_cidr_allocation_test.go b/internal/service/ec2/vpc_ipam_pool_cidr_allocation_test.go index 0282231fa63..9717ba5364b 100644 --- a/internal/service/ec2/vpc_ipam_pool_cidr_allocation_test.go +++ b/internal/service/ec2/vpc_ipam_pool_cidr_allocation_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -333,7 +333,7 @@ func testAccCheckIPAMPoolAllocationDestroy(ctx context.Context) resource.TestChe _, err := tfec2.FindIPAMPoolAllocationByTwoPartKey(ctx, conn, rs.Primary.Attributes["ipam_pool_allocation_id"], rs.Primary.Attributes["ipam_pool_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_pool_cidr_test.go b/internal/service/ec2/vpc_ipam_pool_cidr_test.go index a77e7173465..fe6de3b94d9 100644 --- a/internal/service/ec2/vpc_ipam_pool_cidr_test.go +++ b/internal/service/ec2/vpc_ipam_pool_cidr_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckIPAMPoolCIDRDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfec2.FindIPAMPoolCIDRByTwoPartKey(ctx, conn, rs.Primary.Attributes["cidr"], rs.Primary.Attributes["ipam_pool_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_pool_test.go b/internal/service/ec2/vpc_ipam_pool_test.go index 938b68917b5..bb1bed70db5 100644 --- a/internal/service/ec2/vpc_ipam_pool_test.go +++ b/internal/service/ec2/vpc_ipam_pool_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -317,7 +317,7 @@ func testAccCheckIPAMPoolDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindIPAMPoolByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_resource_discovery.go b/internal/service/ec2/vpc_ipam_resource_discovery.go index 8dda6d9e3c3..9ed8fc217f4 100644 --- a/internal/service/ec2/vpc_ipam_resource_discovery.go +++ b/internal/service/ec2/vpc_ipam_resource_discovery.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func resourceIPAMResourceDiscoveryRead(ctx context.Context, d *schema.ResourceDa rd, err := findIPAMResourceDiscoveryByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Resource Discovery (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_resource_discovery_association.go b/internal/service/ec2/vpc_ipam_resource_discovery_association.go index cc692aac4b5..8251d4e767a 100644 --- a/internal/service/ec2/vpc_ipam_resource_discovery_association.go +++ b/internal/service/ec2/vpc_ipam_resource_discovery_association.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +115,7 @@ func resourceIPAMResourceDiscoveryAssociationRead(ctx context.Context, d *schema rda, err := findIPAMResourceDiscoveryAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Resource Discovery Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_resource_discovery_association_test.go b/internal/service/ec2/vpc_ipam_resource_discovery_association_test.go index 32ac5b6dce8..6d6bf8d849f 100644 --- a/internal/service/ec2/vpc_ipam_resource_discovery_association_test.go +++ b/internal/service/ec2/vpc_ipam_resource_discovery_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func testAccCheckIPAMResourceDiscoveryAssociationDestroy(ctx context.Context) re _, err := tfec2.FindIPAMResourceDiscoveryAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_resource_discovery_test.go b/internal/service/ec2/vpc_ipam_resource_discovery_test.go index 2eaea1bd57d..c8e3bed93f4 100644 --- a/internal/service/ec2/vpc_ipam_resource_discovery_test.go +++ b/internal/service/ec2/vpc_ipam_resource_discovery_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -219,7 +219,7 @@ func testAccCheckIPAMResourceDiscoveryDestroy(ctx context.Context) resource.Test _, err := tfec2.FindIPAMResourceDiscoveryByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_scope.go b/internal/service/ec2/vpc_ipam_scope.go index 16777f4ffe8..b95ef50e195 100644 --- a/internal/service/ec2/vpc_ipam_scope.go +++ b/internal/service/ec2/vpc_ipam_scope.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +113,7 @@ func resourceIPAMScopeRead(ctx context.Context, d *schema.ResourceData, meta any scope, err := findIPAMScopeByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IPAM Scope (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipam_scope_test.go b/internal/service/ec2/vpc_ipam_scope_test.go index 52496687204..943ab2a9613 100644 --- a/internal/service/ec2/vpc_ipam_scope_test.go +++ b/internal/service/ec2/vpc_ipam_scope_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckIPAMScopeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindIPAMScopeByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipam_test.go b/internal/service/ec2/vpc_ipam_test.go index 6c639fd5464..be635365d1a 100644 --- a/internal/service/ec2/vpc_ipam_test.go +++ b/internal/service/ec2/vpc_ipam_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -370,7 +370,7 @@ func testAccCheckIPAMDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindIPAMByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipv4_cidr_block_association.go b/internal/service/ec2/vpc_ipv4_cidr_block_association.go index 9d24f7de25a..c21f6b0a95e 100644 --- a/internal/service/ec2/vpc_ipv4_cidr_block_association.go +++ b/internal/service/ec2/vpc_ipv4_cidr_block_association.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func resourceVPCIPv4CIDRBlockAssociationRead(ctx context.Context, d *schema.Reso vpcCidrBlockAssociation, vpc, err := findVPCCIDRBlockAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC IPv4 CIDR Block Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go b/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go index 7ce8e52d535..e93f3eab442 100644 --- a/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go +++ b/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -224,7 +225,7 @@ func testAccCheckVPCIPv4CIDRBlockAssociationDestroy(ctx context.Context) resourc _, _, err := tfec2.FindVPCCIDRBlockAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_ipv6_cidr_block_association.go b/internal/service/ec2/vpc_ipv6_cidr_block_association.go index bebd2b5a71f..455c632e13c 100644 --- a/internal/service/ec2/vpc_ipv6_cidr_block_association.go +++ b/internal/service/ec2/vpc_ipv6_cidr_block_association.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -168,7 +168,7 @@ func resourceVPCIPv6CIDRBlockAssociationRead(ctx context.Context, d *schema.Reso vpcIpv6CidrBlockAssociation, vpc, err := findVPCIPv6CIDRBlockAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC IPv6 CIDR Block Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go b/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go index d22a26cb019..dbe0ae69a95 100644 --- a/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go +++ b/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -200,7 +200,7 @@ func testAccCheckVPCIPv6CIDRBlockAssociationDestroy(ctx context.Context) resourc _, _, err := tfec2.FindVPCIPv6CIDRBlockAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_main_route_table_association.go b/internal/service/ec2/vpc_main_route_table_association.go index 3d5b1d60938..f37761ef894 100644 --- a/internal/service/ec2/vpc_main_route_table_association.go +++ b/internal/service/ec2/vpc_main_route_table_association.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func resourceMainRouteTableAssociationRead(ctx context.Context, d *schema.Resour _, err := findMainRouteTableAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Main Route Table Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_main_route_table_association_test.go b/internal/service/ec2/vpc_main_route_table_association_test.go index 9c0d24a2f6a..81f62b9b11c 100644 --- a/internal/service/ec2/vpc_main_route_table_association_test.go +++ b/internal/service/ec2/vpc_main_route_table_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -58,7 +58,7 @@ func testAccCheckMainRouteTableAssociationDestroy(ctx context.Context) resource. _, err := tfec2.FindMainRouteTableAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_managed_prefix_list.go b/internal/service/ec2/vpc_managed_prefix_list.go index 0fbec311b37..30dc6e84218 100644 --- a/internal/service/ec2/vpc_managed_prefix_list.go +++ b/internal/service/ec2/vpc_managed_prefix_list.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func resourceManagedPrefixListRead(ctx context.Context, d *schema.ResourceData, pl, err := findManagedPrefixListByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Managed Prefix List %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_managed_prefix_list_entry.go b/internal/service/ec2/vpc_managed_prefix_list_entry.go index 99560a11dec..e3cdc57c1b7 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_entry.go +++ b/internal/service/ec2/vpc_managed_prefix_list_entry.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +120,7 @@ func resourceManagedPrefixListEntryRead(ctx context.Context, d *schema.ResourceD return findManagedPrefixListEntryByIDAndCIDR(ctx, conn, plID, cidr) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Managed Prefix List Entry (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_managed_prefix_list_entry_test.go b/internal/service/ec2/vpc_managed_prefix_list_entry_test.go index 3670773639d..ed6187526a0 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_entry_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_entry_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -226,7 +226,7 @@ func testAccCheckManagedPrefixListEntryDestroy(ctx context.Context) resource.Tes _, err = tfec2.FindManagedPrefixListEntryByIDAndCIDR(ctx, conn, plID, cidr) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_managed_prefix_list_test.go b/internal/service/ec2/vpc_managed_prefix_list_test.go index 20b38701879..1f456051649 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -404,7 +404,7 @@ func testAccCheckManagedPrefixListDestroy(ctx context.Context) resource.TestChec _, err := tfec2.FindManagedPrefixListByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_nat_gateway.go b/internal/service/ec2/vpc_nat_gateway.go index e4f2f126f57..94a20c34eab 100644 --- a/internal/service/ec2/vpc_nat_gateway.go +++ b/internal/service/ec2/vpc_nat_gateway.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -343,7 +343,7 @@ func resourceNATGatewayRead(ctx context.Context, d *schema.ResourceData, meta an natGateway, err := findNATGatewayByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 NAT Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_nat_gateway_eip_association.go b/internal/service/ec2/vpc_nat_gateway_eip_association.go index 6119ad9464c..98d1cd2376b 100644 --- a/internal/service/ec2/vpc_nat_gateway_eip_association.go +++ b/internal/service/ec2/vpc_nat_gateway_eip_association.go @@ -22,7 +22,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func (r *natGatewayEIPAssociationResource) Read(ctx context.Context, request res natGatewayID, allocationID := fwflex.StringValueFromFramework(ctx, data.NATGatewayID), fwflex.StringValueFromFramework(ctx, data.AllocationID) output, err := findNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded(ctx, conn, natGatewayID, allocationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_nat_gateway_eip_association_test.go b/internal/service/ec2/vpc_nat_gateway_eip_association_test.go index 7ae72f0eff6..19aa90c4675 100644 --- a/internal/service/ec2/vpc_nat_gateway_eip_association_test.go +++ b/internal/service/ec2/vpc_nat_gateway_eip_association_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -101,7 +101,7 @@ func testAccCheckVPCNATGatewayEIPAssociationDestroy(ctx context.Context) resourc _, err := tfec2.FindNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded(ctx, conn, rs.Primary.Attributes["nat_gateway_id"], rs.Primary.Attributes["allocation_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_nat_gateway_test.go b/internal/service/ec2/vpc_nat_gateway_test.go index a16f8187fec..d3907955875 100644 --- a/internal/service/ec2/vpc_nat_gateway_test.go +++ b/internal/service/ec2/vpc_nat_gateway_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1033,7 +1033,7 @@ func testAccCheckNATGatewayDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindNATGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_acl.go b/internal/service/ec2/vpc_network_acl.go index 4c59f0b906a..6a95b347f83 100644 --- a/internal/service/ec2/vpc_network_acl.go +++ b/internal/service/ec2/vpc_network_acl.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -198,7 +199,7 @@ func resourceNetworkACLRead(ctx context.Context, d *schema.ResourceData, meta an return findNetworkACLByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network ACL %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -265,7 +266,7 @@ func resourceNetworkACLDelete(ctx context.Context, d *schema.ResourceData, meta // Delete all NACL/Subnet associations, even if they are managed via aws_network_acl_association resources. nacl, err := findNetworkACLByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/ec2/vpc_network_acl_association.go b/internal/service/ec2/vpc_network_acl_association.go index 4122ab09ede..4ac2a9be64a 100644 --- a/internal/service/ec2/vpc_network_acl_association.go +++ b/internal/service/ec2/vpc_network_acl_association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -68,7 +69,7 @@ func resourceNetworkACLAssociationRead(ctx context.Context, d *schema.ResourceDa return findNetworkACLAssociationByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network ACL Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -96,7 +97,7 @@ func resourceNetworkACLAssociationDelete(ctx context.Context, d *schema.Resource nacl, err := findNetworkACL(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -150,7 +151,7 @@ func networkACLAssociationsCreate(ctx context.Context, conn *ec2.Client, naclID subnetID := v.(string) _, err := networkACLAssociationCreate(ctx, conn, naclID, subnetID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Subnet has been deleted. continue } @@ -198,7 +199,7 @@ func networkACLAssociationsDelete(ctx context.Context, conn *ec2.Client, vpcID s subnetID := v.(string) association, err := findNetworkACLAssociationBySubnetID(ctx, conn, subnetID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Subnet has been deleted. continue } diff --git a/internal/service/ec2/vpc_network_acl_association_test.go b/internal/service/ec2/vpc_network_acl_association_test.go index 003dbc3690f..680ea9973e2 100644 --- a/internal/service/ec2/vpc_network_acl_association_test.go +++ b/internal/service/ec2/vpc_network_acl_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -205,7 +205,7 @@ func testAccCheckNetworkACLAssociationDestroy(ctx context.Context) resource.Test _, err := tfec2.FindNetworkACLAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_acl_rule.go b/internal/service/ec2/vpc_network_acl_rule.go index 0976af3a04e..f436f5d0ac4 100644 --- a/internal/service/ec2/vpc_network_acl_rule.go +++ b/internal/service/ec2/vpc_network_acl_rule.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +141,7 @@ func resourceNetworkACLRuleCreate(ctx context.Context, d *schema.ResourceData, m switch { case err == nil: return sdkdiag.AppendFromErr(diags, networkACLEntryAlreadyExistsError(naclID, egress, ruleNumber)) - case tfresource.NotFound(err): + case retry.NotFound(err): break default: return sdkdiag.AppendErrorf(diags, "reading EC2 Network ACL Rule: %s", err) @@ -199,7 +200,7 @@ func resourceNetworkACLRuleRead(ctx context.Context, d *schema.ResourceData, met return findNetworkACLEntryByThreePartKey(ctx, conn, naclID, egress, ruleNumber) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network ACL Rule %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_network_acl_rule_test.go b/internal/service/ec2/vpc_network_acl_rule_test.go index a24a046f2b3..004b13cb490 100644 --- a/internal/service/ec2/vpc_network_acl_rule_test.go +++ b/internal/service/ec2/vpc_network_acl_rule_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -406,7 +406,7 @@ func testAccCheckNetworkACLRuleDestroy(ctx context.Context) resource.TestCheckFu _, err = tfec2.FindNetworkACLEntryByThreePartKey(ctx, conn, naclID, egress, ruleNumber) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_acl_test.go b/internal/service/ec2/vpc_network_acl_test.go index 77762c18fba..34f198ede6e 100644 --- a/internal/service/ec2/vpc_network_acl_test.go +++ b/internal/service/ec2/vpc_network_acl_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -589,7 +589,7 @@ func testAccCheckNetworkACLDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindNetworkACLByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_insights_analysis.go b/internal/service/ec2/vpc_network_insights_analysis.go index ea6ff5a6498..691146da108 100644 --- a/internal/service/ec2/vpc_network_insights_analysis.go +++ b/internal/service/ec2/vpc_network_insights_analysis.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1446,7 +1446,7 @@ func resourceNetworkInsightsAnalysisRead(ctx context.Context, d *schema.Resource output, err := findNetworkInsightsAnalysisByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network Insights Analysis (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_network_insights_analysis_test.go b/internal/service/ec2/vpc_network_insights_analysis_test.go index 9349132b039..43406dab29b 100644 --- a/internal/service/ec2/vpc_network_insights_analysis_test.go +++ b/internal/service/ec2/vpc_network_insights_analysis_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -214,7 +214,7 @@ func testAccCheckNetworkInsightsAnalysisDestroy(ctx context.Context) resource.Te _, err := tfec2.FindNetworkInsightsAnalysisByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_insights_path.go b/internal/service/ec2/vpc_network_insights_path.go index 63b9561e418..113d67f6cd5 100644 --- a/internal/service/ec2/vpc_network_insights_path.go +++ b/internal/service/ec2/vpc_network_insights_path.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -221,7 +222,7 @@ func resourceNetworkInsightsPathRead(ctx context.Context, d *schema.ResourceData nip, err := findNetworkInsightsPathByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network Insights Path %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_network_insights_path_test.go b/internal/service/ec2/vpc_network_insights_path_test.go index 31631d96b89..bf4fb2f99f8 100644 --- a/internal/service/ec2/vpc_network_insights_path_test.go +++ b/internal/service/ec2/vpc_network_insights_path_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -376,7 +376,7 @@ func testAccCheckNetworkInsightsPathDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindNetworkInsightsPathByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_interface.go b/internal/service/ec2/vpc_network_interface.go index 0a91573d094..dd2f5b1adbd 100644 --- a/internal/service/ec2/vpc_network_interface.go +++ b/internal/service/ec2/vpc_network_interface.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -524,7 +525,7 @@ func resourceNetworkInterfaceRead(ctx context.Context, d *schema.ResourceData, m return findNetworkInterfaceByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network Interface (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1155,7 +1156,7 @@ func detachNetworkInterface(ctx context.Context, conn *ec2.Client, networkInterf _, err = waitNetworkInterfaceDetached(ctx, conn, attachmentID, timeout) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } @@ -1548,7 +1549,7 @@ func deleteLingeringLambdaENI(ctx context.Context, g *multierror.Group, conn *ec if eni.Attachment != nil && aws.ToString(eni.Attachment.InstanceOwnerId) == "amazon-aws" { networkInterface, err := waitNetworkInterfaceAvailableAfterUse(ctx, conn, networkInterfaceID, timeout) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/ec2/vpc_network_interface_attachment.go b/internal/service/ec2/vpc_network_interface_attachment.go index 4fb99dee543..372085f1da4 100644 --- a/internal/service/ec2/vpc_network_interface_attachment.go +++ b/internal/service/ec2/vpc_network_interface_attachment.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +97,7 @@ func resourceNetworkInterfaceAttachmentRead(ctx context.Context, d *schema.Resou eni, err := findNetworkInterfaceByAttachmentID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network Interface Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_network_interface_permission.go b/internal/service/ec2/vpc_network_interface_permission.go index baa75ca613f..d599b23338c 100644 --- a/internal/service/ec2/vpc_network_interface_permission.go +++ b/internal/service/ec2/vpc_network_interface_permission.go @@ -24,7 +24,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -125,7 +125,7 @@ func (r *networkInterfacePermissionResource) Read(ctx context.Context, request r output, err := findNetworkInterfacePermissionByID(ctx, conn, data.NetworkInterfacePermissionID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/ec2/vpc_network_interface_permission_test.go b/internal/service/ec2/vpc_network_interface_permission_test.go index d095011b870..6d4975baec9 100644 --- a/internal/service/ec2/vpc_network_interface_permission_test.go +++ b/internal/service/ec2/vpc_network_interface_permission_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckNetworkInterfacePermissionDestroy(ctx context.Context) resource _, err := tfec2.FindNetworkInterfacePermissionByID(ctx, conn, rs.Primary.Attributes["network_interface_permission_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_interface_sg_attachment.go b/internal/service/ec2/vpc_network_interface_sg_attachment.go index 95938b4f2b6..f1cc0156a20 100644 --- a/internal/service/ec2/vpc_network_interface_sg_attachment.go +++ b/internal/service/ec2/vpc_network_interface_sg_attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +110,7 @@ func resourceNetworkInterfaceSGAttachmentRead(ctx context.Context, d *schema.Res return findNetworkInterfaceSecurityGroup(ctx, conn, networkInterfaceID, sgID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Network Interface (%s) Security Group (%s) Attachment not found, removing from state", networkInterfaceID, sgID) d.SetId("") return diags @@ -137,7 +138,7 @@ func resourceNetworkInterfaceSGAttachmentDelete(ctx context.Context, d *schema.R eni, err := findNetworkInterfaceByID(ctx, conn, networkInterfaceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/ec2/vpc_network_interface_sg_attachment_test.go b/internal/service/ec2/vpc_network_interface_sg_attachment_test.go index d0f6aa5b912..ee348bc3734 100644 --- a/internal/service/ec2/vpc_network_interface_sg_attachment_test.go +++ b/internal/service/ec2/vpc_network_interface_sg_attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckNetworkInterfaceSGAttachmentDestroy(ctx context.Context) resour _, err := tfec2.FindNetworkInterfaceSecurityGroup(ctx, conn, rs.Primary.Attributes[names.AttrNetworkInterfaceID], rs.Primary.Attributes["security_group_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_interface_test.go b/internal/service/ec2/vpc_network_interface_test.go index 48b48e53e55..f5145582feb 100644 --- a/internal/service/ec2/vpc_network_interface_test.go +++ b/internal/service/ec2/vpc_network_interface_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1154,7 +1154,7 @@ func testAccCheckENIDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindNetworkInterfaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_network_performance_metric_subscription.go b/internal/service/ec2/vpc_network_performance_metric_subscription.go index bf753beb78b..14bff371071 100644 --- a/internal/service/ec2/vpc_network_performance_metric_subscription.go +++ b/internal/service/ec2/vpc_network_performance_metric_subscription.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +99,7 @@ func resourceNetworkPerformanceMetricSubscriptionRead(ctx context.Context, d *sc subscription, err := findNetworkPerformanceMetricSubscriptionByFourPartKey(ctx, conn, source, destination, metric, statistic) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 AWS Network Performance Metric Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_network_performance_metric_subscription_test.go b/internal/service/ec2/vpc_network_performance_metric_subscription_test.go index 44a0877d467..9719afbf714 100644 --- a/internal/service/ec2/vpc_network_performance_metric_subscription_test.go +++ b/internal/service/ec2/vpc_network_performance_metric_subscription_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func testAccCheckNetworkPerformanceMetricSubscriptionDestroy(ctx context.Context _, err := tfec2.FindNetworkPerformanceMetricSubscriptionByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrSource], rs.Primary.Attributes[names.AttrDestination], rs.Primary.Attributes["metric"], rs.Primary.Attributes["statistic"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_peering_connection.go b/internal/service/ec2/vpc_peering_connection.go index 029719b7d2a..862ee2be662 100644 --- a/internal/service/ec2/vpc_peering_connection.go +++ b/internal/service/ec2/vpc_peering_connection.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -157,7 +158,7 @@ func resourceVPCPeeringConnectionRead(ctx context.Context, d *schema.ResourceDat vpcPeeringConnection, err := findVPCPeeringConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC Peering Connection %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_peering_connection_options.go b/internal/service/ec2/vpc_peering_connection_options.go index 75eb6a50665..f5933adff40 100644 --- a/internal/service/ec2/vpc_peering_connection_options.go +++ b/internal/service/ec2/vpc_peering_connection_options.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_vpc_peering_connection_options", name="VPC Peering Connection Options") @@ -63,7 +63,7 @@ func resourceVPCPeeringConnectionOptionsRead(ctx context.Context, d *schema.Reso vpcPeeringConnection, err := findVPCPeeringConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPC Peering Connection Options %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_peering_connection_test.go b/internal/service/ec2/vpc_peering_connection_test.go index 4e64bda0d27..b12d076d697 100644 --- a/internal/service/ec2/vpc_peering_connection_test.go +++ b/internal/service/ec2/vpc_peering_connection_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -396,7 +396,7 @@ func testAccCheckVPCPeeringConnectionDestroy(ctx context.Context) resource.TestC _, err := tfec2.FindVPCPeeringConnectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route.go b/internal/service/ec2/vpc_route.go index 80bc6666063..c9f9b3043d9 100644 --- a/internal/service/ec2/vpc_route.go +++ b/internal/service/ec2/vpc_route.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -254,7 +255,7 @@ func resourceRouteCreate(ctx context.Context, d *schema.ResourceData, meta any) if route.Origin == awstypes.RouteOriginCreateRoute { return sdkdiag.AppendFromErr(diags, routeAlreadyExistsError(routeTableID, destination)) } - case tfresource.NotFound(err): + case retry.NotFound(err): default: return sdkdiag.AppendErrorf(diags, "reading Route: %s", err) } @@ -312,7 +313,7 @@ func resourceRouteRead(ctx context.Context, d *schema.ResourceData, meta any) di return routeFinder(ctx, conn, routeTableID, destination) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route in Route Table (%s) with destination (%s) not found, removing from state", routeTableID, destination) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_route_server.go b/internal/service/ec2/vpc_route_server.go index 627095562e7..25009032357 100644 --- a/internal/service/ec2/vpc_route_server.go +++ b/internal/service/ec2/vpc_route_server.go @@ -28,8 +28,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +162,7 @@ func (r *vpcRouteServerResource) Read(ctx context.Context, request resource.Read id := fwflex.StringValueFromFramework(ctx, data.RouteServerID) rs, err := findRouteServerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_route_server_endpoint.go b/internal/service/ec2/vpc_route_server_endpoint.go index ffa000ff7b9..29ebd823fec 100644 --- a/internal/service/ec2/vpc_route_server_endpoint.go +++ b/internal/service/ec2/vpc_route_server_endpoint.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -154,7 +154,7 @@ func (r *vpcRouteServerEndpointResource) Read(ctx context.Context, request resou id := fwflex.StringValueFromFramework(ctx, data.RouteServerEndpointID) rse, err := findRouteServerEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_route_server_endpoint_test.go b/internal/service/ec2/vpc_route_server_endpoint_test.go index b4dbb25773a..8ba0a857148 100644 --- a/internal/service/ec2/vpc_route_server_endpoint_test.go +++ b/internal/service/ec2/vpc_route_server_endpoint_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +188,7 @@ func testAccCheckVPCRouteServerEndpointDestroy(ctx context.Context) resource.Tes _, err := tfec2.FindRouteServerEndpointByID(ctx, conn, rs.Primary.Attributes["route_server_endpoint_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_server_peer.go b/internal/service/ec2/vpc_route_server_peer.go index b6fd250617e..c9fa3749765 100644 --- a/internal/service/ec2/vpc_route_server_peer.go +++ b/internal/service/ec2/vpc_route_server_peer.go @@ -28,8 +28,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -203,7 +203,7 @@ func (r *vpcRouteServerPeerResource) Read(ctx context.Context, request resource. id := fwflex.StringValueFromFramework(ctx, data.RouteServerPeerID) rsp, err := findRouteServerPeerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_route_server_peer_test.go b/internal/service/ec2/vpc_route_server_peer_test.go index a0bc4ee4b64..ceb9e9078a2 100644 --- a/internal/service/ec2/vpc_route_server_peer_test.go +++ b/internal/service/ec2/vpc_route_server_peer_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -242,7 +242,7 @@ func testAccCheckVPCRouteServerPeerDestroy(ctx context.Context) resource.TestChe _, err := tfec2.FindRouteServerPeerByID(ctx, conn, rs.Primary.Attributes["route_server_peer_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_server_propagation.go b/internal/service/ec2/vpc_route_server_propagation.go index f58d3e6a1d5..244f226e393 100644 --- a/internal/service/ec2/vpc_route_server_propagation.go +++ b/internal/service/ec2/vpc_route_server_propagation.go @@ -22,7 +22,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func (r *vpcRouteServerPropagationResource) Read(ctx context.Context, request re routeServerID, routeTableID := fwflex.StringValueFromFramework(ctx, data.RouteServerID), fwflex.StringValueFromFramework(ctx, data.RouteTableID) _, err := findRouteServerPropagationByTwoPartKey(ctx, conn, routeServerID, routeTableID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_route_server_propagation_test.go b/internal/service/ec2/vpc_route_server_propagation_test.go index 65310544401..462c3a8602e 100644 --- a/internal/service/ec2/vpc_route_server_propagation_test.go +++ b/internal/service/ec2/vpc_route_server_propagation_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func testAccCheckVPCRouteServerPropagationDestroy(ctx context.Context) resource. _, err := tfec2.FindRouteServerPropagationByTwoPartKey(ctx, conn, rs.Primary.Attributes["route_server_id"], rs.Primary.Attributes["route_table_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_server_test.go b/internal/service/ec2/vpc_route_server_test.go index ee936fb9331..e6bfdebc495 100644 --- a/internal/service/ec2/vpc_route_server_test.go +++ b/internal/service/ec2/vpc_route_server_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -290,7 +290,7 @@ func testAccCheckVPCRouteServerDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindRouteServerByID(ctx, conn, rs.Primary.Attributes["route_server_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_server_vpc_association.go b/internal/service/ec2/vpc_route_server_vpc_association.go index f6f6b7380e9..8a8fbc985bd 100644 --- a/internal/service/ec2/vpc_route_server_vpc_association.go +++ b/internal/service/ec2/vpc_route_server_vpc_association.go @@ -22,7 +22,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func (r *vpcRouteServerVPCAssociationResource) Read(ctx context.Context, request routeServerID, vpcID := fwflex.StringValueFromFramework(ctx, data.RouteServerID), fwflex.StringValueFromFramework(ctx, data.VpcID) _, err := findRouteServerAssociationByTwoPartKey(ctx, conn, routeServerID, vpcID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_route_server_vpc_association_test.go b/internal/service/ec2/vpc_route_server_vpc_association_test.go index b0b4712abb1..e1707c947d3 100644 --- a/internal/service/ec2/vpc_route_server_vpc_association_test.go +++ b/internal/service/ec2/vpc_route_server_vpc_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func testAccCheckVPCRouteServerVPCAssociationDestroy(ctx context.Context) resour _, err := tfec2.FindRouteServerAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["route_server_id"], rs.Primary.Attributes[names.AttrVPCID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_table.go b/internal/service/ec2/vpc_route_table.go index 4ce12ea1803..f0c306ae050 100644 --- a/internal/service/ec2/vpc_route_table.go +++ b/internal/service/ec2/vpc_route_table.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -217,7 +218,7 @@ func resourceRouteTableRead(ctx context.Context, d *schema.ResourceData, meta an return findRouteTableByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route Table (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -345,7 +346,7 @@ func resourceRouteTableDelete(ctx context.Context, d *schema.ResourceData, meta routeTable, err := findRouteTableByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -491,7 +492,7 @@ func routeTableAddRoute(ctx context.Context, conn *ec2.Client, routeTableID stri errCodeInvalidRouteNotFound, ) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return fmt.Errorf("local route cannot be created but must exist to be adopted, %s %s does not exist", target, destination) } diff --git a/internal/service/ec2/vpc_route_table_association.go b/internal/service/ec2/vpc_route_table_association.go index 87de94529aa..53933a6c08c 100644 --- a/internal/service/ec2/vpc_route_table_association.go +++ b/internal/service/ec2/vpc_route_table_association.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +106,7 @@ func resourceRouteTableAssociationRead(ctx context.Context, d *schema.ResourceDa return findRouteTableAssociationByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route Table Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_route_table_association_test.go b/internal/service/ec2/vpc_route_table_association_test.go index f8bd6902db6..c7ebdc0fbdc 100644 --- a/internal/service/ec2/vpc_route_table_association_test.go +++ b/internal/service/ec2/vpc_route_table_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +188,7 @@ func testAccCheckRouteTableAssociationDestroy(ctx context.Context) resource.Test _, err := tfec2.FindRouteTableAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index a07756b4488..d17cdec448a 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -1216,7 +1217,7 @@ func testAccCheckRouteTableDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindRouteTableByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_route_test.go b/internal/service/ec2/vpc_route_test.go index 8bd99fedd2a..7ce2dd34a9b 100644 --- a/internal/service/ec2/vpc_route_test.go +++ b/internal/service/ec2/vpc_route_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2319,7 +2319,7 @@ func testAccCheckRouteDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfec2.FindRouteByPrefixListIDDestination(ctx, conn, rs.Primary.Attributes["route_table_id"], v) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_security_group.go b/internal/service/ec2/vpc_security_group.go index b335b96d447..de46b96fa2b 100644 --- a/internal/service/ec2/vpc_security_group.go +++ b/internal/service/ec2/vpc_security_group.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -269,7 +270,7 @@ func resourceSecurityGroupRead(ctx context.Context, d *schema.ResourceData, meta sg, err := findSecurityGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_security_group_egress_rule_test.go b/internal/service/ec2/vpc_security_group_egress_rule_test.go index b7b90cdc528..7ec45e7f34a 100644 --- a/internal/service/ec2/vpc_security_group_egress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_egress_rule_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckSecurityGroupEgressRuleDestroy(ctx context.Context) resource.Te _, err := tfec2.FindSecurityGroupEgressRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_security_group_ingress_rule.go b/internal/service/ec2/vpc_security_group_ingress_rule.go index 9832f31ab1f..696f126ae71 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule.go @@ -36,8 +36,8 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -277,7 +277,7 @@ func (r *securityGroupRuleResource) Read(ctx context.Context, request resource.R output, err := r.findByID(ctx, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_security_group_ingress_rule_test.go b/internal/service/ec2/vpc_security_group_ingress_rule_test.go index f9bb9385138..a90572ed585 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -643,7 +643,7 @@ func testAccCheckSecurityGroupIngressRuleDestroy(ctx context.Context) resource.T _, err := tfec2.FindSecurityGroupIngressRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_security_group_rule.go b/internal/service/ec2/vpc_security_group_rule.go index aa198b19cf6..ea8c3fb3077 100644 --- a/internal/service/ec2/vpc_security_group_rule.go +++ b/internal/service/ec2/vpc_security_group_rule.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -269,7 +270,7 @@ func resourceSecurityGroupRuleRead(ctx context.Context, d *schema.ResourceData, sg, err := findSecurityGroupByID(ctx, conn, securityGroupID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Group (%s) not found, removing from state", securityGroupID) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_security_group_test.go b/internal/service/ec2/vpc_security_group_test.go index cf36fb337cc..5bbaafc17e0 100644 --- a/internal/service/ec2/vpc_security_group_test.go +++ b/internal/service/ec2/vpc_security_group_test.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2511,7 +2511,7 @@ func TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend(t *testing.T) { conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Client(ctx) match, err := tfec2.FindSecurityGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Fatalf("PreConfig check failed: Security Group (%s) not found: %s", id, err) } if err != nil { @@ -2809,7 +2809,7 @@ func testAccCheckSecurityGroupDestroy(ctx context.Context) resource.TestCheckFun _, err := tfec2.FindSecurityGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -2882,7 +2882,7 @@ func testSecurityGroupRuleCount(ctx context.Context, id string, expectedIngressC conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Client(ctx) group, err := tfec2.FindSecurityGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return fmt.Errorf("Security Group (%s) not found: %w", id, err) } if err != nil { diff --git a/internal/service/ec2/vpc_security_group_vpc_association.go b/internal/service/ec2/vpc_security_group_vpc_association.go index 1895aa1541c..61aa134d3c5 100644 --- a/internal/service/ec2/vpc_security_group_vpc_association.go +++ b/internal/service/ec2/vpc_security_group_vpc_association.go @@ -23,7 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +135,7 @@ func (r *securityGroupVPCAssociationResource) Read(ctx context.Context, request output, err := findSecurityGroupVPCAssociationByTwoPartKey(ctx, conn, data.GroupID.ValueString(), data.VPCID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ec2/vpc_security_group_vpc_association_test.go b/internal/service/ec2/vpc_security_group_vpc_association_test.go index e68c1151606..2ac1d291104 100644 --- a/internal/service/ec2/vpc_security_group_vpc_association_test.go +++ b/internal/service/ec2/vpc_security_group_vpc_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -147,7 +147,7 @@ func testAccCheckSecurityGroupVPCAssociationDestroy(ctx context.Context) resourc _, err := tfec2.FindSecurityGroupVPCAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["security_group_id"], rs.Primary.Attributes[names.AttrVPCID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_subnet.go b/internal/service/ec2/vpc_subnet.go index 068099df1a3..95cd9674579 100644 --- a/internal/service/ec2/vpc_subnet.go +++ b/internal/service/ec2/vpc_subnet.go @@ -30,6 +30,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -254,7 +255,7 @@ func resourceSubnetRead(ctx context.Context, d *schema.ResourceData, meta any) d return findSubnetByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Subnet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_subnet_cidr_reservation.go b/internal/service/ec2/vpc_subnet_cidr_reservation.go index 84d26d29b1f..17a64d968c3 100644 --- a/internal/service/ec2/vpc_subnet_cidr_reservation.go +++ b/internal/service/ec2/vpc_subnet_cidr_reservation.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func resourceSubnetCIDRReservationRead(ctx context.Context, d *schema.ResourceDa output, err := findSubnetCIDRReservationBySubnetIDAndReservationID(ctx, conn, d.Get(names.AttrSubnetID).(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Subnet CIDR Reservation (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_subnet_cidr_reservation_test.go b/internal/service/ec2/vpc_subnet_cidr_reservation_test.go index 68b92d5b18d..3dc6b953352 100644 --- a/internal/service/ec2/vpc_subnet_cidr_reservation_test.go +++ b/internal/service/ec2/vpc_subnet_cidr_reservation_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -141,7 +141,7 @@ func testAccCheckSubnetCIDRReservationDestroy(ctx context.Context) resource.Test _, err := tfec2.FindSubnetCIDRReservationBySubnetIDAndReservationID(ctx, conn, rs.Primary.Attributes[names.AttrSubnetID], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_subnet_test.go b/internal/service/ec2/vpc_subnet_test.go index 5a52cb74b1b..e0a00006813 100644 --- a/internal/service/ec2/vpc_subnet_test.go +++ b/internal/service/ec2/vpc_subnet_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -684,7 +684,7 @@ func testAccCheckSubnetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindSubnetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_traffic_mirror_filter.go b/internal/service/ec2/vpc_traffic_mirror_filter.go index 7f699c8337a..909f94f50a6 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func resourceTrafficMirrorFilterRead(ctx context.Context, d *schema.ResourceData trafficMirrorFilter, err := findTrafficMirrorFilterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Traffic Mirror Filter %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_traffic_mirror_filter_rule.go b/internal/service/ec2/vpc_traffic_mirror_filter_rule.go index f900dd2910f..fb7734b2258 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_rule.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_rule.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func resourceTrafficMirrorFilterRuleRead(ctx context.Context, d *schema.Resource rule, err := findTrafficMirrorFilterRuleByTwoPartKey(ctx, conn, d.Get("traffic_mirror_filter_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Traffic Mirror Filter Rule %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go b/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go index ab96d2ed4dd..986b15a1259 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +188,7 @@ func testAccCheckTrafficMirrorFilterRuleDestroy(ctx context.Context) resource.Te _, err := tfec2.FindTrafficMirrorFilterRuleByTwoPartKey(ctx, conn, rs.Primary.Attributes["traffic_mirror_filter_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_traffic_mirror_filter_test.go b/internal/service/ec2/vpc_traffic_mirror_filter_test.go index 530df260789..831910d8057 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckTrafficMirrorFilterDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindTrafficMirrorFilterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_traffic_mirror_session.go b/internal/service/ec2/vpc_traffic_mirror_session.go index ed6f3baae7a..7201b7fb38a 100644 --- a/internal/service/ec2/vpc_traffic_mirror_session.go +++ b/internal/service/ec2/vpc_traffic_mirror_session.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func resourceTrafficMirrorSessionRead(ctx context.Context, d *schema.ResourceDat session, err := findTrafficMirrorSessionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Traffic Mirror Session %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_traffic_mirror_session_test.go b/internal/service/ec2/vpc_traffic_mirror_session_test.go index 63dd48d17da..22ffcc49fc2 100644 --- a/internal/service/ec2/vpc_traffic_mirror_session_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_session_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -234,7 +234,7 @@ func testAccCheckTrafficMirrorSessionDestroy(ctx context.Context) resource.TestC _, err := tfec2.FindTrafficMirrorSessionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpc_traffic_mirror_target.go b/internal/service/ec2/vpc_traffic_mirror_target.go index 0373400d425..dfbb6f4e510 100644 --- a/internal/service/ec2/vpc_traffic_mirror_target.go +++ b/internal/service/ec2/vpc_traffic_mirror_target.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func resourceTrafficMirrorTargetRead(ctx context.Context, d *schema.ResourceData target, err := findTrafficMirrorTargetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Traffic Mirror Target %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpc_traffic_mirror_target_test.go b/internal/service/ec2/vpc_traffic_mirror_target_test.go index c478603d58b..f5648413a5d 100644 --- a/internal/service/ec2/vpc_traffic_mirror_target_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_target_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -225,7 +225,7 @@ func testAccCheckTrafficMirrorTargetDestroy(ctx context.Context) resource.TestCh _, err := tfec2.FindTrafficMirrorTargetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnclient_authorization_rule.go b/internal/service/ec2/vpnclient_authorization_rule.go index 5262adcaa0a..9bc9703aa06 100644 --- a/internal/service/ec2/vpnclient_authorization_rule.go +++ b/internal/service/ec2/vpnclient_authorization_rule.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -127,7 +127,7 @@ func resourceClientVPNAuthorizationRuleRead(ctx context.Context, d *schema.Resou rule, err := findClientVPNAuthorizationRuleByThreePartKey(ctx, conn, endpointID, targetNetworkCIDR, accessGroupID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Client VPN Authorization Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnclient_authorization_rule_test.go b/internal/service/ec2/vpnclient_authorization_rule_test.go index af2c5b904b6..ff0209d835b 100644 --- a/internal/service/ec2/vpnclient_authorization_rule_test.go +++ b/internal/service/ec2/vpnclient_authorization_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -253,7 +253,7 @@ func testAccCheckClientVPNAuthorizationRuleDestroy(ctx context.Context) resource _, err := tfec2.FindClientVPNAuthorizationRuleByThreePartKey(ctx, conn, rs.Primary.Attributes["client_vpn_endpoint_id"], rs.Primary.Attributes["target_network_cidr"], rs.Primary.Attributes["access_group_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnclient_endpoint.go b/internal/service/ec2/vpnclient_endpoint.go index 679f48f3594..291307984cc 100644 --- a/internal/service/ec2/vpnclient_endpoint.go +++ b/internal/service/ec2/vpnclient_endpoint.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -352,7 +352,7 @@ func resourceClientVPNEndpointRead(ctx context.Context, d *schema.ResourceData, ep, err := findClientVPNEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Client VPN Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnclient_endpoint_test.go b/internal/service/ec2/vpnclient_endpoint_test.go index 4002344b4ff..38ecced07c7 100644 --- a/internal/service/ec2/vpnclient_endpoint_test.go +++ b/internal/service/ec2/vpnclient_endpoint_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -864,7 +864,7 @@ func testAccCheckClientVPNEndpointDestroy(ctx context.Context) resource.TestChec _, err := tfec2.FindClientVPNEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnclient_network_association.go b/internal/service/ec2/vpnclient_network_association.go index 21584160671..25fdf370975 100644 --- a/internal/service/ec2/vpnclient_network_association.go +++ b/internal/service/ec2/vpnclient_network_association.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func resourceClientVPNNetworkAssociationRead(ctx context.Context, d *schema.Reso endpointID := d.Get("client_vpn_endpoint_id").(string) network, err := findClientVPNNetworkAssociationByTwoPartKey(ctx, conn, d.Id(), endpointID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Client VPN Network Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnclient_network_association_test.go b/internal/service/ec2/vpnclient_network_association_test.go index 0474e88c0f3..a309542bf92 100644 --- a/internal/service/ec2/vpnclient_network_association_test.go +++ b/internal/service/ec2/vpnclient_network_association_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +133,7 @@ func testAccCheckClientVPNNetworkAssociationDestroy(ctx context.Context) resourc _, err := tfec2.FindClientVPNNetworkAssociationByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["client_vpn_endpoint_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnclient_route.go b/internal/service/ec2/vpnclient_route.go index e9065f24010..dc20cb8d3cc 100644 --- a/internal/service/ec2/vpnclient_route.go +++ b/internal/service/ec2/vpnclient_route.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -120,7 +121,7 @@ func resourceClientVPNRouteRead(ctx context.Context, d *schema.ResourceData, met route, err := findClientVPNRouteByThreePartKey(ctx, conn, endpointID, targetSubnetID, destinationCIDR) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Client VPN Route (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnclient_route_test.go b/internal/service/ec2/vpnclient_route_test.go index 4d2b808a57e..69f3db15733 100644 --- a/internal/service/ec2/vpnclient_route_test.go +++ b/internal/service/ec2/vpnclient_route_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -127,7 +127,7 @@ func testAccCheckClientVPNRouteDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindClientVPNRouteByThreePartKey(ctx, conn, rs.Primary.Attributes["client_vpn_endpoint_id"], rs.Primary.Attributes["target_vpc_subnet_id"], rs.Primary.Attributes["destination_cidr_block"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_concentrator.go b/internal/service/ec2/vpnsite_concentrator.go index 0ece6149ee8..94f0294095b 100644 --- a/internal/service/ec2/vpnsite_concentrator.go +++ b/internal/service/ec2/vpnsite_concentrator.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func (r *vpnConcentratorResource) Read(ctx context.Context, request resource.Rea id := fwflex.StringValueFromFramework(ctx, data.VPNConcentratorID) output, err := findVPNConcentratorByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/ec2/vpnsite_concentrator_test.go b/internal/service/ec2/vpnsite_concentrator_test.go index edea9699d33..7468bac0f9b 100644 --- a/internal/service/ec2/vpnsite_concentrator_test.go +++ b/internal/service/ec2/vpnsite_concentrator_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckVPNConcentratorDestroy(ctx context.Context) resource.TestCheckF _, err := tfec2.FindVPNConcentratorByID(ctx, conn, rs.Primary.Attributes["vpn_concentrator_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_connection.go b/internal/service/ec2/vpnsite_connection.go index 7e705530fe9..1c2c03d8228 100644 --- a/internal/service/ec2/vpnsite_connection.go +++ b/internal/service/ec2/vpnsite_connection.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -773,7 +773,7 @@ func resourceVPNConnectionRead(ctx context.Context, d *schema.ResourceData, meta vpnConnection, err := findVPNConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPN Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnsite_connection_route.go b/internal/service/ec2/vpnsite_connection_route.go index 8975eba0a8d..075981c3b24 100644 --- a/internal/service/ec2/vpnsite_connection_route.go +++ b/internal/service/ec2/vpnsite_connection_route.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_vpn_connection_route", name="VPN Connection Route") @@ -79,7 +79,7 @@ func resourceVPNConnectionRouteRead(ctx context.Context, d *schema.ResourceData, _, err = findVPNConnectionRouteByTwoPartKey(ctx, conn, vpnConnectionID, cidrBlock) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPN Connection Route (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnsite_connection_route_test.go b/internal/service/ec2/vpnsite_connection_route_test.go index 110b3c99e9e..567e9c9a4a1 100644 --- a/internal/service/ec2/vpnsite_connection_route_test.go +++ b/internal/service/ec2/vpnsite_connection_route_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -75,7 +75,7 @@ func testAccCheckVPNConnectionRouteDestroy(ctx context.Context) resource.TestChe _, err := tfec2.FindVPNConnectionRouteByTwoPartKey(ctx, conn, rs.Primary.Attributes["vpn_connection_id"], rs.Primary.Attributes["destination_cidr_block"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_connection_test.go b/internal/service/ec2/vpnsite_connection_test.go index 5ed08bfbf34..13573b3eb7e 100644 --- a/internal/service/ec2/vpnsite_connection_test.go +++ b/internal/service/ec2/vpnsite_connection_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1926,7 +1926,7 @@ func testAccCheckVPNConnectionDestroy(ctx context.Context) resource.TestCheckFun _, err := tfec2.FindVPNConnectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_customer_gateway.go b/internal/service/ec2/vpnsite_customer_gateway.go index 259dbc33436..3efe6b2dbba 100644 --- a/internal/service/ec2/vpnsite_customer_gateway.go +++ b/internal/service/ec2/vpnsite_customer_gateway.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func resourceCustomerGatewayRead(ctx context.Context, d *schema.ResourceData, me customerGateway, err := findCustomerGatewayByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Customer Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnsite_customer_gateway_test.go b/internal/service/ec2/vpnsite_customer_gateway_test.go index 5a351241833..79050001ea4 100644 --- a/internal/service/ec2/vpnsite_customer_gateway_test.go +++ b/internal/service/ec2/vpnsite_customer_gateway_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -282,7 +282,7 @@ func testAccCheckCustomerGatewayDestroy(ctx context.Context) resource.TestCheckF _, err := tfec2.FindCustomerGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_gateway.go b/internal/service/ec2/vpnsite_gateway.go index 3a06aca9f0c..9b0908988c9 100644 --- a/internal/service/ec2/vpnsite_gateway.go +++ b/internal/service/ec2/vpnsite_gateway.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -110,7 +111,7 @@ func resourceVPNGatewayRead(ctx context.Context, d *schema.ResourceData, meta an return findVPNGatewayByID(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPN Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/vpnsite_gateway_attachment.go b/internal/service/ec2/vpnsite_gateway_attachment.go index b4865ac2416..ed3909ace07 100644 --- a/internal/service/ec2/vpnsite_gateway_attachment.go +++ b/internal/service/ec2/vpnsite_gateway_attachment.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +78,7 @@ func resourceVPNGatewayAttachmentRead(ctx context.Context, d *schema.ResourceDat _, err := findVPNGatewayVPCAttachmentByTwoPartKey(ctx, conn, vpnGatewayID, vpcID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 VPN Gateway (%s) Attachment (%s) not found, removing from state", vpnGatewayID, vpcID) d.SetId("") return diags diff --git a/internal/service/ec2/vpnsite_gateway_attachment_test.go b/internal/service/ec2/vpnsite_gateway_attachment_test.go index 904095f6e78..ef56b10e4cf 100644 --- a/internal/service/ec2/vpnsite_gateway_attachment_test.go +++ b/internal/service/ec2/vpnsite_gateway_attachment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -101,7 +101,7 @@ func testAccCheckVPNGatewayAttachmentDestroy(ctx context.Context) resource.TestC _, err := tfec2.FindVPNGatewayVPCAttachmentByTwoPartKey(ctx, conn, rs.Primary.Attributes["vpn_gateway_id"], rs.Primary.Attributes[names.AttrVPCID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_gateway_route_propagation.go b/internal/service/ec2/vpnsite_gateway_route_propagation.go index cff9522b4f9..e39722744b2 100644 --- a/internal/service/ec2/vpnsite_gateway_route_propagation.go +++ b/internal/service/ec2/vpnsite_gateway_route_propagation.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_vpn_gateway_route_propagation", name="VPN Gateway Route Propagation") @@ -91,7 +91,7 @@ func resourceVPNGatewayRoutePropagationRead(ctx context.Context, d *schema.Resou err = findVPNGatewayRoutePropagationExists(ctx, conn, routeTableID, gatewayID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route Table (%s) VPN Gateway (%s) route propagation not found, removing from state", routeTableID, gatewayID) d.SetId("") return diags diff --git a/internal/service/ec2/vpnsite_gateway_route_propagation_test.go b/internal/service/ec2/vpnsite_gateway_route_propagation_test.go index c492c709850..89b69bbe369 100644 --- a/internal/service/ec2/vpnsite_gateway_route_propagation_test.go +++ b/internal/service/ec2/vpnsite_gateway_route_propagation_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -102,7 +102,7 @@ func testAccCheckVPNGatewayRoutePropagationDestroy(ctx context.Context) resource err = tfec2.FindVPNGatewayRoutePropagationExists(ctx, conn, routeTableID, gatewayID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/vpnsite_gateway_test.go b/internal/service/ec2/vpnsite_gateway_test.go index 8ae36519995..c5e528401be 100644 --- a/internal/service/ec2/vpnsite_gateway_test.go +++ b/internal/service/ec2/vpnsite_gateway_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -305,7 +305,7 @@ func testAccCheckVPNGatewayDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfec2.FindVPNGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ec2/wavelength_carrier_gateway.go b/internal/service/ec2/wavelength_carrier_gateway.go index fe33a7897aa..ba7460f634b 100644 --- a/internal/service/ec2/wavelength_carrier_gateway.go +++ b/internal/service/ec2/wavelength_carrier_gateway.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +87,7 @@ func resourceCarrierGatewayRead(ctx context.Context, d *schema.ResourceData, met carrierGateway, err := findCarrierGatewayByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EC2 Carrier Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ec2/wavelength_carrier_gateway_test.go b/internal/service/ec2/wavelength_carrier_gateway_test.go index e248b6d5366..1d4ae22ef7b 100644 --- a/internal/service/ec2/wavelength_carrier_gateway_test.go +++ b/internal/service/ec2/wavelength_carrier_gateway_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +134,7 @@ func testAccCheckCarrierGatewayDestroy(ctx context.Context) resource.TestCheckFu _, err := tfec2.FindCarrierGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 836b9f9d8b84c5338c71dd675bc45df6988f01af Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:08 -0800 Subject: [PATCH 078/227] `ecr` --- internal/service/ecr/account_setting.go | 3 ++- internal/service/ecr/lifecycle_policy.go | 3 ++- internal/service/ecr/lifecycle_policy_test.go | 4 ++-- internal/service/ecr/pull_through_cache_rule.go | 3 ++- internal/service/ecr/pull_through_cache_rule_test.go | 4 ++-- internal/service/ecr/registry_policy.go | 3 ++- internal/service/ecr/registry_policy_test.go | 4 ++-- internal/service/ecr/registry_scanning_configuration.go | 3 ++- internal/service/ecr/replication_configuration.go | 3 ++- internal/service/ecr/replication_configuration_test.go | 4 ++-- internal/service/ecr/repository.go | 3 ++- internal/service/ecr/repository_creation_template.go | 3 ++- internal/service/ecr/repository_creation_template_test.go | 4 ++-- internal/service/ecr/repository_policy.go | 3 ++- internal/service/ecr/repository_policy_test.go | 4 ++-- internal/service/ecr/repository_test.go | 4 ++-- 16 files changed, 32 insertions(+), 23 deletions(-) diff --git a/internal/service/ecr/account_setting.go b/internal/service/ecr/account_setting.go index 7547aa26324..6cd81e6ed46 100644 --- a/internal/service/ecr/account_setting.go +++ b/internal/service/ecr/account_setting.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +97,7 @@ func (r *accountSettingResource) Read(ctx context.Context, request resource.Read name := data.Name.ValueString() output, err := findAccountSettingByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ecr/lifecycle_policy.go b/internal/service/ecr/lifecycle_policy.go index 9dd39dec73c..d0c94ab1097 100644 --- a/internal/service/ecr/lifecycle_policy.go +++ b/internal/service/ecr/lifecycle_policy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfjson "github.com/hashicorp/terraform-provider-aws/internal/json" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -97,7 +98,7 @@ func resourceLifecyclePolicyRead(ctx context.Context, d *schema.ResourceData, me return findLifecyclePolicyByRepositoryName(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Lifecycle Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/lifecycle_policy_test.go b/internal/service/ecr/lifecycle_policy_test.go index edfa4addf3c..bc2dedf2c3a 100644 --- a/internal/service/ecr/lifecycle_policy_test.go +++ b/internal/service/ecr/lifecycle_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +184,7 @@ func testAccCheckLifecyclePolicyDestroy(ctx context.Context) resource.TestCheckF _, err := tfecr.FindLifecyclePolicyByRepositoryName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecr/pull_through_cache_rule.go b/internal/service/ecr/pull_through_cache_rule.go index 065b46405af..b3e66aeb0fc 100644 --- a/internal/service/ecr/pull_through_cache_rule.go +++ b/internal/service/ecr/pull_through_cache_rule.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -119,7 +120,7 @@ func resourcePullThroughCacheRuleRead(ctx context.Context, d *schema.ResourceDat rule, err := findPullThroughCacheRuleByRepositoryPrefix(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Pull Through Cache Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/pull_through_cache_rule_test.go b/internal/service/ecr/pull_through_cache_rule_test.go index a231705b2b4..4beb5ddcae6 100644 --- a/internal/service/ecr/pull_through_cache_rule_test.go +++ b/internal/service/ecr/pull_through_cache_rule_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -224,7 +224,7 @@ func testAccCheckPullThroughCacheRuleDestroy(ctx context.Context) resource.TestC _, err := tfecr.FindPullThroughCacheRuleByRepositoryPrefix(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecr/registry_policy.go b/internal/service/ecr/registry_policy.go index e1191752ec6..3b79c79d7c0 100644 --- a/internal/service/ecr/registry_policy.go +++ b/internal/service/ecr/registry_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -85,7 +86,7 @@ func resourceRegistryPolicyRead(ctx context.Context, d *schema.ResourceData, met output, err := findRegistryPolicy(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Registry Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/registry_policy_test.go b/internal/service/ecr/registry_policy_test.go index 939e6c52578..b6fc2c09955 100644 --- a/internal/service/ecr/registry_policy_test.go +++ b/internal/service/ecr/registry_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -101,7 +101,7 @@ func testAccCheckRegistryPolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfecr.FindRegistryPolicy(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecr/registry_scanning_configuration.go b/internal/service/ecr/registry_scanning_configuration.go index b216673a57d..4691642dde4 100644 --- a/internal/service/ecr/registry_scanning_configuration.go +++ b/internal/service/ecr/registry_scanning_configuration.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +113,7 @@ func resourceRegistryScanningConfigurationRead(ctx context.Context, d *schema.Re output, err := findRegistryScanningConfiguration(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Registry Scanning Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/replication_configuration.go b/internal/service/ecr/replication_configuration.go index c7e971e633c..f3b26119740 100644 --- a/internal/service/ecr/replication_configuration.go +++ b/internal/service/ecr/replication_configuration.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -124,7 +125,7 @@ func resourceReplicationConfigurationRead(ctx context.Context, d *schema.Resourc output, err := findReplicationConfiguration(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Replication Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/replication_configuration_test.go b/internal/service/ecr/replication_configuration_test.go index de438de93ed..079f07c4d49 100644 --- a/internal/service/ecr/replication_configuration_test.go +++ b/internal/service/ecr/replication_configuration_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -209,7 +209,7 @@ func testAccCheckReplicationConfigurationDestroy(ctx context.Context) resource.T _, err := tfecr.FindReplicationConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecr/repository.go b/internal/service/ecr/repository.go index b42782e20cb..6910a14e4af 100644 --- a/internal/service/ecr/repository.go +++ b/internal/service/ecr/repository.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -208,7 +209,7 @@ func resourceRepositoryRead(ctx context.Context, d *schema.ResourceData, meta an return findRepositoryByName(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Repository (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/repository_creation_template.go b/internal/service/ecr/repository_creation_template.go index cbbc530268d..cf6119e6eb8 100644 --- a/internal/service/ecr/repository_creation_template.go +++ b/internal/service/ecr/repository_creation_template.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -210,7 +211,7 @@ func resourceRepositoryCreationTemplateRead(ctx context.Context, d *schema.Resou rct, registryID, err := findRepositoryCreationTemplateByRepositoryPrefix(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Repository Creation Template (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/repository_creation_template_test.go b/internal/service/ecr/repository_creation_template_test.go index bfb633d49ed..b5e38802458 100644 --- a/internal/service/ecr/repository_creation_template_test.go +++ b/internal/service/ecr/repository_creation_template_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -252,7 +252,7 @@ func testAccCheckRepositoryCreationTemplateDestroy(ctx context.Context) resource _, _, err := tfecr.FindRepositoryCreationTemplateByRepositoryPrefix(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecr/repository_policy.go b/internal/service/ecr/repository_policy.go index 57f984e6c73..e41929080ef 100644 --- a/internal/service/ecr/repository_policy.go +++ b/internal/service/ecr/repository_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -87,7 +88,7 @@ func resourceRepositoryPolicyRead(ctx context.Context, d *schema.ResourceData, m return findRepositoryPolicyByRepositoryName(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Repository Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecr/repository_policy_test.go b/internal/service/ecr/repository_policy_test.go index 7773e775196..9646f898b91 100644 --- a/internal/service/ecr/repository_policy_test.go +++ b/internal/service/ecr/repository_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -198,7 +198,7 @@ func testAccCheckRepositoryPolicyDestroy(ctx context.Context) resource.TestCheck _, err := tfecr.FindRepositoryPolicyByRepositoryName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecr/repository_test.go b/internal/service/ecr/repository_test.go index 39ad3899583..74e11bbea38 100644 --- a/internal/service/ecr/repository_test.go +++ b/internal/service/ecr/repository_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -465,7 +465,7 @@ func testAccCheckRepositoryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfecr.FindRepositoryByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a0fc733e0da2cb94095744461dc8df538f14ae6a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:12 -0800 Subject: [PATCH 079/227] `ecrpublic` --- internal/service/ecrpublic/repository_policy.go | 3 ++- internal/service/ecrpublic/repository_policy_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/service/ecrpublic/repository_policy.go b/internal/service/ecrpublic/repository_policy.go index df2103e5080..9d87c5edc13 100644 --- a/internal/service/ecrpublic/repository_policy.go +++ b/internal/service/ecrpublic/repository_policy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -110,7 +111,7 @@ func resourceRepositoryPolicyRead(ctx context.Context, d *schema.ResourceData, m output, err := FindRepositoryPolicyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECR Public Repository Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecrpublic/repository_policy_test.go b/internal/service/ecrpublic/repository_policy_test.go index baab9e98f7c..6bde3e32134 100644 --- a/internal/service/ecrpublic/repository_policy_test.go +++ b/internal/service/ecrpublic/repository_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecrpublic "github.com/hashicorp/terraform-provider-aws/internal/service/ecrpublic" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -147,7 +147,7 @@ func testAccCheckRepositoryPolicyDestroy(ctx context.Context) resource.TestCheck _, err := tfecrpublic.FindRepositoryPolicyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 16005136a915dd370b2d76c026c0d000b5c4545e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:13 -0800 Subject: [PATCH 080/227] `ecs` --- internal/service/ecs/account_setting_default.go | 3 ++- internal/service/ecs/account_setting_default_test.go | 4 ++-- internal/service/ecs/capacity_provider.go | 7 ++++--- internal/service/ecs/capacity_provider_test.go | 4 ++-- internal/service/ecs/cluster.go | 5 +++-- internal/service/ecs/cluster_capacity_providers.go | 3 ++- internal/service/ecs/cluster_test.go | 4 ++-- internal/service/ecs/express_gateway_service.go | 9 +++++---- internal/service/ecs/express_gateway_service_test.go | 4 ++-- internal/service/ecs/service.go | 9 +++++---- internal/service/ecs/service_test.go | 5 +++-- internal/service/ecs/tag_gen.go | 4 ++-- internal/service/ecs/tag_gen_test.go | 4 ++-- internal/service/ecs/task_definition.go | 3 ++- internal/service/ecs/task_definition_test.go | 4 ++-- internal/service/ecs/task_set.go | 7 ++++--- internal/service/ecs/task_set_test.go | 4 ++-- 17 files changed, 46 insertions(+), 37 deletions(-) diff --git a/internal/service/ecs/account_setting_default.go b/internal/service/ecs/account_setting_default.go index 1e852bd4a7c..ecc27284948 100644 --- a/internal/service/ecs/account_setting_default.go +++ b/internal/service/ecs/account_setting_default.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -80,7 +81,7 @@ func resourceAccountSettingDefaultRead(ctx context.Context, d *schema.ResourceDa settingName := awstypes.SettingName(d.Get(names.AttrName).(string)) setting, err := findEffectiveAccountSettingByName(ctx, conn, settingName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Account Setting Default (%s) not found, removing from state", settingName) d.SetId("") return diags diff --git a/internal/service/ecs/account_setting_default_test.go b/internal/service/ecs/account_setting_default_test.go index 72c620ce003..486990c5f9c 100644 --- a/internal/service/ecs/account_setting_default_test.go +++ b/internal/service/ecs/account_setting_default_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -307,7 +307,7 @@ func testAccCheckAccountSettingDefaultDestroy(ctx context.Context) resource.Test settingName := awstypes.SettingName(rs.Primary.Attributes[names.AttrName]) output, err := tfecs.FindEffectiveAccountSettingByName(ctx, conn, settingName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/ecs/capacity_provider.go b/internal/service/ecs/capacity_provider.go index 59f24fa0ce7..3c080200430 100644 --- a/internal/service/ecs/capacity_provider.go +++ b/internal/service/ecs/capacity_provider.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -589,7 +590,7 @@ func resourceCapacityProviderRead(ctx context.Context, d *schema.ResourceData, m output, err := findCapacityProviderByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Capacity Provider (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -744,7 +745,7 @@ func statusCapacityProvider(ctx context.Context, conn *ecs.Client, arn string) s return func() (any, string, error) { output, err := findCapacityProviderByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -760,7 +761,7 @@ func statusCapacityProviderUpdate(ctx context.Context, conn *ecs.Client, arn str return func() (any, string, error) { output, err := findCapacityProviderByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ecs/capacity_provider_test.go b/internal/service/ecs/capacity_provider_test.go index 2cd78ddf881..2d42818b096 100644 --- a/internal/service/ecs/capacity_provider_test.go +++ b/internal/service/ecs/capacity_provider_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -468,7 +468,7 @@ func testAccCheckCapacityProviderDestroy(ctx context.Context) resource.TestCheck _, err := tfecs.FindCapacityProviderByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } if err != nil { diff --git a/internal/service/ecs/cluster.go b/internal/service/ecs/cluster.go index 2fe26bd9b86..c359f7d4648 100644 --- a/internal/service/ecs/cluster.go +++ b/internal/service/ecs/cluster.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -234,7 +235,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) return findClusterByNameOrARN(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -426,7 +427,7 @@ func statusCluster(ctx context.Context, conn *ecs.Client, arn string) sdkretry.S return func() (any, string, error) { cluster, err := findClusterByNameOrARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ecs/cluster_capacity_providers.go b/internal/service/ecs/cluster_capacity_providers.go index c2fec8cac0b..468e1a6825c 100644 --- a/internal/service/ecs/cluster_capacity_providers.go +++ b/internal/service/ecs/cluster_capacity_providers.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +115,7 @@ func resourceClusterCapacityProvidersRead(ctx context.Context, d *schema.Resourc cluster, err := findClusterByNameOrARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Cluster Capacity Providers (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecs/cluster_test.go b/internal/service/ecs/cluster_test.go index d7b0c47d526..3a85ee2c06f 100644 --- a/internal/service/ecs/cluster_test.go +++ b/internal/service/ecs/cluster_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -392,7 +392,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfecs.FindClusterByNameOrARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecs/express_gateway_service.go b/internal/service/ecs/express_gateway_service.go index 524802a15db..6391ba815d5 100644 --- a/internal/service/ecs/express_gateway_service.go +++ b/internal/service/ecs/express_gateway_service.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/smerr" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -295,7 +296,7 @@ func (r *expressGatewayServiceResource) Read(ctx context.Context, req resource.R serviceARN := fwflex.StringValueFromFramework(ctx, state.ServiceARN) out, err := findExpressGatewayServiceByARN(ctx, conn, serviceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -544,7 +545,7 @@ func waitExpressGatewayServiceInactive(ctx context.Context, conn *ecs.Client, id func statusExpressGatewayService(ctx context.Context, conn *ecs.Client, gatewayServiceARN string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := findExpressGatewayServiceNoTagsByARN(ctx, conn, gatewayServiceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -560,7 +561,7 @@ func statusExpressGatewayServiceForDeletion(ctx context.Context, conn *ecs.Clien return func() (any, string, error) { output, err := findExpressGatewayServiceNoTagsByARN(ctx, conn, gatewayServiceARN) if err != nil { - if tfresource.NotFound(err) || errs.IsAErrorMessageContains[*awstypes.InvalidParameterException](err, "Resource not found") || + if retry.NotFound(err) || errs.IsAErrorMessageContains[*awstypes.InvalidParameterException](err, "Resource not found") || errs.IsAErrorMessageContains[*awstypes.ServiceNotActiveException](err, "Cannot perform this operation on a service in INACTIVE status") { mockService := &awstypes.ECSExpressGatewayService{ ServiceArn: aws.String(gatewayServiceARN), @@ -648,7 +649,7 @@ func checkExpressGatewayServiceExists(ctx context.Context, conn *ecs.Client, ser if err == nil { return fmt.Errorf("Express Gateway Service %s already exists in cluster %s", serviceName.ValueString(), clusterName) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return err diff --git a/internal/service/ecs/express_gateway_service_test.go b/internal/service/ecs/express_gateway_service_test.go index a70eb5301ab..1e8295aa418 100644 --- a/internal/service/ecs/express_gateway_service_test.go +++ b/internal/service/ecs/express_gateway_service_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -367,7 +367,7 @@ func testAccCheckExpressGatewayServiceDestroy(ctx context.Context) resource.Test output, err := tfecs.FindExpressGatewayServiceByARN(ctx, conn, rs.Primary.Attributes["service_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/ecs/service.go b/internal/service/ecs/service.go index d2e35449cc1..097dc16944f 100644 --- a/internal/service/ecs/service.go +++ b/internal/service/ecs/service.go @@ -34,6 +34,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" "github.com/hashicorp/terraform-provider-aws/internal/smithy" @@ -1548,7 +1549,7 @@ func resourceServiceRead(ctx context.Context, d *schema.ResourceData, meta any) cluster := d.Get("cluster").(string) service, err := findServiceByTwoPartKeyWaitForActive(ctx, conn, d.Id(), cluster) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Service (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1926,7 +1927,7 @@ func resourceServiceDelete(ctx context.Context, d *schema.ResourceData, meta any cluster := d.Get("cluster").(string) service, err := findServiceNoTagsByTwoPartKey(ctx, conn, d.Id(), cluster) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -2156,7 +2157,7 @@ func findServiceByTwoPartKeyWaitForActive(ctx context.Context, conn *ecs.Client, service, err = findServiceByTwoPartKey(ctx, conn, serviceName, clusterNameOrARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return tfresource.RetryableError(err) } @@ -2201,7 +2202,7 @@ func statusService(ctx context.Context, conn *ecs.Client, serviceName, clusterNa return func() (any, string, error) { output, err := findServiceNoTagsByTwoPartKey(ctx, conn, serviceName, clusterNameOrARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index 3e02b6e41be..1898f308d6d 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -3202,7 +3203,7 @@ func testAccCheckServiceDestroy(ctx context.Context) resource.TestCheckFunc { output, err := tfecs.FindServiceNoTagsByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["cluster"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } @@ -3235,7 +3236,7 @@ func testAccCheckServiceExists(ctx context.Context, name string, service *awstyp var err error output, err = tfecs.FindServiceNoTagsByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["cluster"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return tfresource.RetryableError(err) } diff --git a/internal/service/ecs/tag_gen.go b/internal/service/ecs/tag_gen.go index e082dbbb3a3..c1a588f3e5c 100644 --- a/internal/service/ecs/tag_gen.go +++ b/internal/service/ecs/tag_gen.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -74,7 +74,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, meta any) diag value, err := findTag(ctx, conn, identifier, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] %s resource (%s) tag (%s) not found, removing from state", names.ECS, identifier, key) d.SetId("") return diags diff --git a/internal/service/ecs/tag_gen_test.go b/internal/service/ecs/tag_gen_test.go index 62e2117f124..b626776d62a 100644 --- a/internal/service/ecs/tag_gen_test.go +++ b/internal/service/ecs/tag_gen_test.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -32,7 +32,7 @@ func testAccCheckTagDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfecs.FindTag(ctx, conn, identifier, key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ecs/task_definition.go b/internal/service/ecs/task_definition.go index 48a119b5855..a97bd779539 100644 --- a/internal/service/ecs/task_definition.go +++ b/internal/service/ecs/task_definition.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -652,7 +653,7 @@ func resourceTaskDefinitionRead(ctx context.Context, d *schema.ResourceData, met } taskDefinition, tags, err := findTaskDefinitionByFamilyOrARN(ctx, conn, familyOrARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Task Definition (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ecs/task_definition_test.go b/internal/service/ecs/task_definition_test.go index 9447fee9d31..7c1ef2e3b68 100644 --- a/internal/service/ecs/task_definition_test.go +++ b/internal/service/ecs/task_definition_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1779,7 +1779,7 @@ func testAccCheckTaskDefinitionDestroy(ctx context.Context) resource.TestCheckFu } _, _, err := tfecs.FindTaskDefinitionByFamilyOrARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/ecs/task_set.go b/internal/service/ecs/task_set.go index 4d9e9f9fb8b..dcd4876bb6b 100644 --- a/internal/service/ecs/task_set.go +++ b/internal/service/ecs/task_set.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -369,7 +370,7 @@ func resourceTaskSetRead(ctx context.Context, d *schema.ResourceData, meta any) taskSet, err := findTaskSetByThreePartKey(ctx, conn, taskSetID, service, cluster) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ECS Task Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -589,7 +590,7 @@ func statusTaskSetStability(ctx context.Context, conn *ecs.Client, taskSetID, se return func() (any, string, error) { output, err := findTaskSetNoTagsByThreePartKey(ctx, conn, taskSetID, service, cluster) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -605,7 +606,7 @@ func statusTaskSet(ctx context.Context, conn *ecs.Client, taskSetID, service, cl return func() (any, string, error) { output, err := findTaskSetNoTagsByThreePartKey(ctx, conn, taskSetID, service, cluster) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ecs/task_set_test.go b/internal/service/ecs/task_set_test.go index 8086c9d43d3..e6d7ee9d6ae 100644 --- a/internal/service/ecs/task_set_test.go +++ b/internal/service/ecs/task_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -415,7 +415,7 @@ func testAccCheckTaskSetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfecs.FindTaskSetNoTagsByThreePartKey(ctx, conn, rs.Primary.Attributes["task_set_id"], rs.Primary.Attributes["service"], rs.Primary.Attributes["cluster"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } From f009f1b265749ff8b1f3ac313b22f7df515ce360 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:15 -0800 Subject: [PATCH 081/227] `efs` --- internal/service/efs/access_point.go | 5 +++-- internal/service/efs/access_point_test.go | 4 ++-- internal/service/efs/backup_policy.go | 5 +++-- internal/service/efs/backup_policy_test.go | 4 ++-- internal/service/efs/file_system.go | 5 +++-- internal/service/efs/file_system_policy.go | 3 ++- internal/service/efs/file_system_policy_test.go | 4 ++-- internal/service/efs/file_system_test.go | 4 ++-- internal/service/efs/mount_target.go | 5 +++-- internal/service/efs/mount_target_test.go | 4 ++-- internal/service/efs/replication_configuration.go | 5 +++-- internal/service/efs/replication_configuration_test.go | 4 ++-- 12 files changed, 29 insertions(+), 23 deletions(-) diff --git a/internal/service/efs/access_point.go b/internal/service/efs/access_point.go index e9d1b67be8c..bc10958e5f3 100644 --- a/internal/service/efs/access_point.go +++ b/internal/service/efs/access_point.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -171,7 +172,7 @@ func resourceAccessPointRead(ctx context.Context, d *schema.ResourceData, meta a ap, err := findAccessPointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EFS Access Point (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -300,7 +301,7 @@ func statusAccessPointLifeCycleState(ctx context.Context, conn *efs.Client, id s return func() (any, string, error) { output, err := findAccessPointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/efs/access_point_test.go b/internal/service/efs/access_point_test.go index 4377bc59e91..04e454ee722 100644 --- a/internal/service/efs/access_point_test.go +++ b/internal/service/efs/access_point_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -260,7 +260,7 @@ func testAccCheckAccessPointDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfefs.FindAccessPointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/efs/backup_policy.go b/internal/service/efs/backup_policy.go index 4d9524e50c5..a6ba34bed5e 100644 --- a/internal/service/efs/backup_policy.go +++ b/internal/service/efs/backup_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +85,7 @@ func resourceBackupPolicyRead(ctx context.Context, d *schema.ResourceData, meta output, err := findBackupPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EFS Backup Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -186,7 +187,7 @@ func statusBackupPolicy(ctx context.Context, conn *efs.Client, id string) sdkret return func() (any, string, error) { output, err := findBackupPolicyByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/efs/backup_policy_test.go b/internal/service/efs/backup_policy_test.go index d0a42d5f167..ea93d55e8e3 100644 --- a/internal/service/efs/backup_policy_test.go +++ b/internal/service/efs/backup_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func testAccCheckBackupPolicyDestroy(ctx context.Context) resource.TestCheckFunc output, err := tfefs.FindBackupPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/efs/file_system.go b/internal/service/efs/file_system.go index 2ed0cdaf6ba..d2ff688c9f9 100644 --- a/internal/service/efs/file_system.go +++ b/internal/service/efs/file_system.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -266,7 +267,7 @@ func resourceFileSystemRead(ctx context.Context, d *schema.ResourceData, meta an fs, err := findFileSystemByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EFS File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -461,7 +462,7 @@ func statusFileSystemLifeCycleState(ctx context.Context, conn *efs.Client, id st return func() (any, string, error) { output, err := findFileSystemByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/efs/file_system_policy.go b/internal/service/efs/file_system_policy.go index c5cbd173b6c..0b0f0a3852d 100644 --- a/internal/service/efs/file_system_policy.go +++ b/internal/service/efs/file_system_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -88,7 +89,7 @@ func resourceFileSystemPolicyRead(ctx context.Context, d *schema.ResourceData, m output, err := findFileSystemPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EFS File System Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/efs/file_system_policy_test.go b/internal/service/efs/file_system_policy_test.go index 37f452b8fbb..257a2119927 100644 --- a/internal/service/efs/file_system_policy_test.go +++ b/internal/service/efs/file_system_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func testAccCheckFileSystemPolicyDestroy(ctx context.Context) resource.TestCheck _, err := tfefs.FindFileSystemPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/efs/file_system_test.go b/internal/service/efs/file_system_test.go index 947ab8592ad..369dd002402 100644 --- a/internal/service/efs/file_system_test.go +++ b/internal/service/efs/file_system_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -492,7 +492,7 @@ func testAccCheckFileSystemDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfefs.FindFileSystemByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/efs/mount_target.go b/internal/service/efs/mount_target.go index 45498e65fc5..60978c94b13 100644 --- a/internal/service/efs/mount_target.go +++ b/internal/service/efs/mount_target.go @@ -23,6 +23,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -178,7 +179,7 @@ func resourceMountTargetRead(ctx context.Context, d *schema.ResourceData, meta a mt, err := findMountTargetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EFS Mount Target (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -347,7 +348,7 @@ func statusMountTargetLifeCycleState(ctx context.Context, conn *efs.Client, id s return func() (any, string, error) { output, err := findMountTargetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/efs/mount_target_test.go b/internal/service/efs/mount_target_test.go index 4e2e63adfaf..a0e36e38713 100644 --- a/internal/service/efs/mount_target_test.go +++ b/internal/service/efs/mount_target_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -278,7 +278,7 @@ func testAccCheckMountTargetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfefs.FindMountTargetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/efs/replication_configuration.go b/internal/service/efs/replication_configuration.go index b8da107e35d..81fe48e9c9e 100644 --- a/internal/service/efs/replication_configuration.go +++ b/internal/service/efs/replication_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -140,7 +141,7 @@ func resourceReplicationConfigurationRead(ctx context.Context, d *schema.Resourc replication, err := findReplicationConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EFS Replication Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -277,7 +278,7 @@ func statusReplicationConfiguration(ctx context.Context, conn *efs.Client, id st return func() (any, string, error) { output, err := findReplicationConfigurationByID(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/efs/replication_configuration_test.go b/internal/service/efs/replication_configuration_test.go index fb36b1db673..b7cf8919c77 100644 --- a/internal/service/efs/replication_configuration_test.go +++ b/internal/service/efs/replication_configuration_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -195,7 +195,7 @@ func testAccCheckReplicationConfigurationDestroyWithProvider(ctx context.Context _, err := tfefs.FindReplicationConfigurationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From c4263983d11e2e44260a30178a92655b93e28ede Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:16 -0800 Subject: [PATCH 082/227] `eks` --- internal/service/eks/access_entry.go | 3 ++- internal/service/eks/access_entry_test.go | 4 ++-- internal/service/eks/access_policy_association.go | 3 ++- internal/service/eks/access_policy_association_test.go | 4 ++-- internal/service/eks/addon.go | 7 ++++--- internal/service/eks/addon_test.go | 4 ++-- internal/service/eks/cluster.go | 7 ++++--- internal/service/eks/cluster_test.go | 4 ++-- internal/service/eks/fargate_profile.go | 5 +++-- internal/service/eks/fargate_profile_test.go | 4 ++-- internal/service/eks/identity_provider_config.go | 5 +++-- internal/service/eks/identity_provider_config_test.go | 4 ++-- internal/service/eks/node_group.go | 7 ++++--- internal/service/eks/node_group_test.go | 4 ++-- internal/service/eks/pod_identity_association.go | 3 ++- internal/service/eks/pod_identity_association_test.go | 4 ++-- 16 files changed, 40 insertions(+), 32 deletions(-) diff --git a/internal/service/eks/access_entry.go b/internal/service/eks/access_entry.go index 05c621faddd..3ce76bd70e0 100644 --- a/internal/service/eks/access_entry.go +++ b/internal/service/eks/access_entry.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -142,7 +143,7 @@ func resourceAccessEntryRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findAccessEntryByTwoPartKey(ctx, conn, clusterName, principalARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Access Entry (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/eks/access_entry_test.go b/internal/service/eks/access_entry_test.go index db192c6cb46..7b217162e27 100644 --- a/internal/service/eks/access_entry_test.go +++ b/internal/service/eks/access_entry_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -309,7 +309,7 @@ func testAccCheckAccessEntryDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfeks.FindAccessEntryByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrClusterName], rs.Primary.Attributes["principal_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/access_policy_association.go b/internal/service/eks/access_policy_association.go index fc4dd6a325d..d897450800c 100644 --- a/internal/service/eks/access_policy_association.go +++ b/internal/service/eks/access_policy_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -136,7 +137,7 @@ func resourceAccessPolicyAssociationRead(ctx context.Context, d *schema.Resource output, err := findAccessPolicyAssociationByThreePartKey(ctx, conn, clusterName, principalARN, policyARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Access Policy Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/eks/access_policy_association_test.go b/internal/service/eks/access_policy_association_test.go index 732986a8e26..0fbaf8e508a 100644 --- a/internal/service/eks/access_policy_association_test.go +++ b/internal/service/eks/access_policy_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckAccessPolicyAssociationDestroy(ctx context.Context) resource.Te _, err := tfeks.FindAccessPolicyAssociationByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrClusterName], rs.Primary.Attributes["principal_arn"], rs.Primary.Attributes["policy_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/addon.go b/internal/service/eks/addon.go index 537e1731ba7..c3ac9021fce 100644 --- a/internal/service/eks/addon.go +++ b/internal/service/eks/addon.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -218,7 +219,7 @@ func resourceAddonRead(ctx context.Context, d *schema.ResourceData, meta any) di addon, err := findAddonByTwoPartKey(ctx, conn, clusterName, addonName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Add-On (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -467,7 +468,7 @@ func statusAddon(ctx context.Context, conn *eks.Client, clusterName, addonName s return func() (any, string, error) { output, err := findAddonByTwoPartKey(ctx, conn, clusterName, addonName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -483,7 +484,7 @@ func statusAddonUpdate(ctx context.Context, conn *eks.Client, clusterName, addon return func() (any, string, error) { output, err := findAddonUpdateByThreePartKey(ctx, conn, clusterName, addonName, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index a32f838936b..410b49f3218 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -445,7 +445,7 @@ func testAccCheckAddonDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfeks.FindAddonByTwoPartKey(ctx, conn, clusterName, addonName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/cluster.go b/internal/service/eks/cluster.go index 54843c4d996..8715d740011 100644 --- a/internal/service/eks/cluster.go +++ b/internal/service/eks/cluster.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -606,7 +607,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) cluster, err := findClusterByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1078,7 +1079,7 @@ func statusCluster(ctx context.Context, conn *eks.Client, name string) sdkretry. return func() (any, string, error) { output, err := findClusterByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1094,7 +1095,7 @@ func statusUpdate(ctx context.Context, conn *eks.Client, name, id string) sdkret return func() (any, string, error) { output, err := findUpdateByTwoPartKey(ctx, conn, name, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/eks/cluster_test.go b/internal/service/eks/cluster_test.go index f0c30b91afc..58b81f2516c 100644 --- a/internal/service/eks/cluster_test.go +++ b/internal/service/eks/cluster_test.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1752,7 +1752,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfeks.FindClusterByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/fargate_profile.go b/internal/service/eks/fargate_profile.go index 8502d3b54dd..2895f7ba4c5 100644 --- a/internal/service/eks/fargate_profile.go +++ b/internal/service/eks/fargate_profile.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -159,7 +160,7 @@ func resourceFargateProfileRead(ctx context.Context, d *schema.ResourceData, met fargateProfile, err := findFargateProfileByTwoPartKey(ctx, conn, clusterName, fargateProfileName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Fargate Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -255,7 +256,7 @@ func statusFargateProfile(ctx context.Context, conn *eks.Client, clusterName, fa return func() (any, string, error) { output, err := findFargateProfileByTwoPartKey(ctx, conn, clusterName, fargateProfileName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/eks/fargate_profile_test.go b/internal/service/eks/fargate_profile_test.go index 046b93b1e62..41bb63ab78e 100644 --- a/internal/service/eks/fargate_profile_test.go +++ b/internal/service/eks/fargate_profile_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -245,7 +245,7 @@ func testAccCheckFargateProfileDestroy(ctx context.Context) resource.TestCheckFu _, err = tfeks.FindFargateProfileByTwoPartKey(ctx, conn, clusterName, fargateProfileName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/identity_provider_config.go b/internal/service/eks/identity_provider_config.go index 1559bf287e7..99cc266c489 100644 --- a/internal/service/eks/identity_provider_config.go +++ b/internal/service/eks/identity_provider_config.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -169,7 +170,7 @@ func resourceIdentityProviderConfigRead(ctx context.Context, d *schema.ResourceD oidc, err := findOIDCIdentityProviderConfigByTwoPartKey(ctx, conn, clusterName, configName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Identity Provider Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -267,7 +268,7 @@ func statusOIDCIdentityProviderConfig(ctx context.Context, conn *eks.Client, clu return func() (any, string, error) { output, err := findOIDCIdentityProviderConfigByTwoPartKey(ctx, conn, clusterName, configName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/eks/identity_provider_config_test.go b/internal/service/eks/identity_provider_config_test.go index 58fefa62a91..607cdf5cda3 100644 --- a/internal/service/eks/identity_provider_config_test.go +++ b/internal/service/eks/identity_provider_config_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -214,7 +214,7 @@ func testAccCheckIdentityProviderConfigDestroy(ctx context.Context) resource.Tes _, err = tfeks.FindOIDCIdentityProviderConfigByTwoPartKey(ctx, conn, clusterName, configName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/node_group.go b/internal/service/eks/node_group.go index 344ed0db2d9..a5206654307 100644 --- a/internal/service/eks/node_group.go +++ b/internal/service/eks/node_group.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -467,7 +468,7 @@ func resourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta any nodeGroup, err := findNodegroupByTwoPartKey(ctx, conn, clusterName, nodeGroupName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EKS Node Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -724,7 +725,7 @@ func statusNodegroup(ctx context.Context, conn *eks.Client, clusterName, nodeGro return func() (any, string, error) { output, err := findNodegroupByTwoPartKey(ctx, conn, clusterName, nodeGroupName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -740,7 +741,7 @@ func statusNodegroupUpdate(ctx context.Context, conn *eks.Client, clusterName, n return func() (any, string, error) { output, err := findNodegroupUpdateByThreePartKey(ctx, conn, clusterName, nodeGroupName, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index 6cb7424b931..a4bd229f305 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1153,7 +1153,7 @@ func testAccCheckNodeGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfeks.FindNodegroupByTwoPartKey(ctx, conn, clusterName, nodeGroupName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/eks/pod_identity_association.go b/internal/service/eks/pod_identity_association.go index 845a0630b8b..14fd3d748db 100644 --- a/internal/service/eks/pod_identity_association.go +++ b/internal/service/eks/pod_identity_association.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -164,7 +165,7 @@ func (r *podIdentityAssociationResource) Read(ctx context.Context, request resou association, err := findPodIdentityAssociationByTwoPartKey(ctx, conn, data.AssociationID.ValueString(), data.ClusterName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/eks/pod_identity_association_test.go b/internal/service/eks/pod_identity_association_test.go index 0f4803fb612..b5780b40c0a 100644 --- a/internal/service/eks/pod_identity_association_test.go +++ b/internal/service/eks/pod_identity_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -268,7 +268,7 @@ func testAccCheckPodIdentityAssociationDestroy(ctx context.Context) resource.Tes _, err := tfeks.FindPodIdentityAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAssociationID], rs.Primary.Attributes[names.AttrClusterName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a5020bca2600ae3b1084e06c427a1b2b3adb00d4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:17 -0800 Subject: [PATCH 083/227] `elasticache` --- internal/service/elasticache/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/elasticache/cluster.go b/internal/service/elasticache/cluster.go index dfcc1227337..caf5d8270cf 100644 --- a/internal/service/elasticache/cluster.go +++ b/internal/service/elasticache/cluster.go @@ -504,7 +504,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) c, err := findCacheClusterWithNodeInfoByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ElastiCache Cache Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags From 0c85fd4932f0f60bdc3ab80cf58ac2946391e894 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:18 -0800 Subject: [PATCH 084/227] `elasticbeanstalk` --- internal/service/elasticbeanstalk/application.go | 3 ++- internal/service/elasticbeanstalk/application_test.go | 4 ++-- internal/service/elasticbeanstalk/application_version.go | 3 ++- .../service/elasticbeanstalk/application_version_test.go | 4 ++-- .../service/elasticbeanstalk/configuration_template.go | 3 ++- .../elasticbeanstalk/configuration_template_test.go | 4 ++-- internal/service/elasticbeanstalk/environment.go | 7 ++++--- internal/service/elasticbeanstalk/environment_test.go | 4 ++-- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/internal/service/elasticbeanstalk/application.go b/internal/service/elasticbeanstalk/application.go index 35fac41f3a2..0370e098a11 100644 --- a/internal/service/elasticbeanstalk/application.go +++ b/internal/service/elasticbeanstalk/application.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -134,7 +135,7 @@ func resourceApplicationRead(ctx context.Context, d *schema.ResourceData, meta a app, err := findApplicationByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elastic Beanstalk Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elasticbeanstalk/application_test.go b/internal/service/elasticbeanstalk/application_test.go index 48a929fd6de..46d17a0448c 100644 --- a/internal/service/elasticbeanstalk/application_test.go +++ b/internal/service/elasticbeanstalk/application_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -237,7 +237,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelasticbeanstalk.FindApplicationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elasticbeanstalk/application_version.go b/internal/service/elasticbeanstalk/application_version.go index d25d9a93870..0d8989e3eca 100644 --- a/internal/service/elasticbeanstalk/application_version.go +++ b/internal/service/elasticbeanstalk/application_version.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -110,7 +111,7 @@ func resourceApplicationVersionRead(ctx context.Context, d *schema.ResourceData, applicationVersion, err := findApplicationVersionByTwoPartKey(ctx, conn, d.Get("application").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elastic Beanstalk Application Version (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elasticbeanstalk/application_version_test.go b/internal/service/elasticbeanstalk/application_version_test.go index 1961677a829..26e6fc721f1 100644 --- a/internal/service/elasticbeanstalk/application_version_test.go +++ b/internal/service/elasticbeanstalk/application_version_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -154,7 +154,7 @@ func testAccCheckApplicationVersionDestroy(ctx context.Context) resource.TestChe _, err := tfelasticbeanstalk.FindApplicationVersionByTwoPartKey(ctx, conn, rs.Primary.Attributes["application"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elasticbeanstalk/configuration_template.go b/internal/service/elasticbeanstalk/configuration_template.go index 38d5493d9a8..46f0ce6fb9c 100644 --- a/internal/service/elasticbeanstalk/configuration_template.go +++ b/internal/service/elasticbeanstalk/configuration_template.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +110,7 @@ func resourceConfigurationTemplateRead(ctx context.Context, d *schema.ResourceDa settings, err := findConfigurationSettingsByTwoPartKey(ctx, conn, d.Get("application").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elastic Beanstalk Configuration Template (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elasticbeanstalk/configuration_template_test.go b/internal/service/elasticbeanstalk/configuration_template_test.go index c5147fe795f..67f03ce7dba 100644 --- a/internal/service/elasticbeanstalk/configuration_template_test.go +++ b/internal/service/elasticbeanstalk/configuration_template_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func testAccCheckConfigurationTemplateDestroy(ctx context.Context) resource.Test _, err := tfelasticbeanstalk.FindConfigurationSettingsByTwoPartKey(ctx, conn, rs.Primary.Attributes["application"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elasticbeanstalk/environment.go b/internal/service/elasticbeanstalk/environment.go index 797296c2ee7..3adafda9548 100644 --- a/internal/service/elasticbeanstalk/environment.go +++ b/internal/service/elasticbeanstalk/environment.go @@ -28,6 +28,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" sdktypes "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" @@ -317,7 +318,7 @@ func resourceEnvironmentRead(ctx context.Context, d *schema.ResourceData, meta a env, err := findEnvironmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elastic Beanstalk Environment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -564,7 +565,7 @@ func resourceEnvironmentDelete(ctx context.Context, d *schema.ResourceData, meta // Environment must be Ready before it can be deleted. if _, err := waitEnvironmentReady(ctx, conn, d.Id(), pollInterval, waitForReadyTimeOut); err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -701,7 +702,7 @@ func statusEnvironment(ctx context.Context, conn *elasticbeanstalk.Client, id st return func() (any, string, error) { output, err := findEnvironmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/elasticbeanstalk/environment_test.go b/internal/service/elasticbeanstalk/environment_test.go index 200a3cce8a9..d7a73e30a91 100644 --- a/internal/service/elasticbeanstalk/environment_test.go +++ b/internal/service/elasticbeanstalk/environment_test.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -795,7 +795,7 @@ func testAccCheckEnvironmentDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelasticbeanstalk.FindEnvironmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 0da62c840d257663daadc0775be873e5698d28ee Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:18 -0800 Subject: [PATCH 085/227] `elasticsearch` --- internal/service/elasticsearch/domain.go | 7 ++++--- internal/service/elasticsearch/domain_policy.go | 3 ++- internal/service/elasticsearch/domain_saml_options.go | 3 ++- internal/service/elasticsearch/domain_saml_options_test.go | 4 ++-- internal/service/elasticsearch/domain_test.go | 4 ++-- internal/service/elasticsearch/vpc_endpoint.go | 5 +++-- internal/service/elasticsearch/vpc_endpoint_test.go | 6 +++--- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/internal/service/elasticsearch/domain.go b/internal/service/elasticsearch/domain.go index 1737c6f335f..e5cba666e81 100644 --- a/internal/service/elasticsearch/domain.go +++ b/internal/service/elasticsearch/domain.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/semver" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" @@ -710,7 +711,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta any) d name := d.Get(names.AttrDomainName).(string) ds, err := findDomainByName(ctx, conn, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elasticsearch Domain (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1107,7 +1108,7 @@ func statusDomainProcessing(ctx context.Context, conn *elasticsearch.Client, nam } output, err := findDomain(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1123,7 +1124,7 @@ func statusDomainUpgrade(ctx context.Context, conn *elasticsearch.Client, name s return func() (any, string, error) { output, err := findDomainUpgradeStatusByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/elasticsearch/domain_policy.go b/internal/service/elasticsearch/domain_policy.go index 2081c0cfb7c..85dc67081b4 100644 --- a/internal/service/elasticsearch/domain_policy.go +++ b/internal/service/elasticsearch/domain_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -97,7 +98,7 @@ func resourceDomainPolicyRead(ctx context.Context, d *schema.ResourceData, meta ds, err := findDomainByName(ctx, conn, d.Get(names.AttrDomainName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elasticsearch Domain Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elasticsearch/domain_saml_options.go b/internal/service/elasticsearch/domain_saml_options.go index f81c07666e6..07c42a67e3e 100644 --- a/internal/service/elasticsearch/domain_saml_options.go +++ b/internal/service/elasticsearch/domain_saml_options.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +147,7 @@ func resourceDomainSAMLOptionsRead(ctx context.Context, d *schema.ResourceData, output, err := findDomainSAMLOptionByDomainName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elasticsearch Domain SAML Options (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elasticsearch/domain_saml_options_test.go b/internal/service/elasticsearch/domain_saml_options_test.go index 947744cab40..4eab4081285 100644 --- a/internal/service/elasticsearch/domain_saml_options_test.go +++ b/internal/service/elasticsearch/domain_saml_options_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticsearch "github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func testAccCheckDomainSAMLOptionsDestroy(ctx context.Context) resource.TestChec _, err := tfelasticsearch.FindDomainSAMLOptionByDomainName(ctx, conn, rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elasticsearch/domain_test.go b/internal/service/elasticsearch/domain_test.go index 0a6575faffb..6b70f6e58a4 100644 --- a/internal/service/elasticsearch/domain_test.go +++ b/internal/service/elasticsearch/domain_test.go @@ -25,8 +25,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticsearch "github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2117,7 +2117,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfelasticsearch.FindDomainByName(ctx, conn, rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elasticsearch/vpc_endpoint.go b/internal/service/elasticsearch/vpc_endpoint.go index 5eca0955b15..2b8cff8ecc7 100644 --- a/internal/service/elasticsearch/vpc_endpoint.go +++ b/internal/service/elasticsearch/vpc_endpoint.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -117,7 +118,7 @@ func resourceVPCEndpointRead(ctx context.Context, d *schema.ResourceData, meta a endpoint, err := findVPCEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Elasticsearch VPC Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -278,7 +279,7 @@ func statusVPCEndpoint(ctx context.Context, conn *elasticsearchservice.Client, i return func() (any, string, error) { output, err := findVPCEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/elasticsearch/vpc_endpoint_test.go b/internal/service/elasticsearch/vpc_endpoint_test.go index 19b7ce4dcae..9fc573909e2 100644 --- a/internal/service/elasticsearch/vpc_endpoint_test.go +++ b/internal/service/elasticsearch/vpc_endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelasticsearch "github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +85,7 @@ func TestVPCEndpointErrorsNotFound(t *testing.T) { t.Run(testCase.name, func(t *testing.T) { t.Parallel() - if got, want := tfresource.NotFound(tfelasticsearch.VPCEndpointsError(testCase.apiObjects)), testCase.notFound; got != want { + if got, want := retry.NotFound(tfelasticsearch.VPCEndpointsError(testCase.apiObjects)), testCase.notFound; got != want { t.Errorf("NotFound = %v, want %v", got, want) } }) @@ -236,7 +236,7 @@ func testAccCheckVPCEndpointDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelasticsearch.FindVPCEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 71d20fdb798b54eef2aa4c5023db0ccb59ce7e83 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:19 -0800 Subject: [PATCH 086/227] `elb` --- internal/service/elb/app_cookie_stickiness_policy.go | 3 ++- .../service/elb/app_cookie_stickiness_policy_test.go | 4 ++-- internal/service/elb/attachment.go | 3 ++- internal/service/elb/attachment_test.go | 4 ++-- internal/service/elb/backend_server_policy.go | 4 ++-- internal/service/elb/backend_server_policy_test.go | 4 ++-- internal/service/elb/lb_cookie_stickiness_policy.go | 4 ++-- .../service/elb/lb_cookie_stickiness_policy_test.go | 4 ++-- internal/service/elb/lb_ssl_negotiation_policy.go | 4 ++-- internal/service/elb/lb_ssl_negotiation_policy_test.go | 4 ++-- internal/service/elb/listener_policy.go | 4 ++-- internal/service/elb/listener_policy_test.go | 4 ++-- internal/service/elb/load_balancer.go | 3 ++- internal/service/elb/load_balancer_test.go | 4 ++-- internal/service/elb/policy.go | 10 +++++----- internal/service/elb/policy_test.go | 4 ++-- internal/service/elb/proxy_protocol_policy.go | 6 +++--- 17 files changed, 38 insertions(+), 35 deletions(-) diff --git a/internal/service/elb/app_cookie_stickiness_policy.go b/internal/service/elb/app_cookie_stickiness_policy.go index 3d3c00ab433..a178f2d0ecc 100644 --- a/internal/service/elb/app_cookie_stickiness_policy.go +++ b/internal/service/elb/app_cookie_stickiness_policy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +123,7 @@ func resourceAppCookieStickinessPolicyRead(ctx context.Context, d *schema.Resour policy, err := findLoadBalancerListenerPolicyByThreePartKey(ctx, conn, lbName, lbPort, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic App Cookie Stickiness Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elb/app_cookie_stickiness_policy_test.go b/internal/service/elb/app_cookie_stickiness_policy_test.go index 75fc6ad82d3..64ecd6031ca 100644 --- a/internal/service/elb/app_cookie_stickiness_policy_test.go +++ b/internal/service/elb/app_cookie_stickiness_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckAppCookieStickinessPolicyDestroy(ctx context.Context) resource. _, err = tfelb.FindLoadBalancerListenerPolicyByThreePartKey(ctx, conn, lbName, lbPort, policyName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/attachment.go b/internal/service/elb/attachment.go index 635ef579270..16fcbdcffbe 100644 --- a/internal/service/elb/attachment.go +++ b/internal/service/elb/attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -80,7 +81,7 @@ func resourceAttachmentRead(ctx context.Context, d *schema.ResourceData, meta an instance := d.Get("instance").(string) err := findLoadBalancerAttachmentByTwoPartKey(ctx, conn, lbName, instance) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic Attachment (%s/%s) not found, removing from state", lbName, instance) d.SetId("") return diags diff --git a/internal/service/elb/attachment_test.go b/internal/service/elb/attachment_test.go index a547293c962..dbb0c4bfacf 100644 --- a/internal/service/elb/attachment_test.go +++ b/internal/service/elb/attachment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func testAccCheckAttachmentDestroy(ctx context.Context) resource.TestCheckFunc { err := tfelb.FindLoadBalancerAttachmentByTwoPartKey(ctx, conn, rs.Primary.Attributes["elb"], rs.Primary.Attributes["instance"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/backend_server_policy.go b/internal/service/elb/backend_server_policy.go index 4fbedf5aafa..570911c6baa 100644 --- a/internal/service/elb/backend_server_policy.go +++ b/internal/service/elb/backend_server_policy.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_load_balancer_backend_server_policy", name="Backend Server Policy") @@ -86,7 +86,7 @@ func resourceBackendServerPolicyRead(ctx context.Context, d *schema.ResourceData policyNames, err := findLoadBalancerBackendServerPolicyByTwoPartKey(ctx, conn, lbName, instancePort) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic Backend Server Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elb/backend_server_policy_test.go b/internal/service/elb/backend_server_policy_test.go index 1540eb4795a..5b17e4bae3b 100644 --- a/internal/service/elb/backend_server_policy_test.go +++ b/internal/service/elb/backend_server_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -129,7 +129,7 @@ func testAccCheckBackendServerPolicyDestroy(ctx context.Context) resource.TestCh _, err = tfelb.FindLoadBalancerBackendServerPolicyByTwoPartKey(ctx, conn, lbName, instancePort) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/lb_cookie_stickiness_policy.go b/internal/service/elb/lb_cookie_stickiness_policy.go index 4221f4b0104..f724c467333 100644 --- a/internal/service/elb/lb_cookie_stickiness_policy.go +++ b/internal/service/elb/lb_cookie_stickiness_policy.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func resourceCookieStickinessPolicyRead(ctx context.Context, d *schema.ResourceD policy, err := findLoadBalancerListenerPolicyByThreePartKey(ctx, conn, lbName, lbPort, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic LB Cookie Stickiness Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elb/lb_cookie_stickiness_policy_test.go b/internal/service/elb/lb_cookie_stickiness_policy_test.go index c334b1a6010..866ee5c68ff 100644 --- a/internal/service/elb/lb_cookie_stickiness_policy_test.go +++ b/internal/service/elb/lb_cookie_stickiness_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func testAccCheckLBCookieStickinessPolicyDestroy(ctx context.Context) resource.T _, err = tfelb.FindLoadBalancerListenerPolicyByThreePartKey(ctx, conn, lbName, lbPort, policyName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/lb_ssl_negotiation_policy.go b/internal/service/elb/lb_ssl_negotiation_policy.go index 75031c647dc..35c034403fa 100644 --- a/internal/service/elb/lb_ssl_negotiation_policy.go +++ b/internal/service/elb/lb_ssl_negotiation_policy.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func resourceSSLNegotiationPolicyRead(ctx context.Context, d *schema.ResourceDat _, err = findLoadBalancerListenerPolicyByThreePartKey(ctx, conn, lbName, lbPort, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic SSL Negotiation Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elb/lb_ssl_negotiation_policy_test.go b/internal/service/elb/lb_ssl_negotiation_policy_test.go index 6c493e78f68..fb9d2295533 100644 --- a/internal/service/elb/lb_ssl_negotiation_policy_test.go +++ b/internal/service/elb/lb_ssl_negotiation_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -136,7 +136,7 @@ func testAccCheckLBSSLNegotiationPolicyDestroy(ctx context.Context) resource.Tes _, err = tfelb.FindLoadBalancerListenerPolicyByThreePartKey(ctx, conn, lbName, lbPort, policyName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/listener_policy.go b/internal/service/elb/listener_policy.go index c5bbe1c977c..e605017c331 100644 --- a/internal/service/elb/listener_policy.go +++ b/internal/service/elb/listener_policy.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func resourceListenerPolicyRead(ctx context.Context, d *schema.ResourceData, met policyNames, err := findLoadBalancerListenerPolicyByTwoPartKey(ctx, conn, lbName, lbPort) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic Listener Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elb/listener_policy_test.go b/internal/service/elb/listener_policy_test.go index 47fce72b305..a381a26c4ae 100644 --- a/internal/service/elb/listener_policy_test.go +++ b/internal/service/elb/listener_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -139,7 +139,7 @@ func testAccCheckListenerPolicyDestroy(ctx context.Context) resource.TestCheckFu _, err = tfelb.FindLoadBalancerListenerPolicyByTwoPartKey(ctx, conn, lbName, lbPort) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/load_balancer.go b/internal/service/elb/load_balancer.go index eb978b43f3d..a99d3d8e897 100644 --- a/internal/service/elb/load_balancer.go +++ b/internal/service/elb/load_balancer.go @@ -29,6 +29,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -323,7 +324,7 @@ func resourceLoadBalancerRead(ctx context.Context, d *schema.ResourceData, meta lb, err := findLoadBalancerByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic Load Balancer (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elb/load_balancer_test.go b/internal/service/elb/load_balancer_test.go index 15ef0b159b7..d8d5d4b6277 100644 --- a/internal/service/elb/load_balancer_test.go +++ b/internal/service/elb/load_balancer_test.go @@ -18,8 +18,8 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -847,7 +847,7 @@ func testAccCheckLoadBalancerDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelb.FindLoadBalancerByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/policy.go b/internal/service/elb/policy.go index 88af969121a..107265bd7aa 100644 --- a/internal/service/elb/policy.go +++ b/internal/service/elb/policy.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +115,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d policy, err := findLoadBalancerPolicyByTwoPartKey(ctx, conn, lbName, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic Load Balancer Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -148,7 +148,7 @@ func resourcePolicyUpdate(ctx context.Context, d *schema.ResourceData, meta any) err = findPolicyAttachmentByTwoPartKey(ctx, conn, lbName, policyName) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): // Policy not attached. case err != nil: return sdkdiag.AppendErrorf(diags, "reading ELB Classic Load Balancer Policy Attachment (%s/%s): %s", lbName, policyName, err) @@ -207,7 +207,7 @@ func resourcePolicyDelete(ctx context.Context, d *schema.ResourceData, meta any) err = findPolicyAttachmentByTwoPartKey(ctx, conn, lbName, policyName) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): // Policy not attached. case err != nil: return sdkdiag.AppendErrorf(diags, "reading ELB Classic Load Balancer Policy Attachment (%s/%s): %s", lbName, policyName, err) @@ -270,7 +270,7 @@ func unassignPolicy(ctx context.Context, conn *elasticloadbalancing.Client, lbNa lb, err := findLoadBalancerByName(ctx, conn, lbName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return reassignments, nil } diff --git a/internal/service/elb/policy_test.go b/internal/service/elb/policy_test.go index 7fb3d63c612..f355bced97b 100644 --- a/internal/service/elb/policy_test.go +++ b/internal/service/elb/policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -277,7 +277,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfelb.FindLoadBalancerPolicyByTwoPartKey(ctx, conn, lbName, policyName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elb/proxy_protocol_policy.go b/internal/service/elb/proxy_protocol_policy.go index 31c1759d338..8afb60b6cf0 100644 --- a/internal/service/elb/proxy_protocol_policy.go +++ b/internal/service/elb/proxy_protocol_policy.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -87,7 +87,7 @@ func resourceProxyProtocolPolicyRead(ctx context.Context, d *schema.ResourceData lb, err := findLoadBalancerByName(ctx, conn, lbName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELB Classic Proxy Protocol Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -155,7 +155,7 @@ func resourceProxyProtocolPolicyDelete(ctx context.Context, d *schema.ResourceDa lb, err := findLoadBalancerByName(ctx, conn, lbName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } From 97dcf5d139a11ce53b042423d1164086698a43a7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:20 -0800 Subject: [PATCH 087/227] `elbv2` --- internal/service/elbv2/listener.go | 3 ++- internal/service/elbv2/listener_certificate.go | 3 ++- internal/service/elbv2/listener_certificate_test.go | 4 ++-- internal/service/elbv2/listener_rule.go | 3 ++- internal/service/elbv2/listener_rule_test.go | 4 ++-- internal/service/elbv2/listener_test.go | 4 ++-- internal/service/elbv2/load_balancer.go | 9 +++++---- internal/service/elbv2/load_balancer_test.go | 4 ++-- internal/service/elbv2/target_group.go | 5 +++-- internal/service/elbv2/target_group_attachment.go | 3 ++- internal/service/elbv2/target_group_attachment_test.go | 4 ++-- internal/service/elbv2/target_group_test.go | 4 ++-- internal/service/elbv2/trust_store.go | 7 ++++--- internal/service/elbv2/trust_store_revocation.go | 3 ++- internal/service/elbv2/trust_store_revocation_test.go | 4 ++-- internal/service/elbv2/trust_store_test.go | 4 ++-- 16 files changed, 38 insertions(+), 30 deletions(-) diff --git a/internal/service/elbv2/listener.go b/internal/service/elbv2/listener.go index 14dec4d4eb4..d269d512d3f 100644 --- a/internal/service/elbv2/listener.go +++ b/internal/service/elbv2/listener.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -724,7 +725,7 @@ func resourceListenerRead(ctx context.Context, d *schema.ResourceData, meta any) listener, err := findListenerByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Listener (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elbv2/listener_certificate.go b/internal/service/elbv2/listener_certificate.go index afbe96ab2cf..6560ee7bfcd 100644 --- a/internal/service/elbv2/listener_certificate.go +++ b/internal/service/elbv2/listener_certificate.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -93,7 +94,7 @@ func resourceListenerCertificateRead(ctx context.Context, d *schema.ResourceData return findListenerCertificateByTwoPartKey(ctx, conn, listenerARN, certificateARN) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Listener Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elbv2/listener_certificate_test.go b/internal/service/elbv2/listener_certificate_test.go index 398726ca503..870f22cf403 100644 --- a/internal/service/elbv2/listener_certificate_test.go +++ b/internal/service/elbv2/listener_certificate_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -218,7 +218,7 @@ func testAccCheckListenerCertificateDestroy(ctx context.Context) resource.TestCh _, err := tfelbv2.FindListenerCertificateByTwoPartKey(ctx, conn, rs.Primary.Attributes["listener_arn"], rs.Primary.Attributes[names.AttrCertificateARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/listener_rule.go b/internal/service/elbv2/listener_rule.go index 85884a981eb..4a12a645b3f 100644 --- a/internal/service/elbv2/listener_rule.go +++ b/internal/service/elbv2/listener_rule.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -678,7 +679,7 @@ func resourceListenerRuleRead(ctx context.Context, d *schema.ResourceData, meta return findListenerRuleByARN(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Listener Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elbv2/listener_rule_test.go b/internal/service/elbv2/listener_rule_test.go index cf5e3b966a7..37c3c2f97ab 100644 --- a/internal/service/elbv2/listener_rule_test.go +++ b/internal/service/elbv2/listener_rule_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2438,7 +2438,7 @@ func testAccCheckListenerRuleDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelbv2.FindListenerRuleByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/listener_test.go b/internal/service/elbv2/listener_test.go index 0620b2f9dc3..cde9469313e 100644 --- a/internal/service/elbv2/listener_test.go +++ b/internal/service/elbv2/listener_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2330,7 +2330,7 @@ func testAccCheckListenerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfelbv2.FindListenerByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/load_balancer.go b/internal/service/elbv2/load_balancer.go index 47586109ffe..412009b5aed 100644 --- a/internal/service/elbv2/load_balancer.go +++ b/internal/service/elbv2/load_balancer.go @@ -29,6 +29,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -386,7 +387,7 @@ func resourceLoadBalancerCreate(ctx context.Context, d *schema.ResourceData, met Names: []string{name}, }) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "reading ELBv2 Load Balancer (%s): %s", name, err) } @@ -547,7 +548,7 @@ func resourceLoadBalancerRead(ctx context.Context, d *schema.ResourceData, meta lb, err := findLoadBalancerByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Load Balancer %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -1089,7 +1090,7 @@ func statusLoadBalancer(ctx context.Context, conn *elasticloadbalancingv2.Client return func() (any, string, error) { output, err := findLoadBalancerByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1105,7 +1106,7 @@ func statusCapacityReservation(ctx context.Context, conn *elasticloadbalancingv2 return func() (any, string, error) { output, err := findCapacityReservationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/elbv2/load_balancer_test.go b/internal/service/elbv2/load_balancer_test.go index 87fffa46238..fbfa81e53af 100644 --- a/internal/service/elbv2/load_balancer_test.go +++ b/internal/service/elbv2/load_balancer_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2408,7 +2408,7 @@ func testAccCheckLoadBalancerDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelbv2.FindLoadBalancerByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/target_group.go b/internal/service/elbv2/target_group.go index a56b49fb890..ddab070c6a2 100644 --- a/internal/service/elbv2/target_group.go +++ b/internal/service/elbv2/target_group.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -423,7 +424,7 @@ func resourceTargetGroupCreate(ctx context.Context, d *schema.ResourceData, meta ).Generate() exist, err := findTargetGroupByName(ctx, conn, name) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "reading ELBv2 Target Group (%s): %s", name, err) } @@ -586,7 +587,7 @@ func resourceTargetGroupRead(ctx context.Context, d *schema.ResourceData, meta a targetGroup, err := findTargetGroupByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Target Group %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elbv2/target_group_attachment.go b/internal/service/elbv2/target_group_attachment.go index 799e22fed67..882eb6bccbe 100644 --- a/internal/service/elbv2/target_group_attachment.go +++ b/internal/service/elbv2/target_group_attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -117,7 +118,7 @@ func resourceAttachmentRead(ctx context.Context, d *schema.ResourceData, meta an _, err := findTargetHealthDescription(ctx, conn, input) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Target Group Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elbv2/target_group_attachment_test.go b/internal/service/elbv2/target_group_attachment_test.go index 1251d5f9987..22aa75395b6 100644 --- a/internal/service/elbv2/target_group_attachment_test.go +++ b/internal/service/elbv2/target_group_attachment_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -206,7 +206,7 @@ func testAccCheckTargetGroupAttachmentDestroy(ctx context.Context) resource.Test _, err := tfelbv2.FindTargetHealthDescription(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/target_group_test.go b/internal/service/elbv2/target_group_test.go index 893a5baec2d..d305fb73d98 100644 --- a/internal/service/elbv2/target_group_test.go +++ b/internal/service/elbv2/target_group_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -4394,7 +4394,7 @@ func testAccCheckTargetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfelbv2.FindTargetGroupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/trust_store.go b/internal/service/elbv2/trust_store.go index 5696341ca91..78552b3d68b 100644 --- a/internal/service/elbv2/trust_store.go +++ b/internal/service/elbv2/trust_store.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -169,7 +170,7 @@ func resourceTrustStoreRead(ctx context.Context, d *schema.ResourceData, meta an trustStore, err := findTrustStoreByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Trust Store %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -295,7 +296,7 @@ func statusTrustStore(ctx context.Context, conn *elasticloadbalancingv2.Client, return func() (any, string, error) { output, err := findTrustStoreByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -358,7 +359,7 @@ func waitForNoTrustStoreAssociations(ctx context.Context, conn *elasticloadbalan _, err := tfresource.RetryUntilEqual(ctx, timeout, 0, func(ctx context.Context) (int, error) { associations, err := findTrustStoreAssociations(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return 0, nil } diff --git a/internal/service/elbv2/trust_store_revocation.go b/internal/service/elbv2/trust_store_revocation.go index d3bc6e03319..14830fb20d4 100644 --- a/internal/service/elbv2/trust_store_revocation.go +++ b/internal/service/elbv2/trust_store_revocation.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -137,7 +138,7 @@ func resourceTrustStoreRevocationRead(ctx context.Context, d *schema.ResourceDat revocation, err := findTrustStoreRevocationByTwoPartKey(ctx, conn, trustStoreARN, revocationID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ELBv2 Trust Store Revocation %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/elbv2/trust_store_revocation_test.go b/internal/service/elbv2/trust_store_revocation_test.go index ef83b712297..175f98b5829 100644 --- a/internal/service/elbv2/trust_store_revocation_test.go +++ b/internal/service/elbv2/trust_store_revocation_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func testAccCheckTrustStoreRevocationDestroy(ctx context.Context) resource.TestC _, err = tfelbv2.FindTrustStoreRevocationByTwoPartKey(ctx, conn, trustStoreARN, revocationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/elbv2/trust_store_test.go b/internal/service/elbv2/trust_store_test.go index 634304f7b6b..06afb976be9 100644 --- a/internal/service/elbv2/trust_store_test.go +++ b/internal/service/elbv2/trust_store_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -165,7 +165,7 @@ func testAccCheckTrustStoreDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfelbv2.FindTrustStoreByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From fed6b5e58480e6502c0cb08524d9fa5a1d1e6047 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:21 -0800 Subject: [PATCH 088/227] `emr` --- internal/service/emr/block_public_access_configuration.go | 3 ++- .../service/emr/block_public_access_configuration_test.go | 4 ++-- internal/service/emr/cluster.go | 7 ++++--- internal/service/emr/cluster_test.go | 4 ++-- internal/service/emr/instance_fleet.go | 5 +++-- internal/service/emr/instance_group.go | 5 +++-- internal/service/emr/managed_scaling_policy.go | 3 ++- internal/service/emr/managed_scaling_policy_test.go | 4 ++-- internal/service/emr/security_configuration.go | 3 ++- internal/service/emr/security_configuration_test.go | 4 ++-- internal/service/emr/studio.go | 3 ++- internal/service/emr/studio_session_mapping.go | 3 ++- internal/service/emr/studio_session_mapping_test.go | 4 ++-- internal/service/emr/studio_test.go | 4 ++-- 14 files changed, 32 insertions(+), 24 deletions(-) diff --git a/internal/service/emr/block_public_access_configuration.go b/internal/service/emr/block_public_access_configuration.go index c46af637ceb..9dc571738c7 100644 --- a/internal/service/emr/block_public_access_configuration.go +++ b/internal/service/emr/block_public_access_configuration.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -91,7 +92,7 @@ func resourceBlockPublicAccessConfigurationRead(ctx context.Context, d *schema.R bpa, err := findBlockPublicAccessConfiguration(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Block Public Access Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/emr/block_public_access_configuration_test.go b/internal/service/emr/block_public_access_configuration_test.go index 54c5741a593..64813e6fe95 100644 --- a/internal/service/emr/block_public_access_configuration_test.go +++ b/internal/service/emr/block_public_access_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -181,7 +181,7 @@ func testAccCheckBlockPublicAccessConfigurationDestroy(ctx context.Context) reso output, err := tfemr.FindBlockPublicAccessConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/emr/cluster.go b/internal/service/emr/cluster.go index d3c37c87915..e4248226a5e 100644 --- a/internal/service/emr/cluster.go +++ b/internal/service/emr/cluster.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfjson "github.com/hashicorp/terraform-provider-aws/internal/json" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -1072,7 +1073,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) cluster, err := findClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1203,7 +1204,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) autoTerminationPolicy, err := findAutoTerminationPolicyByClusterID(ctx, conn, d.Id()) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("auto_termination_policy", nil) case err != nil: return sdkdiag.AppendErrorf(diags, "reading EMR Cluster (%s) auto-termination policy: %s", d.Id(), err) @@ -1499,7 +1500,7 @@ func statusCluster(ctx context.Context, conn *emr.Client, id string) sdkretry.St } output, err := findCluster(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/emr/cluster_test.go b/internal/service/emr/cluster_test.go index 7644176ac07..e90ae021d6c 100644 --- a/internal/service/emr/cluster_test.go +++ b/internal/service/emr/cluster_test.go @@ -24,9 +24,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1826,7 +1826,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfemr.FindClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/emr/instance_fleet.go b/internal/service/emr/instance_fleet.go index 8adc52530f7..3139a18294d 100644 --- a/internal/service/emr/instance_fleet.go +++ b/internal/service/emr/instance_fleet.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -257,7 +258,7 @@ func resourceInstanceFleetRead(ctx context.Context, d *schema.ResourceData, meta fleet, err := findInstanceFleetByTwoPartKey(ctx, conn, d.Get("cluster_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Instance Fleet (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -394,7 +395,7 @@ func statusInstanceFleet(ctx context.Context, conn *emr.Client, clusterID, fleet return func() (any, string, error) { output, err := findInstanceFleetByTwoPartKey(ctx, conn, clusterID, fleetID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/emr/instance_group.go b/internal/service/emr/instance_group.go index e3cc074567a..b1e9e370d9b 100644 --- a/internal/service/emr/instance_group.go +++ b/internal/service/emr/instance_group.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfjson "github.com/hashicorp/terraform-provider-aws/internal/json" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -221,7 +222,7 @@ func resourceInstanceGroupRead(ctx context.Context, d *schema.ResourceData, meta ig, err := findInstanceGroupByTwoPartKey(ctx, conn, d.Get("cluster_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Instance Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -419,7 +420,7 @@ func statusInstanceGroup(ctx context.Context, conn *emr.Client, clusterID, group return func() (any, string, error) { output, err := findInstanceGroupByTwoPartKey(ctx, conn, clusterID, groupID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/emr/managed_scaling_policy.go b/internal/service/emr/managed_scaling_policy.go index 4c41024fa86..8092156350d 100644 --- a/internal/service/emr/managed_scaling_policy.go +++ b/internal/service/emr/managed_scaling_policy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -143,7 +144,7 @@ func resourceManagedScalingPolicyRead(ctx context.Context, d *schema.ResourceDat managedScalingPolicy, err := findManagedScalingPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Managed Scaling Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/emr/managed_scaling_policy_test.go b/internal/service/emr/managed_scaling_policy_test.go index 40a746bce52..8d5012fae97 100644 --- a/internal/service/emr/managed_scaling_policy_test.go +++ b/internal/service/emr/managed_scaling_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -233,7 +233,7 @@ func testAccCheckManagedScalingPolicyDestroy(ctx context.Context) resource.TestC _, err := tfemr.FindManagedScalingPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/emr/security_configuration.go b/internal/service/emr/security_configuration.go index e327fcf59b0..4e0796d9065 100644 --- a/internal/service/emr/security_configuration.go +++ b/internal/service/emr/security_configuration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +98,7 @@ func resourceSecurityConfigurationRead(ctx context.Context, d *schema.ResourceDa output, err := findSecurityConfigurationByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Security Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/emr/security_configuration_test.go b/internal/service/emr/security_configuration_test.go index d1b154c43df..614ab07ab7e 100644 --- a/internal/service/emr/security_configuration_test.go +++ b/internal/service/emr/security_configuration_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -136,7 +136,7 @@ func testAccCheckSecurityConfigurationDestroy(ctx context.Context) resource.Test _, err := tfemr.FindSecurityConfigurationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/emr/studio.go b/internal/service/emr/studio.go index 661eea2b6cc..954c4650172 100644 --- a/internal/service/emr/studio.go +++ b/internal/service/emr/studio.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -189,7 +190,7 @@ func resourceStudioRead(ctx context.Context, d *schema.ResourceData, meta any) d studio, err := findStudioByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Studio (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/emr/studio_session_mapping.go b/internal/service/emr/studio_session_mapping.go index 4612fdb9cb9..0caf333e99d 100644 --- a/internal/service/emr/studio_session_mapping.go +++ b/internal/service/emr/studio_session_mapping.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -111,7 +112,7 @@ func resourceStudioSessionMappingRead(ctx context.Context, d *schema.ResourceDat mapping, err := findStudioSessionMappingByIDOrName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Studio Session Mapping (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/emr/studio_session_mapping_test.go b/internal/service/emr/studio_session_mapping_test.go index 9a9ddaa9b50..7514af82a5d 100644 --- a/internal/service/emr/studio_session_mapping_test.go +++ b/internal/service/emr/studio_session_mapping_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckStudioSessionMappingDestroy(ctx context.Context) resource.TestC _, err := tfemr.FindStudioSessionMappingByIDOrName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/emr/studio_test.go b/internal/service/emr/studio_test.go index d269979cf1e..241f1c5ba3f 100644 --- a/internal/service/emr/studio_test.go +++ b/internal/service/emr/studio_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -255,7 +255,7 @@ func testAccCheckStudioDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfemr.FindStudioByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 820544e04634003df467fa9a084727f93bdde918 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:22 -0800 Subject: [PATCH 089/227] `emrcontainers` --- internal/service/emrcontainers/job_template.go | 3 ++- internal/service/emrcontainers/job_template_test.go | 4 ++-- internal/service/emrcontainers/virtual_cluster.go | 5 +++-- internal/service/emrcontainers/virtual_cluster_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/emrcontainers/job_template.go b/internal/service/emrcontainers/job_template.go index cbae35ee68c..136db13c2c9 100644 --- a/internal/service/emrcontainers/job_template.go +++ b/internal/service/emrcontainers/job_template.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -294,7 +295,7 @@ func resourceJobTemplateRead(ctx context.Context, d *schema.ResourceData, meta a vc, err := findJobTemplateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Containers Job Template %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/emrcontainers/job_template_test.go b/internal/service/emrcontainers/job_template_test.go index 14f46393aea..6cd63313f68 100644 --- a/internal/service/emrcontainers/job_template_test.go +++ b/internal/service/emrcontainers/job_template_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemrcontainers "github.com/hashicorp/terraform-provider-aws/internal/service/emrcontainers" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckJobTemplateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfemrcontainers.FindJobTemplateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/emrcontainers/virtual_cluster.go b/internal/service/emrcontainers/virtual_cluster.go index 9a2138eff27..9986179eb56 100644 --- a/internal/service/emrcontainers/virtual_cluster.go +++ b/internal/service/emrcontainers/virtual_cluster.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -141,7 +142,7 @@ func resourceVirtualClusterRead(ctx context.Context, d *schema.ResourceData, met vc, err := findVirtualClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EMR Containers Virtual Cluster %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -251,7 +252,7 @@ func statusVirtualCluster(ctx context.Context, conn *emrcontainers.Client, id st return func() (any, string, error) { output, err := findVirtualClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/emrcontainers/virtual_cluster_test.go b/internal/service/emrcontainers/virtual_cluster_test.go index cfef6652164..25eaac51eba 100644 --- a/internal/service/emrcontainers/virtual_cluster_test.go +++ b/internal/service/emrcontainers/virtual_cluster_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfemrcontainers "github.com/hashicorp/terraform-provider-aws/internal/service/emrcontainers" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckVirtualClusterDestroy(ctx context.Context) resource.TestCheckFu _, err := tfemrcontainers.FindVirtualClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 0074e32df18026d365d6fb232a80b3bf652227ac Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:23 -0800 Subject: [PATCH 090/227] `emrserverless` --- internal/service/emrserverless/application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/emrserverless/application.go b/internal/service/emrserverless/application.go index 687427d04f6..b9483c1e693 100644 --- a/internal/service/emrserverless/application.go +++ b/internal/service/emrserverless/application.go @@ -668,7 +668,7 @@ func statusApplication(conn *emrserverless.Client, id string) retry.StateRefresh return func(ctx context.Context) (any, string, error) { output, err := findApplicationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 9e9a0935ba04aed549afd49ccd00b11f62023016 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:24 -0800 Subject: [PATCH 091/227] `events` --- internal/service/events/api_destination.go | 3 ++- internal/service/events/api_destination_test.go | 4 ++-- internal/service/events/archive.go | 3 ++- internal/service/events/archive_test.go | 4 ++-- internal/service/events/bus.go | 3 ++- internal/service/events/bus_policy.go | 3 ++- internal/service/events/bus_policy_test.go | 4 ++-- internal/service/events/bus_test.go | 4 ++-- internal/service/events/connection.go | 5 +++-- internal/service/events/connection_test.go | 4 ++-- internal/service/events/endpoint.go | 5 +++-- internal/service/events/endpoint_test.go | 4 ++-- internal/service/events/permission.go | 3 ++- internal/service/events/permission_test.go | 4 ++-- internal/service/events/rule.go | 3 ++- internal/service/events/rule_test.go | 4 ++-- internal/service/events/target.go | 3 ++- internal/service/events/target_test.go | 4 ++-- 18 files changed, 38 insertions(+), 29 deletions(-) diff --git a/internal/service/events/api_destination.go b/internal/service/events/api_destination.go index a20e8a07c80..2c159ac0274 100644 --- a/internal/service/events/api_destination.go +++ b/internal/service/events/api_destination.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -119,7 +120,7 @@ func resourceAPIDestinationRead(ctx context.Context, d *schema.ResourceData, met output, err := findAPIDestinationByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge API Destination (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/api_destination_test.go b/internal/service/events/api_destination_test.go index c4b0e4df177..b8c08902433 100644 --- a/internal/service/events/api_destination_test.go +++ b/internal/service/events/api_destination_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -221,7 +221,7 @@ func testAccCheckAPIDestinationDestroy(ctx context.Context) resource.TestCheckFu _, err := tfevents.FindAPIDestinationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/archive.go b/internal/service/events/archive.go index 1899a953d39..345178e96a5 100644 --- a/internal/service/events/archive.go +++ b/internal/service/events/archive.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -131,7 +132,7 @@ func resourceArchiveRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findArchiveByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Archive (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/archive_test.go b/internal/service/events/archive_test.go index 6a75b695951..db4a354b401 100644 --- a/internal/service/events/archive_test.go +++ b/internal/service/events/archive_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -203,7 +203,7 @@ func testAccCheckArchiveDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindArchiveByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/bus.go b/internal/service/events/bus.go index be478f146af..67698ec172f 100644 --- a/internal/service/events/bus.go +++ b/internal/service/events/bus.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -174,7 +175,7 @@ func resourceBusRead(ctx context.Context, d *schema.ResourceData, meta any) diag output, err := findEventBusByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Event Bus (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/bus_policy.go b/internal/service/events/bus_policy.go index b5b12694e05..66a197e432c 100644 --- a/internal/service/events/bus_policy.go +++ b/internal/service/events/bus_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -98,7 +99,7 @@ func resourceBusPolicyRead(ctx context.Context, d *schema.ResourceData, meta any policy, err := findEventBusPolicyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Event Bus (%s) Policy not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/bus_policy_test.go b/internal/service/events/bus_policy_test.go index 1e61ce812ca..cd839c1cffc 100644 --- a/internal/service/events/bus_policy_test.go +++ b/internal/service/events/bus_policy_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -152,7 +152,7 @@ func testAccCheckBusPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindEventBusPolicyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/bus_test.go b/internal/service/events/bus_test.go index 6f292a13748..d1de7abefbd 100644 --- a/internal/service/events/bus_test.go +++ b/internal/service/events/bus_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -350,7 +350,7 @@ func testAccCheckBusDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindEventBusByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/connection.go b/internal/service/events/connection.go index 5dfd8b9dde1..3fe60c0c1bb 100644 --- a/internal/service/events/connection.go +++ b/internal/service/events/connection.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -332,7 +333,7 @@ func resourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findConnectionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -459,7 +460,7 @@ func statusConnectionState(ctx context.Context, conn *eventbridge.Client, name s return func() (any, string, error) { output, err := findConnectionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/events/connection_test.go b/internal/service/events/connection_test.go index d7551189942..0ad094c62d7 100644 --- a/internal/service/events/connection_test.go +++ b/internal/service/events/connection_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -680,7 +680,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindConnectionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/endpoint.go b/internal/service/events/endpoint.go index d9add2decf6..caa5d14c7f3 100644 --- a/internal/service/events/endpoint.go +++ b/internal/service/events/endpoint.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -193,7 +194,7 @@ func resourceEndpointRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findEndpointByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Global Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -331,7 +332,7 @@ func statusEndpointState(ctx context.Context, conn *eventbridge.Client, name str return func() (any, string, error) { output, err := findEndpointByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/events/endpoint_test.go b/internal/service/events/endpoint_test.go index 1f0f000514c..665e5e4e407 100644 --- a/internal/service/events/endpoint_test.go +++ b/internal/service/events/endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -271,7 +271,7 @@ func testAccCheckEndpointDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindEndpointByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/permission.go b/internal/service/events/permission.go index 4859c4235a7..8ef98ccebe0 100644 --- a/internal/service/events/permission.go +++ b/internal/service/events/permission.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +132,7 @@ func resourcePermissionRead(ctx context.Context, d *schema.ResourceData, meta an return findPermissionByTwoPartKey(ctx, conn, eventBusName, statementID) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Permission (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/permission_test.go b/internal/service/events/permission_test.go index a4a585f6cb2..cb27d1ab620 100644 --- a/internal/service/events/permission_test.go +++ b/internal/service/events/permission_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -315,7 +315,7 @@ func testAccCheckPermissionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindPermissionByTwoPartKey(ctx, conn, rs.Primary.Attributes["event_bus_name"], rs.Primary.Attributes["statement_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/rule.go b/internal/service/events/rule.go index 01a6cc07d02..b25e88800e3 100644 --- a/internal/service/events/rule.go +++ b/internal/service/events/rule.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -207,7 +208,7 @@ func resourceRuleRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findRuleByTwoPartKey(ctx, conn, eventBusName, ruleName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/rule_test.go b/internal/service/events/rule_test.go index 86449d2dc6e..ed061dedfb0 100644 --- a/internal/service/events/rule_test.go +++ b/internal/service/events/rule_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -973,7 +973,7 @@ func testAccCheckRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindRuleByTwoPartKey(ctx, conn, rs.Primary.Attributes["event_bus_name"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/events/target.go b/internal/service/events/target.go index bbc053af87a..f00402ea593 100644 --- a/internal/service/events/target.go +++ b/internal/service/events/target.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -540,7 +541,7 @@ func resourceTargetRead(ctx context.Context, d *schema.ResourceData, meta any) d eventBusName := d.Get("event_bus_name").(string) target, err := findTargetByThreePartKey(ctx, conn, eventBusName, d.Get(names.AttrRule).(string), d.Get("target_id").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Target (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index a9178d71157..27676061640 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1280,7 +1280,7 @@ func testAccCheckTargetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfevents.FindTargetByThreePartKey(ctx, conn, rs.Primary.Attributes["event_bus_name"], rs.Primary.Attributes[names.AttrRule], rs.Primary.Attributes["target_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 902d36862d7971521e3221ac8713c35704fd3b68 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:24 -0800 Subject: [PATCH 092/227] `evidently` --- internal/service/evidently/feature.go | 4 ++-- internal/service/evidently/feature_test.go | 4 ++-- internal/service/evidently/launch.go | 4 ++-- internal/service/evidently/launch_test.go | 4 ++-- internal/service/evidently/project.go | 4 ++-- internal/service/evidently/project_test.go | 4 ++-- internal/service/evidently/segment.go | 4 ++-- internal/service/evidently/segment_test.go | 4 ++-- internal/service/evidently/status.go | 8 ++++---- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/service/evidently/feature.go b/internal/service/evidently/feature.go index 959995d7542..a87a0ab37c2 100644 --- a/internal/service/evidently/feature.go +++ b/internal/service/evidently/feature.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -261,7 +261,7 @@ func resourceFeatureRead(ctx context.Context, d *schema.ResourceData, meta any) feature, err := FindFeatureWithProjectNameorARN(ctx, conn, featureName, projectNameOrARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudWatch Evidently Feature (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/evidently/feature_test.go b/internal/service/evidently/feature_test.go index 395d4842f0f..bec0e9743b7 100644 --- a/internal/service/evidently/feature_test.go +++ b/internal/service/evidently/feature_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -634,7 +634,7 @@ func testAccCheckFeatureDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfcloudwatchevidently.FindFeatureWithProjectNameorARN(ctx, conn, featureName, projectNameOrARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/evidently/launch.go b/internal/service/evidently/launch.go index 24cdfd828fe..a064898fe5b 100644 --- a/internal/service/evidently/launch.go +++ b/internal/service/evidently/launch.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -359,7 +359,7 @@ func resourceLaunchRead(ctx context.Context, d *schema.ResourceData, meta any) d launch, err := FindLaunchWithProjectNameorARN(ctx, conn, launchName, projectNameOrARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudWatch Evidently Launch (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/evidently/launch_test.go b/internal/service/evidently/launch_test.go index dc993ade750..c694c83c0b2 100644 --- a/internal/service/evidently/launch_test.go +++ b/internal/service/evidently/launch_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -633,7 +633,7 @@ func testAccCheckLaunchDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfcloudwatchevidently.FindLaunchWithProjectNameorARN(ctx, conn, launchName, projectNameOrARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/evidently/project.go b/internal/service/evidently/project.go index f7e848ed823..4ed9f3e8165 100644 --- a/internal/service/evidently/project.go +++ b/internal/service/evidently/project.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +199,7 @@ func resourceProjectRead(ctx context.Context, d *schema.ResourceData, meta any) project, err := FindProjectByNameOrARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudWatch Evidently Project (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/evidently/project_test.go b/internal/service/evidently/project_test.go index 05421c2d842..ee294843cfc 100644 --- a/internal/service/evidently/project_test.go +++ b/internal/service/evidently/project_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -370,7 +370,7 @@ func testAccCheckProjectDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudwatchevidently.FindProjectByNameOrARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/evidently/segment.go b/internal/service/evidently/segment.go index 8c5d9a763ea..3533d85aa34 100644 --- a/internal/service/evidently/segment.go +++ b/internal/service/evidently/segment.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func resourceSegmentRead(ctx context.Context, d *schema.ResourceData, meta any) segment, err := FindSegmentByNameOrARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudWatch Evidently Segment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/evidently/segment_test.go b/internal/service/evidently/segment_test.go index 2cce5befb67..e87646cde02 100644 --- a/internal/service/evidently/segment_test.go +++ b/internal/service/evidently/segment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -216,7 +216,7 @@ func testAccCheckSegmentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudwatchevidently.FindSegmentByNameOrARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/evidently/status.go b/internal/service/evidently/status.go index 7ecd63401f6..d1430cd325e 100644 --- a/internal/service/evidently/status.go +++ b/internal/service/evidently/status.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/evidently" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusFeature(ctx context.Context, conn *evidently.Client, id string) sdkretry.StateRefreshFunc { @@ -21,7 +21,7 @@ func statusFeature(ctx context.Context, conn *evidently.Client, id string) sdkre output, err := FindFeatureWithProjectNameorARN(ctx, conn, featureName, projectNameOrARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -43,7 +43,7 @@ func statusLaunch(ctx context.Context, conn *evidently.Client, id string) sdkret output, err := FindLaunchWithProjectNameorARN(ctx, conn, launchName, projectNameOrARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -59,7 +59,7 @@ func statusProject(ctx context.Context, conn *evidently.Client, id string) sdkre return func() (any, string, error) { output, err := FindProjectByNameOrARN(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 6f0cccef34ac8ca1acd21e4b6f87d42124734b77 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:25 -0800 Subject: [PATCH 093/227] `finspace` --- internal/service/finspace/kx_cluster.go | 7 ++++--- internal/service/finspace/kx_database.go | 3 ++- internal/service/finspace/kx_dataview.go | 7 ++++--- internal/service/finspace/kx_environment.go | 9 +++++---- internal/service/finspace/kx_scaling_group.go | 7 ++++--- internal/service/finspace/kx_user.go | 3 ++- internal/service/finspace/kx_volume.go | 7 ++++--- 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/internal/service/finspace/kx_cluster.go b/internal/service/finspace/kx_cluster.go index 9401f9dfba4..28eb22ed59b 100644 --- a/internal/service/finspace/kx_cluster.go +++ b/internal/service/finspace/kx_cluster.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -528,7 +529,7 @@ func resourceKxClusterRead(ctx context.Context, d *schema.ResourceData, meta any conn := meta.(*conns.AWSClient).FinSpaceClient(ctx) out, err := findKxClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxCluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -702,7 +703,7 @@ func resourceKxClusterDelete(ctx context.Context, d *schema.ResourceData, meta a } _, err = waitKxClusterDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return create.AppendDiagError(diags, names.FinSpace, create.ErrActionWaitingForDeletion, ResNameKxCluster, d.Id(), err) } @@ -764,7 +765,7 @@ func waitKxClusterDeleted(ctx context.Context, conn *finspace.Client, id string, func statusKxCluster(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findKxClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/finspace/kx_database.go b/internal/service/finspace/kx_database.go index b4023a1e6a6..8dc61dc026a 100644 --- a/internal/service/finspace/kx_database.go +++ b/internal/service/finspace/kx_database.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -129,7 +130,7 @@ func resourceKxDatabaseRead(ctx context.Context, d *schema.ResourceData, meta an conn := meta.(*conns.AWSClient).FinSpaceClient(ctx) out, err := findKxDatabaseByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxDatabase (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/finspace/kx_dataview.go b/internal/service/finspace/kx_dataview.go index 319ec4a22a7..0cf2db51487 100644 --- a/internal/service/finspace/kx_dataview.go +++ b/internal/service/finspace/kx_dataview.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -217,7 +218,7 @@ func resourceKxDataviewRead(ctx context.Context, d *schema.ResourceData, meta an conn := meta.(*conns.AWSClient).FinSpaceClient(ctx) out, err := FindKxDataviewById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxDataview (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -306,7 +307,7 @@ func resourceKxDataviewDelete(ctx context.Context, d *schema.ResourceData, meta return create.AppendDiagError(diags, names.FinSpace, create.ErrActionDeleting, ResNameKxDataview, d.Get(names.AttrName).(string), err) } - if _, err := waitKxDataviewDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)); err != nil && !tfresource.NotFound(err) { + if _, err := waitKxDataviewDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)); err != nil && !retry.NotFound(err) { return create.AppendDiagError(diags, names.FinSpace, create.ErrActionWaitingForDeletion, ResNameKxDataview, d.Id(), err) } return diags @@ -396,7 +397,7 @@ func waitKxDataviewDeleted(ctx context.Context, conn *finspace.Client, id string func statusKxDataview(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindKxDataviewById(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/finspace/kx_environment.go b/internal/service/finspace/kx_environment.go index c25340b1da4..355b71c4933 100644 --- a/internal/service/finspace/kx_environment.go +++ b/internal/service/finspace/kx_environment.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -256,7 +257,7 @@ func resourceKxEnvironmentRead(ctx context.Context, d *schema.ResourceData, meta out, err := findKxEnvironmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxEnvironment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -471,7 +472,7 @@ func waitKxEnvironmentDeleted(ctx context.Context, conn *finspace.Client, id str func statusKxEnvironment(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findKxEnvironmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -486,7 +487,7 @@ func statusKxEnvironment(ctx context.Context, conn *finspace.Client, id string) func statusTransitGatewayConfiguration(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findKxEnvironmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -501,7 +502,7 @@ func statusTransitGatewayConfiguration(ctx context.Context, conn *finspace.Clien func statusCustomDNSConfiguration(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findKxEnvironmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/finspace/kx_scaling_group.go b/internal/service/finspace/kx_scaling_group.go index 39e2ac71a61..439eab63527 100644 --- a/internal/service/finspace/kx_scaling_group.go +++ b/internal/service/finspace/kx_scaling_group.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -151,7 +152,7 @@ func resourceKxScalingGroupRead(ctx context.Context, d *schema.ResourceData, met conn := meta.(*conns.AWSClient).FinSpaceClient(ctx) out, err := FindKxScalingGroupById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxScalingGroup (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -204,7 +205,7 @@ func resourceKxScalingGroupDelete(ctx context.Context, d *schema.ResourceData, m } _, err = waitKxScalingGroupDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return create.AppendDiagError(diags, names.FinSpace, create.ErrActionWaitingForDeletion, ResNameKxScalingGroup, d.Id(), err) } @@ -277,7 +278,7 @@ func waitKxScalingGroupDeleted(ctx context.Context, conn *finspace.Client, id st func statusKxScalingGroup(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindKxScalingGroupById(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/finspace/kx_user.go b/internal/service/finspace/kx_user.go index 07b4c68b772..3cfb579f391 100644 --- a/internal/service/finspace/kx_user.go +++ b/internal/service/finspace/kx_user.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -116,7 +117,7 @@ func resourceKxUserRead(ctx context.Context, d *schema.ResourceData, meta any) d conn := meta.(*conns.AWSClient).FinSpaceClient(ctx) out, err := findKxUserByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxUser (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/finspace/kx_volume.go b/internal/service/finspace/kx_volume.go index dee4cc875a2..9e419c2783c 100644 --- a/internal/service/finspace/kx_volume.go +++ b/internal/service/finspace/kx_volume.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -223,7 +224,7 @@ func resourceKxVolumeRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := FindKxVolumeByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FinSpace KxVolume (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -319,7 +320,7 @@ func resourceKxVolumeDelete(ctx context.Context, d *schema.ResourceData, meta an } _, err = waitKxVolumeDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return create.AppendDiagError(diags, names.FinSpace, create.ErrActionWaitingForDeletion, ResNameKxVolume, d.Id(), err) } @@ -381,7 +382,7 @@ func waitKxVolumeDeleted(ctx context.Context, conn *finspace.Client, id string, func statusKxVolume(ctx context.Context, conn *finspace.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindKxVolumeByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 803e042614930a317014f469418035e4ec9fea38 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:26 -0800 Subject: [PATCH 094/227] `firehose` --- internal/service/firehose/delivery_stream.go | 7 ++++--- internal/service/firehose/delivery_stream_test.go | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index b71667df69c..27b8329f456 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -1583,7 +1584,7 @@ func resourceDeliveryStreamRead(ctx context.Context, d *schema.ResourceData, met sn := d.Get(names.AttrName).(string) s, err := findDeliveryStreamByName(ctx, conn, sn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kinesis Firehose Delivery Stream (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1863,7 +1864,7 @@ func statusDeliveryStream(ctx context.Context, conn *firehose.Client, name strin return func() (any, string, error) { output, err := findDeliveryStreamByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1934,7 +1935,7 @@ func statusDeliveryStreamEncryptionConfiguration(ctx context.Context, conn *fire return func() (any, string, error) { output, err := findDeliveryStreamEncryptionConfigurationByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index f880078bd0c..88358d8f947 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffirehose "github.com/hashicorp/terraform-provider-aws/internal/service/firehose" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2563,7 +2563,7 @@ func testAccCheckDeliveryStreamDestroy(ctx context.Context) resource.TestCheckFu _, err := tffirehose.FindDeliveryStreamByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From b57ad7bd356bd4fca5aa3aca937e621c99ee37ed Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:27 -0800 Subject: [PATCH 095/227] `fis` --- internal/service/fis/experiment_template.go | 3 ++- internal/service/fis/experiment_template_test.go | 4 ++-- internal/service/fis/target_account_configuration.go | 3 ++- internal/service/fis/target_account_configuration_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/fis/experiment_template.go b/internal/service/fis/experiment_template.go index 1fa70a8c7ad..ab7a49a9304 100644 --- a/internal/service/fis/experiment_template.go +++ b/internal/service/fis/experiment_template.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -413,7 +414,7 @@ func resourceExperimentTemplateRead(ctx context.Context, d *schema.ResourceData, experimentTemplate, err := findExperimentTemplateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FIS Experiment Template (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/fis/experiment_template_test.go b/internal/service/fis/experiment_template_test.go index 9c015ad7ab8..027717fd551 100644 --- a/internal/service/fis/experiment_template_test.go +++ b/internal/service/fis/experiment_template_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffis "github.com/hashicorp/terraform-provider-aws/internal/service/fis" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -535,7 +535,7 @@ func testAccCheckExperimentTemplateDestroy(ctx context.Context) resource.TestChe _, err := tffis.FindExperimentTemplateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fis/target_account_configuration.go b/internal/service/fis/target_account_configuration.go index 5459073aca3..c72c724f636 100644 --- a/internal/service/fis/target_account_configuration.go +++ b/internal/service/fis/target_account_configuration.go @@ -25,6 +25,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/smerr" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -117,7 +118,7 @@ func (r *resourceTargetAccountConfiguration) Read(ctx context.Context, req resou } out, err := findTargetAccountConfigurationByID(ctx, conn, state.AccountId.ValueStringPointer(), state.ExperimentTemplateId.ValueStringPointer()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/fis/target_account_configuration_test.go b/internal/service/fis/target_account_configuration_test.go index cc4a670d21d..ccea0276146 100644 --- a/internal/service/fis/target_account_configuration_test.go +++ b/internal/service/fis/target_account_configuration_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffis "github.com/hashicorp/terraform-provider-aws/internal/service/fis" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckTargetAccountConfigurationDestroy(ctx context.Context) resource accountId := aws.String(rs.Primary.Attributes[names.AttrAccountID]) experimentId := aws.String(rs.Primary.Attributes["experiment_template_id"]) _, err := tffis.FindTargetAccountConfigurationByID(ctx, conn, accountId, experimentId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { From c042adc69bb08ad5b35067e8592c95f6e8f712b4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:28 -0800 Subject: [PATCH 096/227] `fms` --- internal/service/fms/admin_account.go | 7 ++++--- internal/service/fms/admin_account_test.go | 4 ++-- internal/service/fms/policy.go | 3 ++- internal/service/fms/policy_test.go | 4 ++-- internal/service/fms/resource_set.go | 5 +++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/internal/service/fms/admin_account.go b/internal/service/fms/admin_account.go index 49b4498530e..ef2e70e1c91 100644 --- a/internal/service/fms/admin_account.go +++ b/internal/service/fms/admin_account.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -66,7 +67,7 @@ func resourceAdminAccountCreate(ctx context.Context, d *schema.ResourceData, met output, err := findAdminAccount(ctx, conn) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendErrorf(diags, "reading FMS Admin Account (%s): %s", accountID, err) default: @@ -88,7 +89,7 @@ func resourceAdminAccountRead(ctx context.Context, d *schema.ResourceData, meta output, err := findAdminAccount(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FMS Admin Account (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -196,7 +197,7 @@ func statusAdminAccount(ctx context.Context, conn *fms.Client) sdkretry.StateRef return func() (any, string, error) { output, err := findAdminAccount(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fms/admin_account_test.go b/internal/service/fms/admin_account_test.go index bd873685746..c0231a78e7b 100644 --- a/internal/service/fms/admin_account_test.go +++ b/internal/service/fms/admin_account_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffms "github.com/hashicorp/terraform-provider-aws/internal/service/fms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func testAccCheckAdminAccountDestroy(ctx context.Context) resource.TestCheckFunc _, err := tffms.FindAdminAccount(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fms/policy.go b/internal/service/fms/policy.go index 76552c7f70c..b0933e0988b 100644 --- a/internal/service/fms/policy.go +++ b/internal/service/fms/policy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -353,7 +354,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FMS Policy %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index d99c79fab3c..860860ac300 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffms "github.com/hashicorp/terraform-provider-aws/internal/service/fms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -459,7 +459,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tffms.FindPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fms/resource_set.go b/internal/service/fms/resource_set.go index 752515d2c5f..9035d16f9fc 100644 --- a/internal/service/fms/resource_set.go +++ b/internal/service/fms/resource_set.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -179,7 +180,7 @@ func (r *resourceSetResource) Read(ctx context.Context, req resource.ReadRequest } out, err := findResourceSetByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -338,7 +339,7 @@ func waitResourceSetDeleted(ctx context.Context, conn *fms.Client, id string, ti func statusResourceSet(ctx context.Context, conn *fms.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findResourceSetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From b5475daac94e17d866b8fb042beaeabcd1a0bb90 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:28 -0800 Subject: [PATCH 097/227] `fsx` --- internal/service/fsx/backup.go | 5 +++-- internal/service/fsx/backup_test.go | 4 ++-- internal/service/fsx/data_repository_association.go | 5 +++-- internal/service/fsx/data_repository_association_test.go | 4 ++-- internal/service/fsx/file_cache.go | 5 +++-- internal/service/fsx/file_cache_test.go | 4 ++-- internal/service/fsx/lustre_file_system.go | 7 ++++--- internal/service/fsx/lustre_file_system_test.go | 4 ++-- internal/service/fsx/ontap_file_system.go | 3 ++- internal/service/fsx/ontap_file_system_test.go | 4 ++-- internal/service/fsx/ontap_storage_virtual_machine.go | 5 +++-- internal/service/fsx/ontap_storage_virtual_machine_test.go | 4 ++-- internal/service/fsx/ontap_volume.go | 7 ++++--- internal/service/fsx/ontap_volume_test.go | 4 ++-- internal/service/fsx/openzfs_file_system.go | 3 ++- internal/service/fsx/openzfs_file_system_test.go | 4 ++-- internal/service/fsx/openzfs_snapshot.go | 5 +++-- internal/service/fsx/openzfs_snapshot_test.go | 4 ++-- internal/service/fsx/openzfs_volume.go | 3 ++- internal/service/fsx/openzfs_volume_test.go | 4 ++-- internal/service/fsx/s3_access_point_attachment.go | 4 ++-- internal/service/fsx/s3_access_point_attachment_test.go | 4 ++-- internal/service/fsx/windows_file_system.go | 3 ++- internal/service/fsx/windows_file_system_test.go | 4 ++-- 24 files changed, 57 insertions(+), 46 deletions(-) diff --git a/internal/service/fsx/backup.go b/internal/service/fsx/backup.go index 7ca406281f2..ed225a83ef1 100644 --- a/internal/service/fsx/backup.go +++ b/internal/service/fsx/backup.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -122,7 +123,7 @@ func resourceBackupRead(ctx context.Context, d *schema.ResourceData, meta any) d backup, err := findBackupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx Backup (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -230,7 +231,7 @@ func statusBackup(ctx context.Context, conn *fsx.Client, id string) sdkretry.Sta return func() (any, string, error) { output, err := findBackupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/backup_test.go b/internal/service/fsx/backup_test.go index b4020c35a89..30ab0ee3fe5 100644 --- a/internal/service/fsx/backup_test.go +++ b/internal/service/fsx/backup_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -299,7 +299,7 @@ func testAccCheckBackupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tffsx.FindBackupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/data_repository_association.go b/internal/service/fsx/data_repository_association.go index e5def835d73..51cd77d6363 100644 --- a/internal/service/fsx/data_repository_association.go +++ b/internal/service/fsx/data_repository_association.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -203,7 +204,7 @@ func resourceDataRepositoryAssociationRead(ctx context.Context, d *schema.Resour association, err := findDataRepositoryAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for Lustre Data Repository Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -338,7 +339,7 @@ func statusDataRepositoryAssociation(ctx context.Context, conn *fsx.Client, id s return func() (any, string, error) { output, err := findDataRepositoryAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/data_repository_association_test.go b/internal/service/fsx/data_repository_association_test.go index 1e3180b6bf6..ac19efad687 100644 --- a/internal/service/fsx/data_repository_association_test.go +++ b/internal/service/fsx/data_repository_association_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -573,7 +573,7 @@ func testAccCheckDataRepositoryAssociationDestroy(ctx context.Context) resource. _, err := tffsx.FindDataRepositoryAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/file_cache.go b/internal/service/fsx/file_cache.go index 3bdc510b2e0..7674d96713e 100644 --- a/internal/service/fsx/file_cache.go +++ b/internal/service/fsx/file_cache.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -346,7 +347,7 @@ func resourceFileCacheRead(ctx context.Context, d *schema.ResourceData, meta any filecache, err := findFileCacheByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx FileCache (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -492,7 +493,7 @@ func statusFileCache(ctx context.Context, conn *fsx.Client, id string) sdkretry. return func() (any, string, error) { output, err := findFileCacheByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/file_cache_test.go b/internal/service/fsx/file_cache_test.go index 7d568e0d85c..8aea9305a96 100644 --- a/internal/service/fsx/file_cache_test.go +++ b/internal/service/fsx/file_cache_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -402,7 +402,7 @@ func testAccCheckFileCacheDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tffsx.FindFileCacheByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/lustre_file_system.go b/internal/service/fsx/lustre_file_system.go index 7c7037c6912..4133123ea82 100644 --- a/internal/service/fsx/lustre_file_system.go +++ b/internal/service/fsx/lustre_file_system.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -596,7 +597,7 @@ func resourceLustreFileSystemRead(ctx context.Context, d *schema.ResourceData, m filesystem, err := findLustreFileSystemByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for Lustre File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -880,7 +881,7 @@ func statusFileSystem(ctx context.Context, conn *fsx.Client, id string) sdkretry return func() (any, string, error) { output, err := findFileSystemByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1001,7 +1002,7 @@ func statusFileSystemAdministrativeAction(ctx context.Context, conn *fsx.Client, return func() (any, string, error) { output, err := findFileSystemAdministrativeAction(ctx, conn, fsID, actionType) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/lustre_file_system_test.go b/internal/service/fsx/lustre_file_system_test.go index b12f869ee02..c544915be5f 100644 --- a/internal/service/fsx/lustre_file_system_test.go +++ b/internal/service/fsx/lustre_file_system_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1473,7 +1473,7 @@ func testAccCheckLustreFileSystemDestroy(ctx context.Context) resource.TestCheck _, err := tffsx.FindLustreFileSystemByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/ontap_file_system.go b/internal/service/fsx/ontap_file_system.go index 03dbc602a67..409777fdedc 100644 --- a/internal/service/fsx/ontap_file_system.go +++ b/internal/service/fsx/ontap_file_system.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -369,7 +370,7 @@ func resourceONTAPFileSystemRead(ctx context.Context, d *schema.ResourceData, me filesystem, err := findONTAPFileSystemByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for NetApp ONTAP File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/fsx/ontap_file_system_test.go b/internal/service/fsx/ontap_file_system_test.go index 020d412490f..0a064050ede 100644 --- a/internal/service/fsx/ontap_file_system_test.go +++ b/internal/service/fsx/ontap_file_system_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -865,7 +865,7 @@ func testAccCheckONTAPFileSystemDestroy(ctx context.Context) resource.TestCheckF _, err := tffsx.FindONTAPFileSystemByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/ontap_storage_virtual_machine.go b/internal/service/fsx/ontap_storage_virtual_machine.go index 4acc01c4871..f53398165f2 100644 --- a/internal/service/fsx/ontap_storage_virtual_machine.go +++ b/internal/service/fsx/ontap_storage_virtual_machine.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -280,7 +281,7 @@ func resourceONTAPStorageVirtualMachineRead(ctx context.Context, d *schema.Resou storageVirtualMachine, err := findStorageVirtualMachineByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx ONTAP Storage Virtual Machine (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -417,7 +418,7 @@ func statusStorageVirtualMachine(ctx context.Context, conn *fsx.Client, id strin return func() (any, string, error) { output, err := findStorageVirtualMachineByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/ontap_storage_virtual_machine_test.go b/internal/service/fsx/ontap_storage_virtual_machine_test.go index 6543e5329a9..a71c996a2ad 100644 --- a/internal/service/fsx/ontap_storage_virtual_machine_test.go +++ b/internal/service/fsx/ontap_storage_virtual_machine_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -364,7 +364,7 @@ func testAccCheckONTAPStorageVirtualMachineDestroy(ctx context.Context) resource _, err := tffsx.FindStorageVirtualMachineByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/ontap_volume.go b/internal/service/fsx/ontap_volume.go index 8a3dd3555dd..758f49c1617 100644 --- a/internal/service/fsx/ontap_volume.go +++ b/internal/service/fsx/ontap_volume.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -429,7 +430,7 @@ func resourceONTAPVolumeRead(ctx context.Context, d *schema.ResourceData, meta a volume, err := findONTAPVolumeByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for NetApp ONTAP Volume (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -672,7 +673,7 @@ func statusVolume(ctx context.Context, conn *fsx.Client, id string) sdkretry.Sta return func() (any, string, error) { output, err := findVolumeByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -790,7 +791,7 @@ func statusVolumeAdministrativeAction(ctx context.Context, conn *fsx.Client, vol return func() (any, string, error) { output, err := findVolumeAdministrativeAction(ctx, conn, volID, actionType) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/ontap_volume_test.go b/internal/service/fsx/ontap_volume_test.go index 3811b77783d..5c72e081cd1 100644 --- a/internal/service/fsx/ontap_volume_test.go +++ b/internal/service/fsx/ontap_volume_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -821,7 +821,7 @@ func testAccCheckONTAPVolumeDestroy(ctx context.Context) resource.TestCheckFunc _, err := tffsx.FindONTAPVolumeByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/openzfs_file_system.go b/internal/service/fsx/openzfs_file_system.go index e875e3f394e..1a85370cc99 100644 --- a/internal/service/fsx/openzfs_file_system.go +++ b/internal/service/fsx/openzfs_file_system.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -525,7 +526,7 @@ func resourceOpenZFSFileSystemRead(ctx context.Context, d *schema.ResourceData, filesystem, err := findOpenZFSFileSystemByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for OpenZFS File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/fsx/openzfs_file_system_test.go b/internal/service/fsx/openzfs_file_system_test.go index 70b345a841c..460e9f337b5 100644 --- a/internal/service/fsx/openzfs_file_system_test.go +++ b/internal/service/fsx/openzfs_file_system_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1290,7 +1290,7 @@ func testAccCheckOpenZFSFileSystemDestroy(ctx context.Context) resource.TestChec _, err := tffsx.FindOpenZFSFileSystemByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/openzfs_snapshot.go b/internal/service/fsx/openzfs_snapshot.go index f9ea0281b9d..6c5dadc6862 100644 --- a/internal/service/fsx/openzfs_snapshot.go +++ b/internal/service/fsx/openzfs_snapshot.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -105,7 +106,7 @@ func resourceOpenZFSSnapshotRead(ctx context.Context, d *schema.ResourceData, me snapshot, err := findSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -228,7 +229,7 @@ func statusSnapshot(ctx context.Context, conn *fsx.Client, id string) sdkretry.S return func() (any, string, error) { output, err := findSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/openzfs_snapshot_test.go b/internal/service/fsx/openzfs_snapshot_test.go index 1e214cbbf9f..c0b9bc2851a 100644 --- a/internal/service/fsx/openzfs_snapshot_test.go +++ b/internal/service/fsx/openzfs_snapshot_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -259,7 +259,7 @@ func testAccCheckOpenZFSSnapshotDestroy(ctx context.Context) resource.TestCheckF _, err := tffsx.FindSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/openzfs_volume.go b/internal/service/fsx/openzfs_volume.go index 6dc7cbc9c36..9ed87637e74 100644 --- a/internal/service/fsx/openzfs_volume.go +++ b/internal/service/fsx/openzfs_volume.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -281,7 +282,7 @@ func resourceOpenZFSVolumeRead(ctx context.Context, d *schema.ResourceData, meta volume, err := findOpenZFSVolumeByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for OpenZFS Volume (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/fsx/openzfs_volume_test.go b/internal/service/fsx/openzfs_volume_test.go index 77f59f72b18..ff12e467fef 100644 --- a/internal/service/fsx/openzfs_volume_test.go +++ b/internal/service/fsx/openzfs_volume_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -542,7 +542,7 @@ func testAccCheckOpenZFSVolumeDestroy(ctx context.Context) resource.TestCheckFun _, err := tffsx.FindOpenZFSVolumeByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/s3_access_point_attachment.go b/internal/service/fsx/s3_access_point_attachment.go index e7284524104..53d941efcfe 100644 --- a/internal/service/fsx/s3_access_point_attachment.go +++ b/internal/service/fsx/s3_access_point_attachment.go @@ -274,7 +274,7 @@ func (r *s3AccessPointAttachmentResource) Read(ctx context.Context, request reso name := fwflex.StringValueFromFramework(ctx, data.Name) output, err := findS3AccessPointAttachmentByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -428,7 +428,7 @@ func statusS3AccessPointAttachment(conn *fsx.Client, name string) retry.StateRef return func(ctx context.Context) (any, string, error) { output, err := findS3AccessPointAttachmentByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/fsx/s3_access_point_attachment_test.go b/internal/service/fsx/s3_access_point_attachment_test.go index 9b60aa24832..a64779c0ee2 100644 --- a/internal/service/fsx/s3_access_point_attachment_test.go +++ b/internal/service/fsx/s3_access_point_attachment_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -193,7 +193,7 @@ func testAccCheckS3AccessPointAttachmentDestroy(ctx context.Context) resource.Te _, err := tffsx.FindS3AccessPointAttachmentByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/fsx/windows_file_system.go b/internal/service/fsx/windows_file_system.go index fc21e595672..7a6a463a1b7 100644 --- a/internal/service/fsx/windows_file_system.go +++ b/internal/service/fsx/windows_file_system.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -421,7 +422,7 @@ func resourceWindowsFileSystemRead(ctx context.Context, d *schema.ResourceData, filesystem, err := findWindowsFileSystemByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] FSx for Windows File Server File System (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/fsx/windows_file_system_test.go b/internal/service/fsx/windows_file_system_test.go index b9d94daae29..67d4808faaa 100644 --- a/internal/service/fsx/windows_file_system_test.go +++ b/internal/service/fsx/windows_file_system_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -942,7 +942,7 @@ func testAccCheckWindowsFileSystemDestroy(ctx context.Context) resource.TestChec _, err := tffsx.FindWindowsFileSystemByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From e492bb5803087914bff55171c309da8255edfc59 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:29 -0800 Subject: [PATCH 098/227] `gamelift` --- internal/service/gamelift/alias.go | 3 ++- internal/service/gamelift/alias_test.go | 6 +++--- internal/service/gamelift/build.go | 5 +++-- internal/service/gamelift/build_test.go | 10 +++++----- internal/service/gamelift/fleet.go | 5 +++-- internal/service/gamelift/fleet_test.go | 14 +++++++------- internal/service/gamelift/game_server_group.go | 7 ++++--- .../service/gamelift/game_server_group_test.go | 4 ++-- internal/service/gamelift/game_session_queue.go | 3 ++- .../service/gamelift/game_session_queue_test.go | 4 ++-- internal/service/gamelift/script.go | 3 ++- internal/service/gamelift/script_test.go | 4 ++-- 12 files changed, 37 insertions(+), 31 deletions(-) diff --git a/internal/service/gamelift/alias.go b/internal/service/gamelift/alias.go index 0859116a683..4555a5411f6 100644 --- a/internal/service/gamelift/alias.go +++ b/internal/service/gamelift/alias.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -111,7 +112,7 @@ func resourceAliasRead(ctx context.Context, d *schema.ResourceData, meta any) di alias, err := findAliasByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GameLift Alias (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/gamelift/alias_test.go b/internal/service/gamelift/alias_test.go index 01db8f99709..92cf5a0ea4b 100644 --- a/internal/service/gamelift/alias_test.go +++ b/internal/service/gamelift/alias_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func TestAccGameLiftAlias_fleetRouting(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -261,7 +261,7 @@ func testAccCheckAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfgamelift.FindAliasByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/gamelift/build.go b/internal/service/gamelift/build.go index 8a3ee718aff..938cd19dca0 100644 --- a/internal/service/gamelift/build.go +++ b/internal/service/gamelift/build.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -145,7 +146,7 @@ func resourceBuildRead(ctx context.Context, d *schema.ResourceData, meta any) di build, err := findBuildByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GameLift Build (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -232,7 +233,7 @@ func statusBuild(ctx context.Context, conn *gamelift.Client, id string) sdkretry return func() (any, string, error) { output, err := findBuildByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/gamelift/build_test.go b/internal/service/gamelift/build_test.go index 801c6361e38..d1f8a73f4cb 100644 --- a/internal/service/gamelift/build_test.go +++ b/internal/service/gamelift/build_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -33,7 +33,7 @@ func TestAccGameLiftBuild_basic(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -104,7 +104,7 @@ func TestAccGameLiftBuild_tags(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -172,7 +172,7 @@ func TestAccGameLiftBuild_disappears(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -244,7 +244,7 @@ func testAccCheckBuildDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfgamelift.FindBuildByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/gamelift/fleet.go b/internal/service/gamelift/fleet.go index 4dda1bc5b59..7a2ac9ea682 100644 --- a/internal/service/gamelift/fleet.go +++ b/internal/service/gamelift/fleet.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -321,7 +322,7 @@ func resourceFleetRead(ctx context.Context, d *schema.ResourceData, meta any) di fleet, err := findFleetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GameLift Fleet (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -538,7 +539,7 @@ func statusFleet(ctx context.Context, conn *gamelift.Client, id string) sdkretry return func() (any, string, error) { output, err := findFleetByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/gamelift/fleet_test.go b/internal/service/gamelift/fleet_test.go index c9a1cb402ff..4abfc3c876c 100644 --- a/internal/service/gamelift/fleet_test.go +++ b/internal/service/gamelift/fleet_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -172,7 +172,7 @@ func TestAccGameLiftFleet_basic(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -266,7 +266,7 @@ func TestAccGameLiftFleet_tags(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -344,7 +344,7 @@ func TestAccGameLiftFleet_allFields(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -488,7 +488,7 @@ func TestAccGameLiftFleet_cert(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -600,7 +600,7 @@ func TestAccGameLiftFleet_disappears(t *testing.T) { region := acctest.Region() g, err := testAccSampleGame(region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skip(err) } @@ -671,7 +671,7 @@ func testAccCheckFleetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfgamelift.FindFleetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/gamelift/game_server_group.go b/internal/service/gamelift/game_server_group.go index 0bd02308445..ca041248612 100644 --- a/internal/service/gamelift/game_server_group.go +++ b/internal/service/gamelift/game_server_group.go @@ -24,6 +24,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -247,7 +248,7 @@ func resourceGameServerGroupRead(ctx context.Context, d *schema.ResourceData, me gameServerGroup, err := findGameServerGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GameLift Game Server Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -268,7 +269,7 @@ func resourceGameServerGroupRead(ctx context.Context, d *schema.ResourceData, me asgPolicy, err := tfautoscaling.FindScalingPolicyByTwoPartKey(ctx, autoscalingConn, asgName, d.Id()) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendErrorf(diags, "reading Auto Scaling Policy (%s/%s): %s", asgName, d.Id(), err) } @@ -389,7 +390,7 @@ func statusGameServerGroup(ctx context.Context, conn *gamelift.Client, name stri return func() (any, string, error) { output, err := findGameServerGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/gamelift/game_server_group_test.go b/internal/service/gamelift/game_server_group_test.go index aeea9c8f601..06646d5bdf4 100644 --- a/internal/service/gamelift/game_server_group_test.go +++ b/internal/service/gamelift/game_server_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -644,7 +644,7 @@ func testAccCheckGameServerGroupDestroy(ctx context.Context) resource.TestCheckF _, err := tfgamelift.FindGameServerGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/gamelift/game_session_queue.go b/internal/service/gamelift/game_session_queue.go index 5563f9ad742..fee0990deb8 100644 --- a/internal/service/gamelift/game_session_queue.go +++ b/internal/service/gamelift/game_session_queue.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -131,7 +132,7 @@ func resourceGameSessionQueueRead(ctx context.Context, d *schema.ResourceData, m sessionQueue, err := findGameSessionQueueByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GameLift Game Session Queue %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/gamelift/game_session_queue_test.go b/internal/service/gamelift/game_session_queue_test.go index 19ca5111532..214a2794bfc 100644 --- a/internal/service/gamelift/game_session_queue_test.go +++ b/internal/service/gamelift/game_session_queue_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckGameSessionQueueDestroy(ctx context.Context) resource.TestCheck _, err := tfgamelift.FindGameSessionQueueByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/gamelift/script.go b/internal/service/gamelift/script.go index a16df67598d..60d5cdbaaa3 100644 --- a/internal/service/gamelift/script.go +++ b/internal/service/gamelift/script.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -153,7 +154,7 @@ func resourceScriptRead(ctx context.Context, d *schema.ResourceData, meta any) d script, err := findScriptByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GameLift Script (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/gamelift/script_test.go b/internal/service/gamelift/script_test.go index 696182c9fb2..d1cae83bc80 100644 --- a/internal/service/gamelift/script_test.go +++ b/internal/service/gamelift/script_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckScriptDestroy(ctx context.Context) resource.TestCheckFunc { script, err := tfgamelift.FindScriptByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 83a1d4151993766f7fe4d8d57a18163918bc186c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:30 -0800 Subject: [PATCH 099/227] `glacier` --- internal/service/glacier/vault.go | 7 ++++--- internal/service/glacier/vault_lock.go | 5 +++-- internal/service/glacier/vault_lock_test.go | 4 ++-- internal/service/glacier/vault_test.go | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/glacier/vault.go b/internal/service/glacier/vault.go index 8f42e5322f8..819d742b592 100644 --- a/internal/service/glacier/vault.go +++ b/internal/service/glacier/vault.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -155,7 +156,7 @@ func resourceVaultRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findVaultByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glacier Vault (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -171,7 +172,7 @@ func resourceVaultRead(ctx context.Context, d *schema.ResourceData, meta any) di accessPolicy, err := findVaultAccessPolicyByName(ctx, conn, d.Id()) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("access_policy", nil) case err != nil: return sdkdiag.AppendErrorf(diags, "reading Glacier Vault (%s) access policy: %s", d.Id(), err) @@ -186,7 +187,7 @@ func resourceVaultRead(ctx context.Context, d *schema.ResourceData, meta any) di notificationConfig, err := findVaultNotificationsByName(ctx, conn, d.Id()) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("notification", nil) case err != nil: return sdkdiag.AppendErrorf(diags, "reading Glacier Vault (%s) notifications: %s", d.Id(), err) diff --git a/internal/service/glacier/vault_lock.go b/internal/service/glacier/vault_lock.go index 9d62db14aac..7f10aa4d78f 100644 --- a/internal/service/glacier/vault_lock.go +++ b/internal/service/glacier/vault_lock.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -116,7 +117,7 @@ func resourceVaultLockRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findVaultLockByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glaier Vault Lock (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -190,7 +191,7 @@ func statusLockState(ctx context.Context, conn *glacier.Client, name string) sdk return func() (any, string, error) { output, err := findVaultLockByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/glacier/vault_lock_test.go b/internal/service/glacier/vault_lock_test.go index 3346ba32690..ac98539ae05 100644 --- a/internal/service/glacier/vault_lock_test.go +++ b/internal/service/glacier/vault_lock_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglacier "github.com/hashicorp/terraform-provider-aws/internal/service/glacier" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -161,7 +161,7 @@ func testAccCheckVaultLockDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfglacier.FindVaultLockByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glacier/vault_test.go b/internal/service/glacier/vault_test.go index 6f4d8bfd93c..6ce8ba805dd 100644 --- a/internal/service/glacier/vault_test.go +++ b/internal/service/glacier/vault_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglacier "github.com/hashicorp/terraform-provider-aws/internal/service/glacier" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -289,7 +289,7 @@ func testAccCheckVaultDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfglacier.FindVaultByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 72abff510bb9eccaa8bddc1a7a1bb137f813affe Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:31 -0800 Subject: [PATCH 100/227] `globalaccelerator` --- internal/service/globalaccelerator/accelerator.go | 5 +++-- internal/service/globalaccelerator/accelerator_test.go | 4 ++-- .../service/globalaccelerator/cross_account_attachment.go | 3 ++- .../globalaccelerator/cross_account_attachment_test.go | 4 ++-- .../service/globalaccelerator/custom_routing_accelerator.go | 5 +++-- .../globalaccelerator/custom_routing_accelerator_test.go | 4 ++-- .../globalaccelerator/custom_routing_endpoint_group.go | 3 ++- .../globalaccelerator/custom_routing_endpoint_group_test.go | 4 ++-- .../service/globalaccelerator/custom_routing_listener.go | 3 ++- .../globalaccelerator/custom_routing_listener_test.go | 4 ++-- internal/service/globalaccelerator/endpoint_group.go | 3 ++- internal/service/globalaccelerator/endpoint_group_test.go | 6 +++--- internal/service/globalaccelerator/listener.go | 3 ++- internal/service/globalaccelerator/listener_test.go | 4 ++-- 14 files changed, 31 insertions(+), 24 deletions(-) diff --git a/internal/service/globalaccelerator/accelerator.go b/internal/service/globalaccelerator/accelerator.go index 8520dd05bc0..bdd9f305a6d 100644 --- a/internal/service/globalaccelerator/accelerator.go +++ b/internal/service/globalaccelerator/accelerator.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -192,7 +193,7 @@ func resourceAcceleratorRead(ctx context.Context, d *schema.ResourceData, meta a accelerator, err := findAcceleratorByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Global Accelerator Accelerator (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -385,7 +386,7 @@ func statusAccelerator(ctx context.Context, conn *globalaccelerator.Client, arn return func() (any, string, error) { accelerator, err := findAcceleratorByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/globalaccelerator/accelerator_test.go b/internal/service/globalaccelerator/accelerator_test.go index 615a028be97..fecc1406b4e 100644 --- a/internal/service/globalaccelerator/accelerator_test.go +++ b/internal/service/globalaccelerator/accelerator_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -425,7 +425,7 @@ func testAccCheckAcceleratorDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfglobalaccelerator.FindAcceleratorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/globalaccelerator/cross_account_attachment.go b/internal/service/globalaccelerator/cross_account_attachment.go index 561be7b3674..a7c5a7afec3 100644 --- a/internal/service/globalaccelerator/cross_account_attachment.go +++ b/internal/service/globalaccelerator/cross_account_attachment.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -146,7 +147,7 @@ func (r *crossAccountAttachmentResource) Read(ctx context.Context, request resou output, err := findCrossAccountAttachmentByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/globalaccelerator/cross_account_attachment_test.go b/internal/service/globalaccelerator/cross_account_attachment_test.go index d8260910c22..43de9a2369d 100644 --- a/internal/service/globalaccelerator/cross_account_attachment_test.go +++ b/internal/service/globalaccelerator/cross_account_attachment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -217,7 +217,7 @@ func testAccCheckCrossAccountAttachmentDestroy(ctx context.Context) resource.Tes _, err := tfglobalaccelerator.FindCrossAccountAttachmentByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/globalaccelerator/custom_routing_accelerator.go b/internal/service/globalaccelerator/custom_routing_accelerator.go index ddd5d664cbf..b0bf884d5b7 100644 --- a/internal/service/globalaccelerator/custom_routing_accelerator.go +++ b/internal/service/globalaccelerator/custom_routing_accelerator.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -186,7 +187,7 @@ func resourceCustomRoutingAcceleratorRead(ctx context.Context, d *schema.Resourc accelerator, err := findCustomRoutingAcceleratorByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Global Accelerator Custom Routing Accelerator (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -378,7 +379,7 @@ func statusCustomRoutingAccelerator(ctx context.Context, conn *globalaccelerator return func() (any, string, error) { accelerator, err := findCustomRoutingAcceleratorByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/globalaccelerator/custom_routing_accelerator_test.go b/internal/service/globalaccelerator/custom_routing_accelerator_test.go index f7d009d6b51..62127d7e8e3 100644 --- a/internal/service/globalaccelerator/custom_routing_accelerator_test.go +++ b/internal/service/globalaccelerator/custom_routing_accelerator_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -195,7 +195,7 @@ func testAccCheckCustomRoutingAcceleratorDestroy(ctx context.Context) resource.T _, err := tfglobalaccelerator.FindCustomRoutingAcceleratorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/globalaccelerator/custom_routing_endpoint_group.go b/internal/service/globalaccelerator/custom_routing_endpoint_group.go index 78c59a137ac..f38f5c26899 100644 --- a/internal/service/globalaccelerator/custom_routing_endpoint_group.go +++ b/internal/service/globalaccelerator/custom_routing_endpoint_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -162,7 +163,7 @@ func resourceCustomRoutingEndpointGroupRead(ctx context.Context, d *schema.Resou endpointGroup, err := findCustomRoutingEndpointGroupByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Global Accelerator Custom Routing Endpoint Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go b/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go index 136bd579677..207f6311ca0 100644 --- a/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go +++ b/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +184,7 @@ func testAccCheckCustomRoutingEndpointGroupDestroy(ctx context.Context) resource _, err := tfglobalaccelerator.FindCustomRoutingEndpointGroupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/globalaccelerator/custom_routing_listener.go b/internal/service/globalaccelerator/custom_routing_listener.go index 559778af91e..70c7f930de7 100644 --- a/internal/service/globalaccelerator/custom_routing_listener.go +++ b/internal/service/globalaccelerator/custom_routing_listener.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +108,7 @@ func resourceCustomRoutingListenerRead(ctx context.Context, d *schema.ResourceDa listener, err := findCustomRoutingListenerByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Global Accelerator Custom Routing Listener (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/globalaccelerator/custom_routing_listener_test.go b/internal/service/globalaccelerator/custom_routing_listener_test.go index 6fd17e8b35b..2e7fed5266f 100644 --- a/internal/service/globalaccelerator/custom_routing_listener_test.go +++ b/internal/service/globalaccelerator/custom_routing_listener_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +115,7 @@ func testAccCheckCustomRoutingListenerDestroy(ctx context.Context) resource.Test _, err := tfglobalaccelerator.FindCustomRoutingListenerByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/globalaccelerator/endpoint_group.go b/internal/service/globalaccelerator/endpoint_group.go index bf4227f29ea..ece761559ea 100644 --- a/internal/service/globalaccelerator/endpoint_group.go +++ b/internal/service/globalaccelerator/endpoint_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -220,7 +221,7 @@ func resourceEndpointGroupRead(ctx context.Context, d *schema.ResourceData, meta endpointGroup, err := findEndpointGroupByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Global Accelerator endpoint group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/globalaccelerator/endpoint_group_test.go b/internal/service/globalaccelerator/endpoint_group_test.go index 8a6299e7776..68fb266c254 100644 --- a/internal/service/globalaccelerator/endpoint_group_test.go +++ b/internal/service/globalaccelerator/endpoint_group_test.go @@ -17,9 +17,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -503,7 +503,7 @@ func testAccCheckEndpointGroupDestroy(ctx context.Context) resource.TestCheckFun _, err := tfglobalaccelerator.FindEndpointGroupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -526,7 +526,7 @@ func testAccCheckEndpointGroupDeleteSecurityGroup(ctx context.Context, vpc *ec2t v, err := tfec2.FindSecurityGroupByNameAndVPCIDAndOwnerID(ctx, conn, "GlobalAccelerator", aws.ToString(vpc.VpcId), aws.ToString(vpc.OwnerId)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Already gone. return nil } diff --git a/internal/service/globalaccelerator/listener.go b/internal/service/globalaccelerator/listener.go index 87af367ee08..11e2403eae4 100644 --- a/internal/service/globalaccelerator/listener.go +++ b/internal/service/globalaccelerator/listener.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +121,7 @@ func resourceListenerRead(ctx context.Context, d *schema.ResourceData, meta any) listener, err := findListenerByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Global Accelerator Listener (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/globalaccelerator/listener_test.go b/internal/service/globalaccelerator/listener_test.go index 8cbebc2cd68..8929c5ba530 100644 --- a/internal/service/globalaccelerator/listener_test.go +++ b/internal/service/globalaccelerator/listener_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func testAccCheckListenerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfglobalaccelerator.FindListenerByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From f4f77bcdb2a0fc334f92705a146deb23318a6a81 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:32 -0800 Subject: [PATCH 101/227] `glue` --- internal/service/glue/catalog_database.go | 3 ++- internal/service/glue/catalog_database_test.go | 4 ++-- internal/service/glue/catalog_table.go | 3 ++- internal/service/glue/catalog_table_optimizer.go | 3 ++- internal/service/glue/catalog_table_optimizer_test.go | 4 ++-- internal/service/glue/catalog_table_test.go | 4 ++-- internal/service/glue/classifier.go | 3 ++- internal/service/glue/classifier_test.go | 4 ++-- internal/service/glue/connection.go | 3 ++- internal/service/glue/connection_data_source.go | 4 ++-- internal/service/glue/connection_test.go | 4 ++-- internal/service/glue/crawler.go | 3 ++- internal/service/glue/crawler_test.go | 4 ++-- internal/service/glue/data_quality_ruleset.go | 3 ++- internal/service/glue/data_quality_ruleset_test.go | 4 ++-- internal/service/glue/dev_endpoint.go | 5 +++-- internal/service/glue/dev_endpoint_test.go | 4 ++-- internal/service/glue/job.go | 3 ++- internal/service/glue/job_test.go | 4 ++-- internal/service/glue/partition_index.go | 5 +++-- internal/service/glue/registry.go | 4 ++-- internal/service/glue/registry_test.go | 4 ++-- internal/service/glue/resource_policy.go | 3 ++- internal/service/glue/resource_policy_test.go | 4 ++-- 24 files changed, 50 insertions(+), 39 deletions(-) diff --git a/internal/service/glue/catalog_database.go b/internal/service/glue/catalog_database.go index 1134db2cd9d..a3930cc155b 100644 --- a/internal/service/glue/catalog_database.go +++ b/internal/service/glue/catalog_database.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -212,7 +213,7 @@ func resourceCatalogDatabaseRead(ctx context.Context, d *schema.ResourceData, me } out, err := findDatabaseByName(ctx, conn, catalogID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Catalog Database (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/catalog_database_test.go b/internal/service/glue/catalog_database_test.go index 4675f0fd1d9..90a5232a4b9 100644 --- a/internal/service/glue/catalog_database_test.go +++ b/internal/service/glue/catalog_database_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -314,7 +314,7 @@ func testAccCheckDatabaseDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfglue.FindDatabaseByName(ctx, conn, catalogId, dbName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/catalog_table.go b/internal/service/glue/catalog_table.go index 93823b0544f..b37b84c4de2 100644 --- a/internal/service/glue/catalog_table.go +++ b/internal/service/glue/catalog_table.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -446,7 +447,7 @@ func resourceCatalogTableRead(ctx context.Context, d *schema.ResourceData, meta table, err := findTableByName(ctx, conn, catalogID, dbName, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Catalog Table (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/catalog_table_optimizer.go b/internal/service/glue/catalog_table_optimizer.go index cdc84487d57..6f268252c7c 100644 --- a/internal/service/glue/catalog_table_optimizer.go +++ b/internal/service/glue/catalog_table_optimizer.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -261,7 +262,7 @@ func (r *catalogTableOptimizerResource) Read(ctx context.Context, request resour output, err := findCatalogTableOptimizer(ctx, conn, data.CatalogID.ValueString(), data.DatabaseName.ValueString(), data.TableName.ValueString(), data.Type.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/glue/catalog_table_optimizer_test.go b/internal/service/glue/catalog_table_optimizer_test.go index a455a07c1c8..57d646bedb8 100644 --- a/internal/service/glue/catalog_table_optimizer_test.go +++ b/internal/service/glue/catalog_table_optimizer_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -387,7 +387,7 @@ func testAccCheckCatalogTableOptimizerDestroy(ctx context.Context) resource.Test _, err := tfglue.FindCatalogTableOptimizer(ctx, conn, rs.Primary.Attributes[names.AttrCatalogID], rs.Primary.Attributes[names.AttrDatabaseName], rs.Primary.Attributes[names.AttrTableName], rs.Primary.Attributes[names.AttrType]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/catalog_table_test.go b/internal/service/glue/catalog_table_test.go index c461c07e35c..4285e647d0a 100644 --- a/internal/service/glue/catalog_table_test.go +++ b/internal/service/glue/catalog_table_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1190,7 +1190,7 @@ func testAccCheckTableDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfglue.FindTableByName(ctx, conn, catalogID, dbName, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/classifier.go b/internal/service/glue/classifier.go index ad2cdc9c53d..aec70732a0c 100644 --- a/internal/service/glue/classifier.go +++ b/internal/service/glue/classifier.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -245,7 +246,7 @@ func resourceClassifierRead(ctx context.Context, d *schema.ResourceData, meta an conn := meta.(*conns.AWSClient).GlueClient(ctx) classifier, err := findClassifierByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Classifier (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/classifier_test.go b/internal/service/glue/classifier_test.go index 1cf713332b1..3bfdedeeda1 100644 --- a/internal/service/glue/classifier_test.go +++ b/internal/service/glue/classifier_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -519,7 +519,7 @@ func testAccCheckClassifierDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfglue.FindClassifierByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/connection.go b/internal/service/glue/connection.go index 4dabe9ddbd2..70b2e891ad0 100644 --- a/internal/service/glue/connection.go +++ b/internal/service/glue/connection.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -161,7 +162,7 @@ func resourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta an connection, err := findConnectionByTwoPartKey(ctx, conn, connectionName, catalogID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/connection_data_source.go b/internal/service/glue/connection_data_source.go index 019c6fef170..a623e6efdee 100644 --- a/internal/service/glue/connection_data_source.go +++ b/internal/service/glue/connection_data_source.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func dataSourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta connection, err := findConnectionByTwoPartKey(ctx, conn, connectionName, catalogID) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "Glue Connection (%s) not found", id) } return sdkdiag.AppendErrorf(diags, "reading Glue Connection (%s): %s", id, err) diff --git a/internal/service/glue/connection_test.go b/internal/service/glue/connection_test.go index 983f78ffa21..b653d129d29 100644 --- a/internal/service/glue/connection_test.go +++ b/internal/service/glue/connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -597,7 +597,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfglue.FindConnectionByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes[names.AttrCatalogID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/crawler.go b/internal/service/glue/crawler.go index 0cce96b322e..a4fda5a95f5 100644 --- a/internal/service/glue/crawler.go +++ b/internal/service/glue/crawler.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -482,7 +483,7 @@ func resourceCrawlerRead(ctx context.Context, d *schema.ResourceData, meta any) conn := meta.(*conns.AWSClient).GlueClient(ctx) crawler, err := findCrawlerByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Crawler (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index 67b370d889a..1cdfa322696 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1759,7 +1759,7 @@ func testAccCheckCrawlerDestroy(ctx context.Context) resource.TestCheckFunc { conn := acctest.Provider.Meta().(*conns.AWSClient).GlueClient(ctx) _, err := tfglue.FindCrawlerByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/data_quality_ruleset.go b/internal/service/glue/data_quality_ruleset.go index 8482a474b4c..03f2b2bf1c2 100644 --- a/internal/service/glue/data_quality_ruleset.go +++ b/internal/service/glue/data_quality_ruleset.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -142,7 +143,7 @@ func resourceDataQualityRulesetRead(ctx context.Context, d *schema.ResourceData, name := d.Id() dataQualityRuleset, err := findDataQualityRulesetByName(ctx, conn, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Data Quality Ruleset (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/data_quality_ruleset_test.go b/internal/service/glue/data_quality_ruleset_test.go index 530abb9d861..752eecf5a15 100644 --- a/internal/service/glue/data_quality_ruleset_test.go +++ b/internal/service/glue/data_quality_ruleset_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -319,7 +319,7 @@ func testAccCheckDataQualityRulesetDestroy(ctx context.Context) resource.TestChe _, err := tfglue.FindDataQualityRulesetByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/dev_endpoint.go b/internal/service/glue/dev_endpoint.go index 3086f1553e8..e94ae1fae75 100644 --- a/internal/service/glue/dev_endpoint.go +++ b/internal/service/glue/dev_endpoint.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -274,7 +275,7 @@ func resourceDevEndpointRead(ctx context.Context, d *schema.ResourceData, meta a endpoint, err := findDevEndpointByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Dev Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -536,7 +537,7 @@ func statusDevEndpoint(ctx context.Context, conn *glue.Client, name string) sdkr return func() (any, string, error) { output, err := findDevEndpointByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/glue/dev_endpoint_test.go b/internal/service/glue/dev_endpoint_test.go index 8f10637fb4a..36346d198d7 100644 --- a/internal/service/glue/dev_endpoint_test.go +++ b/internal/service/glue/dev_endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -616,7 +616,7 @@ func testAccCheckDevEndpointDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfglue.FindDevEndpointByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/job.go b/internal/service/glue/job.go index 0a95d040bf9..e1668d66d5e 100644 --- a/internal/service/glue/job.go +++ b/internal/service/glue/job.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -350,7 +351,7 @@ func resourceJobRead(ctx context.Context, d *schema.ResourceData, meta any) diag job, err := findJobByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Job (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/job_test.go b/internal/service/glue/job_test.go index 91077ced8b9..c81fb00dd7b 100644 --- a/internal/service/glue/job_test.go +++ b/internal/service/glue/job_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1235,7 +1235,7 @@ func testAccCheckJobDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfglue.FindJobByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/partition_index.go b/internal/service/glue/partition_index.go index 08dc904bf44..26689eec4bb 100644 --- a/internal/service/glue/partition_index.go +++ b/internal/service/glue/partition_index.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +129,7 @@ func resourcePartitionIndexRead(ctx context.Context, d *schema.ResourceData, met log.Printf("[DEBUG] Reading Glue Partition Index: %s", d.Id()) partition, err := findPartitionIndexByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Partition Index (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -231,7 +232,7 @@ func statusPartitionIndex(ctx context.Context, conn *glue.Client, id string) sdk return func() (any, string, error) { output, err := findPartitionIndexByName(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/glue/registry.go b/internal/service/glue/registry.go index e14fa596eaa..1a0ba65384a 100644 --- a/internal/service/glue/registry.go +++ b/internal/service/glue/registry.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +91,7 @@ func resourceRegistryRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findRegistryByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Registry (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/registry_test.go b/internal/service/glue/registry_test.go index 3076c4fee56..3649b43c228 100644 --- a/internal/service/glue/registry_test.go +++ b/internal/service/glue/registry_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -215,7 +215,7 @@ func testAccCheckRegistryDestroy(ctx context.Context) resource.TestCheckFunc { conn := acctest.Provider.Meta().(*conns.AWSClient).GlueClient(ctx) output, err := tfglue.FindRegistryByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/glue/resource_policy.go b/internal/service/glue/resource_policy.go index f4b86fc092d..a0fc465e868 100644 --- a/internal/service/glue/resource_policy.go +++ b/internal/service/glue/resource_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -86,7 +87,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met output, err := findResourcePolicy(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Glue Resource Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/glue/resource_policy_test.go b/internal/service/glue/resource_policy_test.go index dddbce03041..2247f3b3d55 100644 --- a/internal/service/glue/resource_policy_test.go +++ b/internal/service/glue/resource_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -209,7 +209,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfglue.FindResourcePolicy(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 2cddbdc2d136522a1d0edc5603558a39d89aecdb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:35 -0800 Subject: [PATCH 102/227] `grafana` --- internal/service/grafana/license_association.go | 4 ++-- internal/service/grafana/license_association_test.go | 4 ++-- internal/service/grafana/role_association.go | 3 ++- internal/service/grafana/role_association_test.go | 4 ++-- internal/service/grafana/workspace.go | 5 +++-- internal/service/grafana/workspace_saml_configuration.go | 5 +++-- internal/service/grafana/workspace_service_account.go | 3 ++- internal/service/grafana/workspace_service_account_test.go | 4 ++-- internal/service/grafana/workspace_service_account_token.go | 3 ++- .../service/grafana/workspace_service_account_token_test.go | 4 ++-- internal/service/grafana/workspace_test.go | 4 ++-- 11 files changed, 24 insertions(+), 19 deletions(-) diff --git a/internal/service/grafana/license_association.go b/internal/service/grafana/license_association.go index 8adc8b25b3d..b519560e035 100644 --- a/internal/service/grafana/license_association.go +++ b/internal/service/grafana/license_association.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) // @SDKResource("aws_grafana_license_association", name="License Association") @@ -103,7 +103,7 @@ func resourceLicenseAssociationRead(ctx context.Context, d *schema.ResourceData, workspace, err := findLicensedWorkspaceByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] Grafana License Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/grafana/license_association_test.go b/internal/service/grafana/license_association_test.go index 7799c23b860..fb2523659ef 100644 --- a/internal/service/grafana/license_association_test.go +++ b/internal/service/grafana/license_association_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckLicenseAssociationDestroy(ctx context.Context) resource.TestChe _, err := tfgrafana.FindLicensedWorkspaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/grafana/role_association.go b/internal/service/grafana/role_association.go index 0dfa6cfd6c7..723430bd10d 100644 --- a/internal/service/grafana/role_association.go +++ b/internal/service/grafana/role_association.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +108,7 @@ func resourceRoleAssociationRead(ctx context.Context, d *schema.ResourceData, me workspaceID := d.Get("workspace_id").(string) roleAssociations, err := findRoleAssociationsByTwoPartKey(ctx, conn, role, workspaceID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Grafana Workspace Role Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/grafana/role_association_test.go b/internal/service/grafana/role_association_test.go index 553473503f6..80885f5ddb1 100644 --- a/internal/service/grafana/role_association_test.go +++ b/internal/service/grafana/role_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -319,7 +319,7 @@ func testAccCheckRoleAssociationDestroy(ctx context.Context) resource.TestCheckF _, err := tfgrafana.FindRoleAssociationsByTwoPartKey(ctx, conn, awstypes.Role(rs.Primary.Attributes[names.AttrRole]), rs.Primary.Attributes["workspace_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/grafana/workspace.go b/internal/service/grafana/workspace.go index feab023cb0b..1a2cf3d1868 100644 --- a/internal/service/grafana/workspace.go +++ b/internal/service/grafana/workspace.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -270,7 +271,7 @@ func resourceWorkspaceRead(ctx context.Context, d *schema.ResourceData, meta any workspace, err := findWorkspaceByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] Grafana Workspace (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -484,7 +485,7 @@ func statusWorkspace(ctx context.Context, conn *grafana.Client, id string) sdkre return func() (any, string, error) { output, err := findWorkspaceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/grafana/workspace_saml_configuration.go b/internal/service/grafana/workspace_saml_configuration.go index 00eca790ef4..c8f66f57fe9 100644 --- a/internal/service/grafana/workspace_saml_configuration.go +++ b/internal/service/grafana/workspace_saml_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +239,7 @@ func resourceWorkspaceSAMLConfigurationRead(ctx context.Context, d *schema.Resou saml, err := findSAMLConfigurationByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] Grafana Workspace SAML Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -307,7 +308,7 @@ func statusWorkspaceSAMLConfiguration(ctx context.Context, conn *grafana.Client, return func() (any, string, error) { output, err := findSAMLConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/grafana/workspace_service_account.go b/internal/service/grafana/workspace_service_account.go index e92227de038..19e5721cedf 100644 --- a/internal/service/grafana/workspace_service_account.go +++ b/internal/service/grafana/workspace_service_account.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -125,7 +126,7 @@ func (r *workspaceServiceAccountResource) Read(ctx context.Context, request reso output, err := findWorkspaceServiceAccountByTwoPartKey(ctx, conn, data.WorkspaceID.ValueString(), data.ServiceAccountID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/grafana/workspace_service_account_test.go b/internal/service/grafana/workspace_service_account_test.go index 2f1a9512927..17f8671daa7 100644 --- a/internal/service/grafana/workspace_service_account_test.go +++ b/internal/service/grafana/workspace_service_account_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func testAccCheckWorkspaceServiceAccountDestroy(ctx context.Context) resource.Te _, err := tfgrafana.FindWorkspaceServiceAccountByTwoPartKey(ctx, conn, rs.Primary.Attributes["workspace_id"], rs.Primary.Attributes["service_account_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/grafana/workspace_service_account_token.go b/internal/service/grafana/workspace_service_account_token.go index 5c0a9a10231..ede0b280f69 100644 --- a/internal/service/grafana/workspace_service_account_token.go +++ b/internal/service/grafana/workspace_service_account_token.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -167,7 +168,7 @@ func (r *workspaceServiceAccountTokenResource) Read(ctx context.Context, request output, err := findWorkspaceServiceAccountTokenByThreePartKey(ctx, conn, data.WorkspaceID.ValueString(), data.ServiceAccountID.ValueString(), data.TokenID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/grafana/workspace_service_account_token_test.go b/internal/service/grafana/workspace_service_account_token_test.go index 131386ad764..67eaad7ddc3 100644 --- a/internal/service/grafana/workspace_service_account_token_test.go +++ b/internal/service/grafana/workspace_service_account_token_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func testAccCheckWorkspaceServiceAccountTokenDestroy(ctx context.Context) resour _, err := tfgrafana.FindWorkspaceServiceAccountTokenByThreePartKey(ctx, conn, rs.Primary.Attributes["workspace_id"], rs.Primary.Attributes["service_account_id"], rs.Primary.Attributes["service_account_token_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/grafana/workspace_test.go b/internal/service/grafana/workspace_test.go index 8b080adcf99..2884de20795 100644 --- a/internal/service/grafana/workspace_test.go +++ b/internal/service/grafana/workspace_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -550,7 +550,7 @@ func testAccCheckWorkspaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfgrafana.FindWorkspaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 4a965a8ae4ccbc30ef8e8eac81b30092920a1de4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:36 -0800 Subject: [PATCH 103/227] `guardduty` --- internal/service/guardduty/detector.go | 3 ++- internal/service/guardduty/detector_feature.go | 3 ++- internal/service/guardduty/detector_test.go | 4 ++-- internal/service/guardduty/guardduty_test.go | 6 +++--- internal/service/guardduty/invite_accepter.go | 3 ++- internal/service/guardduty/malware_protection_plan.go | 3 ++- internal/service/guardduty/malware_protection_plan_test.go | 4 ++-- internal/service/guardduty/member_detector_feature.go | 3 ++- internal/service/guardduty/organization_configuration.go | 3 ++- .../service/guardduty/organization_configuration_feature.go | 3 ++- 10 files changed, 21 insertions(+), 14 deletions(-) diff --git a/internal/service/guardduty/detector.go b/internal/service/guardduty/detector.go index 17eb8fdb4d9..4b98575f049 100644 --- a/internal/service/guardduty/detector.go +++ b/internal/service/guardduty/detector.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func resourceDetectorRead(ctx context.Context, d *schema.ResourceData, meta any) gdo, err := findDetectorByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GuardDuty Detector (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/guardduty/detector_feature.go b/internal/service/guardduty/detector_feature.go index 80614440b7b..150217b9a29 100644 --- a/internal/service/guardduty/detector_feature.go +++ b/internal/service/guardduty/detector_feature.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceDetectorFeatureRead(ctx context.Context, d *schema.ResourceData, me feature, err := findDetectorFeatureByTwoPartKey(ctx, conn, detectorID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GuardDuty Detector Feature (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/guardduty/detector_test.go b/internal/service/guardduty/detector_test.go index d2eca8f1645..ef2df278771 100644 --- a/internal/service/guardduty/detector_test.go +++ b/internal/service/guardduty/detector_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfguardduty "github.com/hashicorp/terraform-provider-aws/internal/service/guardduty" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -283,7 +283,7 @@ func testAccCheckDetectorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfguardduty.FindDetectorByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/guardduty/guardduty_test.go b/internal/service/guardduty/guardduty_test.go index f59ddc536f8..4eba02fe07f 100644 --- a/internal/service/guardduty/guardduty_test.go +++ b/internal/service/guardduty/guardduty_test.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfguardduty "github.com/hashicorp/terraform-provider-aws/internal/service/guardduty" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func TestAccGuardDuty_serial(t *testing.T) { @@ -126,7 +126,7 @@ func testAccPreCheckDetectorExists(ctx context.Context, t *testing.T) { _, err := tfguardduty.FindDetector(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skipf("reading this AWS account's single GuardDuty Detector: %s", err) } @@ -141,7 +141,7 @@ func testAccPreCheckDetectorNotExists(ctx context.Context, t *testing.T) { _, err := tfguardduty.FindDetector(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } diff --git a/internal/service/guardduty/invite_accepter.go b/internal/service/guardduty/invite_accepter.go index 35230e7040e..703bbe07fbd 100644 --- a/internal/service/guardduty/invite_accepter.go +++ b/internal/service/guardduty/invite_accepter.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -94,7 +95,7 @@ func resourceInviteAccepterRead(ctx context.Context, d *schema.ResourceData, met master, err := findMasterAccountByDetectorID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GuardDuty Detector (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/guardduty/malware_protection_plan.go b/internal/service/guardduty/malware_protection_plan.go index d2d73e5495a..5a3b94041e7 100644 --- a/internal/service/guardduty/malware_protection_plan.go +++ b/internal/service/guardduty/malware_protection_plan.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -207,7 +208,7 @@ func (r *malwareProtectionPlanResource) Read(ctx context.Context, req resource.R out, err := findMalwareProtectionPlanByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/guardduty/malware_protection_plan_test.go b/internal/service/guardduty/malware_protection_plan_test.go index 385d4ba39a1..e6398c74e37 100644 --- a/internal/service/guardduty/malware_protection_plan_test.go +++ b/internal/service/guardduty/malware_protection_plan_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfguardduty "github.com/hashicorp/terraform-provider-aws/internal/service/guardduty" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -321,7 +321,7 @@ func testAccCheckMalwareProtectionPlanDestroy(ctx context.Context) resource.Test _, err := tfguardduty.FindMalwareProtectionPlanByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/guardduty/member_detector_feature.go b/internal/service/guardduty/member_detector_feature.go index f96960bcda7..b2e5a9a9b9f 100644 --- a/internal/service/guardduty/member_detector_feature.go +++ b/internal/service/guardduty/member_detector_feature.go @@ -24,6 +24,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -138,7 +139,7 @@ func (r *memberDetectorFeatureResource) Read(ctx context.Context, request resour output, err := findMemberDetectorFeatureByThreePartKey(ctx, conn, data.DetectorID.ValueString(), data.AccountID.ValueString(), data.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/guardduty/organization_configuration.go b/internal/service/guardduty/organization_configuration.go index 9051ba029ba..621a5981199 100644 --- a/internal/service/guardduty/organization_configuration.go +++ b/internal/service/guardduty/organization_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -167,7 +168,7 @@ func resourceOrganizationConfigurationRead(ctx context.Context, d *schema.Resour output, err := FindOrganizationConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GuardDuty Organization Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/guardduty/organization_configuration_feature.go b/internal/service/guardduty/organization_configuration_feature.go index d35a62fcae6..6e53771932b 100644 --- a/internal/service/guardduty/organization_configuration_feature.go +++ b/internal/service/guardduty/organization_configuration_feature.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -128,7 +129,7 @@ func resourceOrganizationConfigurationFeatureRead(ctx context.Context, d *schema feature, err := FindOrganizationConfigurationFeatureByTwoPartKey(ctx, conn, detectorID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] GuardDuty Organization Configuration Feature (%s) not found, removing from state", d.Id()) d.SetId("") return diags From 0eb381a26e8a77a01663c28e13f7cffb68babf8d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:37 -0800 Subject: [PATCH 104/227] `iam` --- internal/service/iam/access_key.go | 3 ++- internal/service/iam/access_key_test.go | 4 ++-- internal/service/iam/account_alias.go | 3 ++- internal/service/iam/account_alias_test.go | 4 ++-- internal/service/iam/account_password_policy.go | 3 ++- internal/service/iam/account_password_policy_test.go | 4 ++-- internal/service/iam/group.go | 3 ++- internal/service/iam/group_policies_exclusive.go | 4 ++-- internal/service/iam/group_policy.go | 3 ++- internal/service/iam/group_policy_attachment.go | 3 ++- internal/service/iam/group_policy_attachment_test.go | 4 ++-- .../service/iam/group_policy_attachments_exclusive.go | 4 ++-- internal/service/iam/group_policy_test.go | 4 ++-- internal/service/iam/group_test.go | 4 ++-- internal/service/iam/instance_profile.go | 7 ++++--- internal/service/iam/instance_profile_test.go | 4 ++-- internal/service/iam/openid_connect_provider.go | 3 ++- internal/service/iam/openid_connect_provider_test.go | 4 ++-- internal/service/iam/organizations_features.go | 3 ++- internal/service/iam/organizations_features_test.go | 4 ++-- internal/service/iam/policy.go | 4 ++-- internal/service/iam/policy_attachment.go | 3 ++- internal/service/iam/policy_attachment_test.go | 4 ++-- internal/service/iam/policy_test.go | 4 ++-- internal/service/iam/role.go | 10 +++++----- internal/service/iam/role_policies_exclusive.go | 4 ++-- internal/service/iam/role_policy.go | 3 ++- internal/service/iam/role_policy_attachment.go | 3 ++- internal/service/iam/role_policy_attachment_test.go | 4 ++-- .../service/iam/role_policy_attachments_exclusive.go | 4 ++-- internal/service/iam/role_policy_test.go | 4 ++-- internal/service/iam/role_test.go | 4 ++-- internal/service/iam/saml_provider.go | 3 ++- internal/service/iam/saml_provider_test.go | 4 ++-- internal/service/iam/server_certificate.go | 3 ++- internal/service/iam/server_certificate_test.go | 4 ++-- internal/service/iam/service_linked_role.go | 5 +++-- internal/service/iam/service_linked_role_test.go | 4 ++-- internal/service/iam/service_specific_credential.go | 3 ++- .../service/iam/service_specific_credential_test.go | 4 ++-- internal/service/iam/session_context_data_source.go | 3 ++- internal/service/iam/signing_certificate.go | 3 ++- internal/service/iam/signing_certificate_test.go | 4 ++-- internal/service/iam/user.go | 5 +++-- internal/service/iam/user_policies_exclusive.go | 4 ++-- internal/service/iam/user_policy.go | 3 ++- internal/service/iam/user_policy_attachment.go | 3 ++- internal/service/iam/user_policy_attachment_test.go | 4 ++-- .../service/iam/user_policy_attachments_exclusive.go | 4 ++-- internal/service/iam/user_policy_test.go | 4 ++-- internal/service/iam/user_ssh_key.go | 3 ++- internal/service/iam/user_ssh_key_test.go | 4 ++-- internal/service/iam/user_test.go | 3 ++- internal/service/iam/virtual_mfa_device.go | 3 ++- internal/service/iam/virtual_mfa_device_test.go | 4 ++-- 55 files changed, 117 insertions(+), 93 deletions(-) diff --git a/internal/service/iam/access_key.go b/internal/service/iam/access_key.go index fc87b55f2a3..7091ec07020 100644 --- a/internal/service/iam/access_key.go +++ b/internal/service/iam/access_key.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -194,7 +195,7 @@ func resourceAccessKeyRead(ctx context.Context, d *schema.ResourceData, meta any username := d.Get("user").(string) key, err := findAccessKeyByTwoPartKey(ctx, conn, username, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Access Key (%s) for User (%s) not found, removing from state", d.Id(), username) d.SetId("") return diags diff --git a/internal/service/iam/access_key_test.go b/internal/service/iam/access_key_test.go index c62fae40d8c..983daffccb5 100644 --- a/internal/service/iam/access_key_test.go +++ b/internal/service/iam/access_key_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/vault/helper/pgpkeys" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +171,7 @@ func testAccCheckAccessKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindAccessKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes["user"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/iam/account_alias.go b/internal/service/iam/account_alias.go index 1b0402259a2..c8890a6f1b3 100644 --- a/internal/service/iam/account_alias.go +++ b/internal/service/iam/account_alias.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -67,7 +68,7 @@ func resourceAccountAliasRead(ctx context.Context, d *schema.ResourceData, meta var input iam.ListAccountAliasesInput output, err := findAccountAlias(ctx, conn, &input) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Account Alias (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/account_alias_test.go b/internal/service/iam/account_alias_test.go index 62a081bb872..c370dedba14 100644 --- a/internal/service/iam/account_alias_test.go +++ b/internal/service/iam/account_alias_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +104,7 @@ func testAccCheckAccountAliasDestroy(ctx context.Context) resource.TestCheckFunc var input iam.ListAccountAliasesInput _, err := tfiam.FindAccountAlias(ctx, conn, &input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/account_password_policy.go b/internal/service/iam/account_password_policy.go index c51afc1297b..bc7ebc08463 100644 --- a/internal/service/iam/account_password_policy.go +++ b/internal/service/iam/account_password_policy.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -138,7 +139,7 @@ func resourceAccountPasswordPolicyRead(ctx context.Context, d *schema.ResourceDa policy, err := findAccountPasswordPolicy(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Account Password Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/account_password_policy_test.go b/internal/service/iam/account_password_policy_test.go index 7d7eb792848..148621b7805 100644 --- a/internal/service/iam/account_password_policy_test.go +++ b/internal/service/iam/account_password_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +97,7 @@ func testAccCheckAccountPasswordPolicyDestroy(ctx context.Context) resource.Test _, err := tfiam.FindAccountPasswordPolicy(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/group.go b/internal/service/iam/group.go index cdc01d32cd9..f1291566193 100644 --- a/internal/service/iam/group.go +++ b/internal/service/iam/group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +105,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di group, err := findGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/group_policies_exclusive.go b/internal/service/iam/group_policies_exclusive.go index 0dcd88296f5..117e535d54d 100644 --- a/internal/service/iam/group_policies_exclusive.go +++ b/internal/service/iam/group_policies_exclusive.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *groupPoliciesExclusiveResource) Read(ctx context.Context, req resource. } out, err := findGroupPoliciesByName(ctx, conn, state.GroupName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/iam/group_policy.go b/internal/service/iam/group_policy.go index 0fc61c3a904..f862e22051a 100644 --- a/internal/service/iam/group_policy.go +++ b/internal/service/iam/group_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -120,7 +121,7 @@ func resourceGroupPolicyRead(ctx context.Context, d *schema.ResourceData, meta a policyDocument, err := findGroupPolicyByTwoPartKey(ctx, conn, groupName, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Group Policy %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/group_policy_attachment.go b/internal/service/iam/group_policy_attachment.go index 2097b5dab66..86a97cedd76 100644 --- a/internal/service/iam/group_policy_attachment.go +++ b/internal/service/iam/group_policy_attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -82,7 +83,7 @@ func resourceGroupPolicyAttachmentRead(ctx context.Context, d *schema.ResourceDa return findAttachedGroupPolicyByTwoPartKey(ctx, conn, group, policyARN) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Group Policy Attachment (%s) not found, removing from state", id) d.SetId("") return diags diff --git a/internal/service/iam/group_policy_attachment_test.go b/internal/service/iam/group_policy_attachment_test.go index 85e37175b42..1707717e019 100644 --- a/internal/service/iam/group_policy_attachment_test.go +++ b/internal/service/iam/group_policy_attachment_test.go @@ -17,9 +17,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func testAccCheckGroupPolicyAttachmentDestroy(ctx context.Context) resource.Test _, err := tfiam.FindAttachedGroupPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["group"], rs.Primary.Attributes["policy_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/group_policy_attachments_exclusive.go b/internal/service/iam/group_policy_attachments_exclusive.go index 26b05be8cf2..3449cf23aa0 100644 --- a/internal/service/iam/group_policy_attachments_exclusive.go +++ b/internal/service/iam/group_policy_attachments_exclusive.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *groupPolicyAttachmentsExclusiveResource) Read(ctx context.Context, req } out, err := findGroupPolicyAttachmentsByName(ctx, conn, state.GroupName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/iam/group_policy_test.go b/internal/service/iam/group_policy_test.go index 8f62d53f7a7..2a7f49bafa2 100644 --- a/internal/service/iam/group_policy_test.go +++ b/internal/service/iam/group_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckGroupPolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfiam.FindGroupPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["group"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/group_test.go b/internal/service/iam/group_test.go index 7a7f4dcc559..fdb44b391ca 100644 --- a/internal/service/iam/group_test.go +++ b/internal/service/iam/group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/instance_profile.go b/internal/service/iam/instance_profile.go index 00ef97d2e50..eb1a7b51dc4 100644 --- a/internal/service/iam/instance_profile.go +++ b/internal/service/iam/instance_profile.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -161,7 +162,7 @@ func resourceInstanceProfileRead(ctx context.Context, d *schema.ResourceData, me instanceProfile, err := findInstanceProfileByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Instance Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -176,7 +177,7 @@ func resourceInstanceProfileRead(ctx context.Context, d *schema.ResourceData, me _, err := findRoleByName(ctx, conn, roleName) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { err := instanceProfileRemoveRole(ctx, conn, d.Id(), roleName) if err != nil { @@ -349,7 +350,7 @@ const ( func statusInstanceProfile(ctx context.Context, conn *iam.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := findInstanceProfileByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/iam/instance_profile_test.go b/internal/service/iam/instance_profile_test.go index 27e0c9ddc57..2722c02542b 100644 --- a/internal/service/iam/instance_profile_test.go +++ b/internal/service/iam/instance_profile_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -267,7 +267,7 @@ func testAccCheckInstanceProfileDestroy(ctx context.Context) resource.TestCheckF _, err := tfiam.FindInstanceProfileByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/openid_connect_provider.go b/internal/service/iam/openid_connect_provider.go index 624d7dfae26..bfd193ae786 100644 --- a/internal/service/iam/openid_connect_provider.go +++ b/internal/service/iam/openid_connect_provider.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -123,7 +124,7 @@ func resourceOpenIDConnectProviderRead(ctx context.Context, d *schema.ResourceDa output, err := findOpenIDConnectProviderByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM OIDC Provider (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/openid_connect_provider_test.go b/internal/service/iam/openid_connect_provider_test.go index faec1cc3aa1..d7db3849c6c 100644 --- a/internal/service/iam/openid_connect_provider_test.go +++ b/internal/service/iam/openid_connect_provider_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -307,7 +307,7 @@ func testAccCheckOpenIDConnectProviderDestroy(ctx context.Context) resource.Test _, err := tfiam.FindOpenIDConnectProviderByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/organizations_features.go b/internal/service/iam/organizations_features.go index 99763ecbb3e..727065a9c23 100644 --- a/internal/service/iam/organizations_features.go +++ b/internal/service/iam/organizations_features.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -95,7 +96,7 @@ func (r *organizationsFeaturesResource) Read(ctx context.Context, request resour output, err := findOrganizationsFeatures(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/iam/organizations_features_test.go b/internal/service/iam/organizations_features_test.go index 38088d23dc1..18b75195f00 100644 --- a/internal/service/iam/organizations_features_test.go +++ b/internal/service/iam/organizations_features_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func testAccCheckOrganizationsFeaturesDestroy(ctx context.Context) resource.Test _, err := tfiam.FindOrganizationsFeatures(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/policy.go b/internal/service/iam/policy.go index 9124470ea11..5a3142563f4 100644 --- a/internal/service/iam/policy.go +++ b/internal/service/iam/policy.go @@ -199,7 +199,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d return iamPolicy, nil }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -257,7 +257,7 @@ func resourcePolicyDelete(ctx context.Context, d *schema.ResourceData, meta any) // Delete non-default policy versions. versions, err := findPolicyVersionsByARN(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/iam/policy_attachment.go b/internal/service/iam/policy_attachment.go index 77b92dc7ddf..7b234716a4e 100644 --- a/internal/service/iam/policy_attachment.go +++ b/internal/service/iam/policy_attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -105,7 +106,7 @@ func resourcePolicyAttachmentRead(ctx context.Context, d *schema.ResourceData, m policyARN := d.Get("policy_arn").(string) groups, roles, users, err := findEntitiesForPolicyByARN(ctx, conn, policyARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Policy Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/policy_attachment_test.go b/internal/service/iam/policy_attachment_test.go index 43f054b2f1a..f47d1d2ff13 100644 --- a/internal/service/iam/policy_attachment_test.go +++ b/internal/service/iam/policy_attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckPolicyAttachmentDestroy(ctx context.Context) resource.TestCheck _, _, _, err := tfiam.FindEntitiesForPolicyByARN(ctx, conn, rs.Primary.Attributes["policy_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/policy_test.go b/internal/service/iam/policy_test.go index d5671e3d14e..70f8313ffe9 100644 --- a/internal/service/iam/policy_test.go +++ b/internal/service/iam/policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -452,7 +452,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindPolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/role.go b/internal/service/iam/role.go index 9a7e8d44919..332f4ac327b 100644 --- a/internal/service/iam/role.go +++ b/internal/service/iam/role.go @@ -312,7 +312,7 @@ func resourceRoleRead(ctx context.Context, d *schema.ResourceData, meta any) dia return findRoleByName(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Role (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -534,7 +534,7 @@ func deleteRole(ctx context.Context, conn *iam.Client, roleName string, forceDet policyARNs, err := findRoleAttachedPolicies(ctx, conn, roleName) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return fmt.Errorf("reading IAM Policies attached to Role (%s): %w", roleName, err) default: @@ -548,7 +548,7 @@ func deleteRole(ctx context.Context, conn *iam.Client, roleName string, forceDet inlinePolicies, err := findRolePolicyNames(ctx, conn, roleName) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return fmt.Errorf("reading IAM Role (%s) inline policies: %w", roleName, err) default: @@ -576,7 +576,7 @@ func deleteRole(ctx context.Context, conn *iam.Client, roleName string, forceDet func deleteRoleInstanceProfiles(ctx context.Context, conn *iam.Client, roleName string) error { instanceProfiles, err := findInstanceProfilesForRole(ctx, conn, roleName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } @@ -673,7 +673,7 @@ func statusRoleCreate(conn *iam.Client, id string) retry.StateRefreshFunc { return func(ctx context.Context) (any, string, error) { role, err := findRoleByName(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, roleNotFoundState, nil } diff --git a/internal/service/iam/role_policies_exclusive.go b/internal/service/iam/role_policies_exclusive.go index 21243ffa6e0..130891c7eb6 100644 --- a/internal/service/iam/role_policies_exclusive.go +++ b/internal/service/iam/role_policies_exclusive.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *rolePoliciesExclusiveResource) Read(ctx context.Context, req resource.R } out, err := findRolePoliciesByName(ctx, conn, state.RoleName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/iam/role_policy.go b/internal/service/iam/role_policy.go index f042d21d704..9401508d043 100644 --- a/internal/service/iam/role_policy.go +++ b/internal/service/iam/role_policy.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -132,7 +133,7 @@ func resourceRolePolicyRead(ctx context.Context, d *schema.ResourceData, meta an policyDocument, err := findRolePolicyByTwoPartKey(ctx, conn, roleName, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Role Policy %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/role_policy_attachment.go b/internal/service/iam/role_policy_attachment.go index bb65aaffbeb..8b56581d9f0 100644 --- a/internal/service/iam/role_policy_attachment.go +++ b/internal/service/iam/role_policy_attachment.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -98,7 +99,7 @@ func resourceRolePolicyAttachmentRead(ctx context.Context, d *schema.ResourceDat return findAttachedRolePolicyByTwoPartKey(ctx, conn, role, policyARN) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Role Policy Attachment (%s) not found, removing from state", id) d.SetId("") return diags diff --git a/internal/service/iam/role_policy_attachment_test.go b/internal/service/iam/role_policy_attachment_test.go index e99ca6a3276..5275891fd0d 100644 --- a/internal/service/iam/role_policy_attachment_test.go +++ b/internal/service/iam/role_policy_attachment_test.go @@ -17,9 +17,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func testAccCheckRolePolicyAttachmentDestroy(ctx context.Context) resource.TestC _, err := tfiam.FindAttachedRolePolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrRole], rs.Primary.Attributes["policy_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/role_policy_attachments_exclusive.go b/internal/service/iam/role_policy_attachments_exclusive.go index d67f4541d94..d44c82fdded 100644 --- a/internal/service/iam/role_policy_attachments_exclusive.go +++ b/internal/service/iam/role_policy_attachments_exclusive.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *rolePolicyAttachmentsExclusiveResource) Read(ctx context.Context, req r } out, err := findRolePolicyAttachmentsByName(ctx, conn, state.RoleName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/iam/role_policy_test.go b/internal/service/iam/role_policy_test.go index 45e0f31bd3e..acf8aa5ebaf 100644 --- a/internal/service/iam/role_policy_test.go +++ b/internal/service/iam/role_policy_test.go @@ -22,8 +22,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -313,7 +313,7 @@ func testAccCheckRolePolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfiam.FindRolePolicyByTwoPartKey(ctx, conn, roleName, policyName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/role_test.go b/internal/service/iam/role_test.go index b5c4b830ad7..6e70484fdef 100644 --- a/internal/service/iam/role_test.go +++ b/internal/service/iam/role_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1052,7 +1052,7 @@ func testAccCheckRoleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindRoleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/saml_provider.go b/internal/service/iam/saml_provider.go index 869b82c6285..81c16e7a588 100644 --- a/internal/service/iam/saml_provider.go +++ b/internal/service/iam/saml_provider.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -116,7 +117,7 @@ func resourceSAMLProviderRead(ctx context.Context, d *schema.ResourceData, meta output, err := findSAMLProviderByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM SAML Provider %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/saml_provider_test.go b/internal/service/iam/saml_provider_test.go index f7e3eca4ff1..0f8d98f04fe 100644 --- a/internal/service/iam/saml_provider_test.go +++ b/internal/service/iam/saml_provider_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func testAccCheckSAMLProviderDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfiam.FindSAMLProviderByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/server_certificate.go b/internal/service/iam/server_certificate.go index c69f4f7c4b9..6fc1ec2cf6b 100644 --- a/internal/service/iam/server_certificate.go +++ b/internal/service/iam/server_certificate.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -167,7 +168,7 @@ func resourceServerCertificateRead(ctx context.Context, d *schema.ResourceData, cert, err := findServerCertificateByName(ctx, conn, d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Server Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/server_certificate_test.go b/internal/service/iam/server_certificate_test.go index 9adb4414b51..a319a27b291 100644 --- a/internal/service/iam/server_certificate_test.go +++ b/internal/service/iam/server_certificate_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -311,7 +311,7 @@ func testAccCheckServerCertificateDestroy(ctx context.Context) resource.TestChec _, err := tfiam.FindServerCertificateByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/service_linked_role.go b/internal/service/iam/service_linked_role.go index 46c5961a171..af894838660 100644 --- a/internal/service/iam/service_linked_role.go +++ b/internal/service/iam/service_linked_role.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -149,7 +150,7 @@ func resourceServiceLinkedRoleRead(ctx context.Context, d *schema.ResourceData, return findRoleByName(ctx, conn, roleName) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Service Linked Role (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -272,7 +273,7 @@ func statusServiceLinkedRoleDeletion(ctx context.Context, conn *iam.Client, id s return func() (any, string, error) { output, err := findServiceLinkedRoleDeletionStatusByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/iam/service_linked_role_test.go b/internal/service/iam/service_linked_role_test.go index 76ba8e86e90..43ab7ccb916 100644 --- a/internal/service/iam/service_linked_role_test.go +++ b/internal/service/iam/service_linked_role_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -266,7 +266,7 @@ func testAccCheckServiceLinkedRoleDestroy(ctx context.Context) resource.TestChec _, err = tfiam.FindRoleByName(ctx, conn, roleName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/service_specific_credential.go b/internal/service/iam/service_specific_credential.go index 9d1d21eb61e..c06755b208d 100644 --- a/internal/service/iam/service_specific_credential.go +++ b/internal/service/iam/service_specific_credential.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -153,7 +154,7 @@ func resourceServiceSpecificCredentialRead(ctx context.Context, d *schema.Resour return findServiceSpecificCredentialByThreePartKey(ctx, conn, serviceName, userName, credID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Service Specific Credential (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/service_specific_credential_test.go b/internal/service/iam/service_specific_credential_test.go index 42c476db1d6..ddc7c41e392 100644 --- a/internal/service/iam/service_specific_credential_test.go +++ b/internal/service/iam/service_specific_credential_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -195,7 +195,7 @@ func testAccCheckServiceSpecificCredentialDestroy(ctx context.Context) resource. output, err := tfiam.FindServiceSpecificCredentialByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrServiceName], rs.Primary.Attributes[names.AttrUserName], rs.Primary.Attributes["service_specific_credential_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/session_context_data_source.go b/internal/service/iam/session_context_data_source.go index e343c8b06e0..95d246c615f 100644 --- a/internal/service/iam/session_context_data_source.go +++ b/internal/service/iam/session_context_data_source.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -77,7 +78,7 @@ func dataSourceSessionContextRead(ctx context.Context, d *schema.ResourceData, m role, err = findRoleByName(ctx, conn, roleName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { return tfresource.RetryableError(err) } diff --git a/internal/service/iam/signing_certificate.go b/internal/service/iam/signing_certificate.go index 1090294d78f..4d5baf890b6 100644 --- a/internal/service/iam/signing_certificate.go +++ b/internal/service/iam/signing_certificate.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -113,7 +114,7 @@ func resourceSigningCertificateRead(ctx context.Context, d *schema.ResourceData, return findSigningCertificateByTwoPartKey(ctx, conn, userName, certID) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Signing Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/signing_certificate_test.go b/internal/service/iam/signing_certificate_test.go index a1b0d6fd3e6..6ccc23c66f9 100644 --- a/internal/service/iam/signing_certificate_test.go +++ b/internal/service/iam/signing_certificate_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckSigningCertificateDestroy(ctx context.Context) resource.TestChe output, err := tfiam.FindSigningCertificateByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrUserName], rs.Primary.Attributes["certificate_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/user.go b/internal/service/iam/user.go index 6ce14d2b4eb..651f6abc501 100644 --- a/internal/service/iam/user.go +++ b/internal/service/iam/user.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -144,7 +145,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia return findUserByName(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM User (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -470,7 +471,7 @@ func deleteUserLoginProfile(ctx context.Context, conn *iam.Client, user string) func deleteUserAccessKeys(ctx context.Context, conn *iam.Client, user string) error { accessKeys, err := findAccessKeysByUser(ctx, conn, user) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return fmt.Errorf("listing IAM User (%s) access keys: %w", user, err) } diff --git a/internal/service/iam/user_policies_exclusive.go b/internal/service/iam/user_policies_exclusive.go index 52f5384fba4..fb1505a9607 100644 --- a/internal/service/iam/user_policies_exclusive.go +++ b/internal/service/iam/user_policies_exclusive.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *userPoliciesExclusiveResource) Read(ctx context.Context, req resource.R } out, err := findUserPoliciesByName(ctx, conn, state.UserName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/iam/user_policy.go b/internal/service/iam/user_policy.go index 9b7826f6974..53962721c36 100644 --- a/internal/service/iam/user_policy.go +++ b/internal/service/iam/user_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -120,7 +121,7 @@ func resourceUserPolicyRead(ctx context.Context, d *schema.ResourceData, meta an policyDocument, err := findUserPolicyByTwoPartKey(ctx, conn, userName, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM User Policy %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/user_policy_attachment.go b/internal/service/iam/user_policy_attachment.go index 8bb8d00e662..428ea30ebf8 100644 --- a/internal/service/iam/user_policy_attachment.go +++ b/internal/service/iam/user_policy_attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -81,7 +82,7 @@ func resourceUserPolicyAttachmentRead(ctx context.Context, d *schema.ResourceDat return findAttachedUserPolicyByTwoPartKey(ctx, conn, user, policyARN) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM User Policy Attachment (%s) not found, removing from state", id) d.SetId("") return diags diff --git a/internal/service/iam/user_policy_attachment_test.go b/internal/service/iam/user_policy_attachment_test.go index f38462af42e..dc08e2958f5 100644 --- a/internal/service/iam/user_policy_attachment_test.go +++ b/internal/service/iam/user_policy_attachment_test.go @@ -17,9 +17,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func testAccCheckUserPolicyAttachmentDestroy(ctx context.Context) resource.TestC _, err := tfiam.FindAttachedUserPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["user"], rs.Primary.Attributes["policy_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/user_policy_attachments_exclusive.go b/internal/service/iam/user_policy_attachments_exclusive.go index 6b345814d9a..7bfa9009250 100644 --- a/internal/service/iam/user_policy_attachments_exclusive.go +++ b/internal/service/iam/user_policy_attachments_exclusive.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *userPolicyAttachmentsExclusiveResource) Read(ctx context.Context, req r } out, err := findUserPolicyAttachmentsByName(ctx, conn, state.UserName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/iam/user_policy_test.go b/internal/service/iam/user_policy_test.go index 26ef64f7712..0af85dae66d 100644 --- a/internal/service/iam/user_policy_test.go +++ b/internal/service/iam/user_policy_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -272,7 +272,7 @@ func testAccCheckUserPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindUserPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["user"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/user_ssh_key.go b/internal/service/iam/user_ssh_key.go index 2b335d1d350..e67fa526a6c 100644 --- a/internal/service/iam/user_ssh_key.go +++ b/internal/service/iam/user_ssh_key.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +127,7 @@ func resourceUserSSHKeyRead(ctx context.Context, d *schema.ResourceData, meta an encoding := d.Get("encoding").(string) key, err := findSSHPublicKeyByThreePartKey(ctx, conn, d.Id(), encoding, d.Get(names.AttrUsername).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM User SSH Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/user_ssh_key_test.go b/internal/service/iam/user_ssh_key_test.go index 17a5ed5c946..7d443d9f6f9 100644 --- a/internal/service/iam/user_ssh_key_test.go +++ b/internal/service/iam/user_ssh_key_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func testAccCheckUserSSHKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindSSHPublicKeyByThreePartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["encoding"], rs.Primary.Attributes[names.AttrUsername]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/user_test.go b/internal/service/iam/user_test.go index 8bcd410949b..178a717f6aa 100644 --- a/internal/service/iam/user_test.go +++ b/internal/service/iam/user_test.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -533,7 +534,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiam.FindUserByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iam/virtual_mfa_device.go b/internal/service/iam/virtual_mfa_device.go index 9b83c0fec23..8c35355ed02 100644 --- a/internal/service/iam/virtual_mfa_device.go +++ b/internal/service/iam/virtual_mfa_device.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -139,7 +140,7 @@ func resourceVirtualMFADeviceRead(ctx context.Context, d *schema.ResourceData, m vMFA, err := findVirtualMFADeviceBySerialNumber(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IAM Virtual MFA Device (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iam/virtual_mfa_device_test.go b/internal/service/iam/virtual_mfa_device_test.go index ee0e3111b57..ea01646b8c2 100644 --- a/internal/service/iam/virtual_mfa_device_test.go +++ b/internal/service/iam/virtual_mfa_device_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func testAccCheckVirtualMFADeviceDestroy(ctx context.Context) resource.TestCheck output, err := tfiam.FindVirtualMFADeviceBySerialNumber(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 391a9e4de8b8a4e0a807279a8c4b19b3c6412797 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:38 -0800 Subject: [PATCH 105/227] `identitystore` --- internal/service/identitystore/group.go | 3 ++- internal/service/identitystore/group_membership.go | 3 ++- internal/service/identitystore/group_membership_test.go | 4 ++-- internal/service/identitystore/group_test.go | 4 ++-- internal/service/identitystore/user.go | 3 ++- internal/service/identitystore/user_test.go | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/internal/service/identitystore/group.go b/internal/service/identitystore/group.go index 02071b88200..4e73c66a52b 100644 --- a/internal/service/identitystore/group.go +++ b/internal/service/identitystore/group.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +118,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di out, err := findGroupByTwoPartKey(ctx, conn, identityStoreID, groupID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IdentityStore Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/identitystore/group_membership.go b/internal/service/identitystore/group_membership.go index 979789b5aa1..729fad8378e 100644 --- a/internal/service/identitystore/group_membership.go +++ b/internal/service/identitystore/group_membership.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -93,7 +94,7 @@ func resourceGroupMembershipRead(ctx context.Context, d *schema.ResourceData, me out, err := findGroupMembershipByTwoPartKey(ctx, conn, identityStoreID, membershipID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IdentityStore Group Membership (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/identitystore/group_membership_test.go b/internal/service/identitystore/group_membership_test.go index 06e5840e4fa..df60e27c3eb 100644 --- a/internal/service/identitystore/group_membership_test.go +++ b/internal/service/identitystore/group_membership_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfidentitystore "github.com/hashicorp/terraform-provider-aws/internal/service/identitystore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -181,7 +181,7 @@ func testAccCheckGroupMembershipDestroy(ctx context.Context) resource.TestCheckF _, err := tfidentitystore.FindGroupMembershipByTwoPartKey(ctx, conn, rs.Primary.Attributes["identity_store_id"], rs.Primary.Attributes["membership_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/identitystore/group_test.go b/internal/service/identitystore/group_test.go index 5faf9223b18..7c4e3b5bd22 100644 --- a/internal/service/identitystore/group_test.go +++ b/internal/service/identitystore/group_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfidentitystore "github.com/hashicorp/terraform-provider-aws/internal/service/identitystore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -200,7 +200,7 @@ func testAccCheckGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfidentitystore.FindGroupByTwoPartKey(ctx, conn, rs.Primary.Attributes["identity_store_id"], rs.Primary.Attributes["group_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/identitystore/user.go b/internal/service/identitystore/user.go index e9933523c9b..81e40fdf018 100644 --- a/internal/service/identitystore/user.go +++ b/internal/service/identitystore/user.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -326,7 +327,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia out, err := findUserByTwoPartKey(ctx, conn, identityStoreID, userID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IdentityStore User (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/identitystore/user_test.go b/internal/service/identitystore/user_test.go index 01a203dde4c..dff2f564318 100644 --- a/internal/service/identitystore/user_test.go +++ b/internal/service/identitystore/user_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfidentitystore "github.com/hashicorp/terraform-provider-aws/internal/service/identitystore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -986,7 +986,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfidentitystore.FindUserByTwoPartKey(ctx, conn, rs.Primary.Attributes["identity_store_id"], rs.Primary.Attributes["user_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From ecaf8a2ce3f23b63832e3fe27459257fb82b54f7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:38 -0800 Subject: [PATCH 106/227] `imagebuilder` --- internal/service/imagebuilder/component.go | 3 ++- internal/service/imagebuilder/component_test.go | 4 ++-- internal/service/imagebuilder/container_recipe.go | 3 ++- internal/service/imagebuilder/container_recipe_test.go | 4 ++-- internal/service/imagebuilder/distribution_configuration.go | 3 ++- .../service/imagebuilder/distribution_configuration_test.go | 4 ++-- internal/service/imagebuilder/image.go | 5 +++-- internal/service/imagebuilder/image_pipeline.go | 3 ++- internal/service/imagebuilder/image_pipeline_test.go | 4 ++-- internal/service/imagebuilder/image_recipe.go | 3 ++- internal/service/imagebuilder/image_recipe_test.go | 4 ++-- internal/service/imagebuilder/image_test.go | 4 ++-- .../service/imagebuilder/infrastructure_configuration.go | 3 ++- .../imagebuilder/infrastructure_configuration_test.go | 4 ++-- internal/service/imagebuilder/lifecycle_policy.go | 3 ++- internal/service/imagebuilder/lifecycle_policy_test.go | 4 ++-- internal/service/imagebuilder/workflow.go | 3 ++- internal/service/imagebuilder/workflow_test.go | 4 ++-- 18 files changed, 37 insertions(+), 28 deletions(-) diff --git a/internal/service/imagebuilder/component.go b/internal/service/imagebuilder/component.go index 79c716cb47a..e2fbf14d206 100644 --- a/internal/service/imagebuilder/component.go +++ b/internal/service/imagebuilder/component.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -193,7 +194,7 @@ func resourceComponentRead(ctx context.Context, d *schema.ResourceData, meta any component, err := findComponentByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Component (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/component_test.go b/internal/service/imagebuilder/component_test.go index 3079773d142..655d78d0a7c 100644 --- a/internal/service/imagebuilder/component_test.go +++ b/internal/service/imagebuilder/component_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -309,7 +309,7 @@ func testAccCheckComponentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfimagebuilder.FindComponentByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/container_recipe.go b/internal/service/imagebuilder/container_recipe.go index 85720b49ab6..987e098a49f 100644 --- a/internal/service/imagebuilder/container_recipe.go +++ b/internal/service/imagebuilder/container_recipe.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -369,7 +370,7 @@ func resourceContainerRecipeRead(ctx context.Context, d *schema.ResourceData, me containerRecipe, err := findContainerRecipeByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Container Recipe (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/container_recipe_test.go b/internal/service/imagebuilder/container_recipe_test.go index 4ffd2b3df4d..df8a6d04b1c 100644 --- a/internal/service/imagebuilder/container_recipe_test.go +++ b/internal/service/imagebuilder/container_recipe_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -704,7 +704,7 @@ func testAccCheckContainerRecipeDestroy(ctx context.Context) resource.TestCheckF _, err := tfimagebuilder.FindContainerRecipeByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/distribution_configuration.go b/internal/service/imagebuilder/distribution_configuration.go index 09c83b009e4..815604cdcca 100644 --- a/internal/service/imagebuilder/distribution_configuration.go +++ b/internal/service/imagebuilder/distribution_configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -383,7 +384,7 @@ func resourceDistributionConfigurationRead(ctx context.Context, d *schema.Resour distributionConfiguration, err := findDistributionConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Distribution Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/distribution_configuration_test.go b/internal/service/imagebuilder/distribution_configuration_test.go index 136c3a2c267..89cccf0adbf 100644 --- a/internal/service/imagebuilder/distribution_configuration_test.go +++ b/internal/service/imagebuilder/distribution_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1249,7 +1249,7 @@ func testAccCheckDistributionConfigurationDestroy(ctx context.Context) resource. _, err := tfimagebuilder.FindDistributionConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/image.go b/internal/service/imagebuilder/image.go index 5e5b17755be..8bbf62ece1c 100644 --- a/internal/service/imagebuilder/image.go +++ b/internal/service/imagebuilder/image.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -336,7 +337,7 @@ func resourceImageRead(ctx context.Context, d *schema.ResourceData, meta any) di image, err := findImageByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Image (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -457,7 +458,7 @@ func statusImage(ctx context.Context, conn *imagebuilder.Client, arn string) sdk return func() (any, string, error) { output, err := findImageByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, string(awstypes.ImageStatusPending), nil } diff --git a/internal/service/imagebuilder/image_pipeline.go b/internal/service/imagebuilder/image_pipeline.go index 2445b2c5ac9..ee15af32f92 100644 --- a/internal/service/imagebuilder/image_pipeline.go +++ b/internal/service/imagebuilder/image_pipeline.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -319,7 +320,7 @@ func resourceImagePipelineRead(ctx context.Context, d *schema.ResourceData, meta imagePipeline, err := findImagePipelineByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Image Pipeline (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/image_pipeline_test.go b/internal/service/imagebuilder/image_pipeline_test.go index 420dd018f7b..13a4b265c22 100644 --- a/internal/service/imagebuilder/image_pipeline_test.go +++ b/internal/service/imagebuilder/image_pipeline_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -728,7 +728,7 @@ func testAccCheckImagePipelineDestroy(ctx context.Context) resource.TestCheckFun _, err := tfimagebuilder.FindImagePipelineByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/image_recipe.go b/internal/service/imagebuilder/image_recipe.go index 911d57a68c6..be51a9ea257 100644 --- a/internal/service/imagebuilder/image_recipe.go +++ b/internal/service/imagebuilder/image_recipe.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -319,7 +320,7 @@ func resourceImageRecipeRead(ctx context.Context, d *schema.ResourceData, meta a imageRecipe, err := findImageRecipeByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Image Recipe (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/image_recipe_test.go b/internal/service/imagebuilder/image_recipe_test.go index 1820ed2103a..28588641ab5 100644 --- a/internal/service/imagebuilder/image_recipe_test.go +++ b/internal/service/imagebuilder/image_recipe_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -836,7 +836,7 @@ func testAccCheckImageRecipeDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfimagebuilder.FindImageRecipeByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/image_test.go b/internal/service/imagebuilder/image_test.go index 6a3430b2f12..60b9c31410f 100644 --- a/internal/service/imagebuilder/image_test.go +++ b/internal/service/imagebuilder/image_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -358,7 +358,7 @@ func testAccCheckImageDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfimagebuilder.FindImageByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/infrastructure_configuration.go b/internal/service/imagebuilder/infrastructure_configuration.go index fa59a3a1deb..88f796ed2e3 100644 --- a/internal/service/imagebuilder/infrastructure_configuration.go +++ b/internal/service/imagebuilder/infrastructure_configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -273,7 +274,7 @@ func resourceInfrastructureConfigurationRead(ctx context.Context, d *schema.Reso infrastructureConfiguration, err := findInfrastructureConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Infrastructure Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/infrastructure_configuration_test.go b/internal/service/imagebuilder/infrastructure_configuration_test.go index b3f235bfc23..40ac6b37661 100644 --- a/internal/service/imagebuilder/infrastructure_configuration_test.go +++ b/internal/service/imagebuilder/infrastructure_configuration_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -623,7 +623,7 @@ func testAccCheckInfrastructureConfigurationDestroy(ctx context.Context) resourc _, err := tfimagebuilder.FindInfrastructureConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/lifecycle_policy.go b/internal/service/imagebuilder/lifecycle_policy.go index 26b74b6605d..5235041e441 100644 --- a/internal/service/imagebuilder/lifecycle_policy.go +++ b/internal/service/imagebuilder/lifecycle_policy.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -366,7 +367,7 @@ func (r *lifecyclePolicyResource) Read(ctx context.Context, request resource.Rea policy, err := findLifecyclePolicyByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/imagebuilder/lifecycle_policy_test.go b/internal/service/imagebuilder/lifecycle_policy_test.go index f31c54b2c79..d83d7941222 100644 --- a/internal/service/imagebuilder/lifecycle_policy_test.go +++ b/internal/service/imagebuilder/lifecycle_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -305,7 +305,7 @@ func testAccCheckLifecyclePolicyDestroy(ctx context.Context) resource.TestCheckF _, err := tfimagebuilder.FindLifecyclePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/imagebuilder/workflow.go b/internal/service/imagebuilder/workflow.go index 160b44188f9..9d98d7f25e1 100644 --- a/internal/service/imagebuilder/workflow.go +++ b/internal/service/imagebuilder/workflow.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -155,7 +156,7 @@ func resourceWorkflowRead(ctx context.Context, d *schema.ResourceData, meta any) workflow, err := findWorkflowByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Image Builder Workflow (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/imagebuilder/workflow_test.go b/internal/service/imagebuilder/workflow_test.go index 018542b1621..41f0cf934d3 100644 --- a/internal/service/imagebuilder/workflow_test.go +++ b/internal/service/imagebuilder/workflow_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -247,7 +247,7 @@ func testAccCheckWorkflowDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfimagebuilder.FindWorkflowByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From aebe9faf4d56a2f0dcdad7fecc5efa4778f3ca31 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:39 -0800 Subject: [PATCH 107/227] `inspector2` --- internal/service/inspector2/delegated_admin_account.go | 5 +++-- internal/service/inspector2/delegated_admin_account_test.go | 4 ++-- internal/service/inspector2/enabler.go | 5 +++-- internal/service/inspector2/enabler_test.go | 4 ++-- internal/service/inspector2/filter.go | 3 ++- internal/service/inspector2/filter_test.go | 4 ++-- internal/service/inspector2/member_association.go | 5 +++-- internal/service/inspector2/member_association_test.go | 4 ++-- internal/service/inspector2/organization_configuration.go | 3 ++- .../service/inspector2/organization_configuration_test.go | 4 ++-- 10 files changed, 23 insertions(+), 18 deletions(-) diff --git a/internal/service/inspector2/delegated_admin_account.go b/internal/service/inspector2/delegated_admin_account.go index a59f7db3181..3d90c83fab7 100644 --- a/internal/service/inspector2/delegated_admin_account.go +++ b/internal/service/inspector2/delegated_admin_account.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -87,7 +88,7 @@ func resourceDelegatedAdminAccountRead(ctx context.Context, d *schema.ResourceDa output, err := findDelegatedAdminAccountByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Inspector2 Delegated Admin Account (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -190,7 +191,7 @@ func statusDelegatedAdminAccount(ctx context.Context, conn *inspector2.Client, a return func() (any, string, error) { output, err := findDelegatedAdminAccountByID(ctx, conn, accountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/inspector2/delegated_admin_account_test.go b/internal/service/inspector2/delegated_admin_account_test.go index 1764d9bf93d..9013c058ff2 100644 --- a/internal/service/inspector2/delegated_admin_account_test.go +++ b/internal/service/inspector2/delegated_admin_account_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfinspector2 "github.com/hashicorp/terraform-provider-aws/internal/service/inspector2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +107,7 @@ func testAccCheckDelegatedAdminAccountDestroy(ctx context.Context) resource.Test _, err := tfinspector2.FindDelegatedAdminAccountByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/inspector2/enabler.go b/internal/service/inspector2/enabler.go index f81fcca4ba1..171574796e4 100644 --- a/internal/service/inspector2/enabler.go +++ b/internal/service/inspector2/enabler.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -203,7 +204,7 @@ func resourceEnablerRead(ctx context.Context, d *schema.ResourceData, meta any) } s, err := AccountStatuses(ctx, conn, accountIDs) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Inspector2 Enabler (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -506,7 +507,7 @@ func statusEnablerAccountAndResourceTypes(ctx context.Context, conn *inspector2. func statusEnablerAccount(ctx context.Context, conn *inspector2.Client, accountIDs []string) sdkretry.StateRefreshFunc { return func() (any, string, error) { st, err := AccountStatuses(ctx, conn, accountIDs) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/inspector2/enabler_test.go b/internal/service/inspector2/enabler_test.go index 3a814696350..b5a19c509eb 100644 --- a/internal/service/inspector2/enabler_test.go +++ b/internal/service/inspector2/enabler_test.go @@ -19,9 +19,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfinspector2 "github.com/hashicorp/terraform-provider-aws/internal/service/inspector2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -601,7 +601,7 @@ func testAccCheckEnablerDestroy(ctx context.Context) resource.TestCheckFunc { } st, err := tfinspector2.AccountStatuses(ctx, conn, accountIDs) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } if err != nil { diff --git a/internal/service/inspector2/filter.go b/internal/service/inspector2/filter.go index 14bb9945781..cc6ad45abee 100644 --- a/internal/service/inspector2/filter.go +++ b/internal/service/inspector2/filter.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -425,7 +426,7 @@ func (r *filterResource) Read(ctx context.Context, request resource.ReadRequest, output, err := findFilterByARN(ctx, conn, data.ARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/inspector2/filter_test.go b/internal/service/inspector2/filter_test.go index 4d1552c57c6..a5fda3c03f6 100644 --- a/internal/service/inspector2/filter_test.go +++ b/internal/service/inspector2/filter_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfinspector2 "github.com/hashicorp/terraform-provider-aws/internal/service/inspector2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -772,7 +772,7 @@ func testAccCheckFilterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfinspector2.FindFilterByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/inspector2/member_association.go b/internal/service/inspector2/member_association.go index 198f5d0ca70..d314feedd7d 100644 --- a/internal/service/inspector2/member_association.go +++ b/internal/service/inspector2/member_association.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -92,7 +93,7 @@ func resourceMemberAssociationRead(ctx context.Context, d *schema.ResourceData, member, err := findMemberByAccountID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Inspector2 Member Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -180,7 +181,7 @@ func statusMemberAssociation(ctx context.Context, conn *inspector2.Client, id st return func() (any, string, error) { output, err := findMemberByAccountID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/inspector2/member_association_test.go b/internal/service/inspector2/member_association_test.go index 6eaafd756c1..1ffc1ed4652 100644 --- a/internal/service/inspector2/member_association_test.go +++ b/internal/service/inspector2/member_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfinspector2 "github.com/hashicorp/terraform-provider-aws/internal/service/inspector2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +107,7 @@ func testAccCheckMemberAssociationDestroy(ctx context.Context) resource.TestChec _, err := tfinspector2.FindMemberByAccountID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/inspector2/organization_configuration.go b/internal/service/inspector2/organization_configuration.go index b06fdfd042b..e7209222362 100644 --- a/internal/service/inspector2/organization_configuration.go +++ b/internal/service/inspector2/organization_configuration.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -94,7 +95,7 @@ func resourceOrganizationConfigurationRead(ctx context.Context, d *schema.Resour output, err := findOrganizationConfiguration(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Inspector2 Organization Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index 29fbb58e538..4eb823673ea 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfinspector2 "github.com/hashicorp/terraform-provider-aws/internal/service/inspector2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -197,7 +197,7 @@ func testAccCheckOrganizationConfigurationDestroy(ctx context.Context) resource. _, err := tfinspector2.FindOrganizationConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8eae8ca5945dbd119a05db1743fb1ab7988f2ba8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:40 -0800 Subject: [PATCH 108/227] `internetmonitor` --- internal/service/internetmonitor/monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/internetmonitor/monitor.go b/internal/service/internetmonitor/monitor.go index 7985de91c0c..4e979277166 100644 --- a/internal/service/internetmonitor/monitor.go +++ b/internal/service/internetmonitor/monitor.go @@ -370,7 +370,7 @@ func statusMonitor(conn *internetmonitor.Client, name string) retry.StateRefresh return func(ctx context.Context) (any, string, error) { monitor, err := findMonitorByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 657adfbbccbb99bdefa8317fb804ee14ab55768f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:41 -0800 Subject: [PATCH 109/227] `iot` --- internal/service/iot/authorizer.go | 3 ++- internal/service/iot/authorizer_test.go | 4 ++-- internal/service/iot/billing_group.go | 3 ++- internal/service/iot/billing_group_test.go | 4 ++-- internal/service/iot/ca_certificate.go | 3 ++- internal/service/iot/ca_certificate_test.go | 4 ++-- internal/service/iot/certificate.go | 3 ++- internal/service/iot/certificate_test.go | 4 ++-- internal/service/iot/domain_configuration.go | 3 ++- internal/service/iot/domain_configuration_test.go | 4 ++-- internal/service/iot/event_configurations.go | 3 ++- internal/service/iot/policy.go | 5 +++-- internal/service/iot/policy_attachment.go | 3 ++- internal/service/iot/policy_attachment_test.go | 4 ++-- internal/service/iot/policy_test.go | 4 ++-- internal/service/iot/provisioning_template.go | 3 ++- internal/service/iot/provisioning_template_test.go | 4 ++-- internal/service/iot/role_alias.go | 3 ++- internal/service/iot/role_alias_test.go | 4 ++-- internal/service/iot/thing.go | 3 ++- internal/service/iot/thing_group.go | 3 ++- internal/service/iot/thing_group_membership.go | 3 ++- internal/service/iot/thing_group_membership_test.go | 4 ++-- internal/service/iot/thing_group_test.go | 4 ++-- internal/service/iot/thing_principal_attachment.go | 3 ++- internal/service/iot/thing_principal_attachment_test.go | 4 ++-- internal/service/iot/thing_test.go | 4 ++-- internal/service/iot/thing_type.go | 3 ++- internal/service/iot/thing_type_test.go | 4 ++-- internal/service/iot/topic_rule.go | 3 ++- internal/service/iot/topic_rule_destination.go | 5 +++-- internal/service/iot/topic_rule_destination_test.go | 4 ++-- internal/service/iot/topic_rule_test.go | 4 ++-- 33 files changed, 68 insertions(+), 51 deletions(-) diff --git a/internal/service/iot/authorizer.go b/internal/service/iot/authorizer.go index 005d98adb9e..cc9c82f83e1 100644 --- a/internal/service/iot/authorizer.go +++ b/internal/service/iot/authorizer.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -135,7 +136,7 @@ func resourceAuthorizerRead(ctx context.Context, d *schema.ResourceData, meta an authorizer, err := findAuthorizerByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Authorizer (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/authorizer_test.go b/internal/service/iot/authorizer_test.go index bbc28076a03..e984231f157 100644 --- a/internal/service/iot/authorizer_test.go +++ b/internal/service/iot/authorizer_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +238,7 @@ func testAccCheckAuthorizerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindAuthorizerByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/billing_group.go b/internal/service/iot/billing_group.go index 3e8775fe3cf..4be57621dcf 100644 --- a/internal/service/iot/billing_group.go +++ b/internal/service/iot/billing_group.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -153,7 +154,7 @@ func (r *billingGroupResource) Read(ctx context.Context, request resource.ReadRe } out, err := findBillingGroupByName(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } diff --git a/internal/service/iot/billing_group_test.go b/internal/service/iot/billing_group_test.go index 83ddcb57562..0e34601a381 100644 --- a/internal/service/iot/billing_group_test.go +++ b/internal/service/iot/billing_group_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -658,7 +658,7 @@ func testAccCheckBillingGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfiot.FindBillingGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/ca_certificate.go b/internal/service/iot/ca_certificate.go index de8aa41518a..f69ec22e555 100644 --- a/internal/service/iot/ca_certificate.go +++ b/internal/service/iot/ca_certificate.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -179,7 +180,7 @@ func resourceCACertificateRead(ctx context.Context, d *schema.ResourceData, meta output, err := findCACertificateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT CA Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/ca_certificate_test.go b/internal/service/iot/ca_certificate_test.go index fd496e9a124..cc730d0f7e4 100644 --- a/internal/service/iot/ca_certificate_test.go +++ b/internal/service/iot/ca_certificate_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -219,7 +219,7 @@ func testAccCheckCACertificateDestroy(ctx context.Context) resource.TestCheckFun _, err := tfiot.FindCACertificateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/certificate.go b/internal/service/iot/certificate.go index 68115cc5590..6fa62a45c37 100644 --- a/internal/service/iot/certificate.go +++ b/internal/service/iot/certificate.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +151,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findCertificateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/certificate_test.go b/internal/service/iot/certificate_test.go index b33dd91a343..61d00222a4d 100644 --- a/internal/service/iot/certificate_test.go +++ b/internal/service/iot/certificate_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfiot.FindCertificateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/domain_configuration.go b/internal/service/iot/domain_configuration.go index 0042503366d..a35d024b068 100644 --- a/internal/service/iot/domain_configuration.go +++ b/internal/service/iot/domain_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -195,7 +196,7 @@ func resourceDomainConfigurationRead(ctx context.Context, d *schema.ResourceData output, err := findDomainConfigurationByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Domain Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/domain_configuration_test.go b/internal/service/iot/domain_configuration_test.go index b0e4937c096..d14ca16f482 100644 --- a/internal/service/iot/domain_configuration_test.go +++ b/internal/service/iot/domain_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckDomainConfigurationDestroy(ctx context.Context) resource.TestCh _, err := tfiot.FindDomainConfigurationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/event_configurations.go b/internal/service/iot/event_configurations.go index 059015fd1cf..e3710c8092d 100644 --- a/internal/service/iot/event_configurations.go +++ b/internal/service/iot/event_configurations.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -78,7 +79,7 @@ func resourceEventConfigurationsRead(ctx context.Context, d *schema.ResourceData output, err := findEventConfigurations(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Event Configurations (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/policy.go b/internal/service/iot/policy.go index 03cdf608200..cfc62ac2e53 100644 --- a/internal/service/iot/policy.go +++ b/internal/service/iot/policy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -110,7 +111,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findPolicyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -204,7 +205,7 @@ func resourcePolicyDelete(ctx context.Context, d *schema.ResourceData, meta any) policyVersions, err := findPolicyVersionsByName(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/iot/policy_attachment.go b/internal/service/iot/policy_attachment.go index e1ccdbf84e0..1b5e90af607 100644 --- a/internal/service/iot/policy_attachment.go +++ b/internal/service/iot/policy_attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +79,7 @@ func resourcePolicyAttachmentRead(ctx context.Context, d *schema.ResourceData, m _, err = findAttachedPolicyByTwoPartKey(ctx, conn, policyName, target) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Policy Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/policy_attachment_test.go b/internal/service/iot/policy_attachment_test.go index 6ae5dd40657..5d89d5258b9 100644 --- a/internal/service/iot/policy_attachment_test.go +++ b/internal/service/iot/policy_attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -72,7 +72,7 @@ func testAccCheckPolicyAttchmentDestroy(ctx context.Context) resource.TestCheckF _, err := tfiot.FindAttachedPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrPolicy], rs.Primary.Attributes[names.AttrTarget]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/policy_test.go b/internal/service/iot/policy_test.go index b8a0651cf8b..a6a77949a0a 100644 --- a/internal/service/iot/policy_test.go +++ b/internal/service/iot/policy_test.go @@ -18,9 +18,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -254,7 +254,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindPolicyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/provisioning_template.go b/internal/service/iot/provisioning_template.go index e14acf6e7a7..0543747ecf8 100644 --- a/internal/service/iot/provisioning_template.go +++ b/internal/service/iot/provisioning_template.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -175,7 +176,7 @@ func resourceProvisioningTemplateRead(ctx context.Context, d *schema.ResourceDat output, err := findProvisioningTemplateByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Provisioning Template %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/provisioning_template_test.go b/internal/service/iot/provisioning_template_test.go index cf1d26e0cf4..a3f8764c4a1 100644 --- a/internal/service/iot/provisioning_template_test.go +++ b/internal/service/iot/provisioning_template_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -241,7 +241,7 @@ func testAccCheckProvisioningTemplateDestroy(ctx context.Context) resource.TestC _, err := tfiot.FindProvisioningTemplateByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/role_alias.go b/internal/service/iot/role_alias.go index 9a5d9443733..22094d06158 100644 --- a/internal/service/iot/role_alias.go +++ b/internal/service/iot/role_alias.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourceRoleAliasRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findRoleAliasByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Role Alias (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/role_alias_test.go b/internal/service/iot/role_alias_test.go index 958883779d5..20ba1f81f54 100644 --- a/internal/service/iot/role_alias_test.go +++ b/internal/service/iot/role_alias_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +159,7 @@ func testAccCheckRoleAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindRoleAliasByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/thing.go b/internal/service/iot/thing.go index 65c86e0a3b9..b53cb5ae430 100644 --- a/internal/service/iot/thing.go +++ b/internal/service/iot/thing.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +104,7 @@ func resourceThingRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findThingByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Thing (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/thing_group.go b/internal/service/iot/thing_group.go index 37ecfe5bf7b..6acd8fe9e00 100644 --- a/internal/service/iot/thing_group.go +++ b/internal/service/iot/thing_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -158,7 +159,7 @@ func resourceThingGroupRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findThingGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Thing Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/thing_group_membership.go b/internal/service/iot/thing_group_membership.go index 653d7cf4905..45af7743db5 100644 --- a/internal/service/iot/thing_group_membership.go +++ b/internal/service/iot/thing_group_membership.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -90,7 +91,7 @@ func resourceThingGroupMembershipRead(ctx context.Context, d *schema.ResourceDat _, err = findThingGroupMembershipByTwoPartKey(ctx, conn, thingGroupName, thingName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Thing Group Membership (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/thing_group_membership_test.go b/internal/service/iot/thing_group_membership_test.go index 5fc7d6b0283..22e11948492 100644 --- a/internal/service/iot/thing_group_membership_test.go +++ b/internal/service/iot/thing_group_membership_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -179,7 +179,7 @@ func testAccCheckThingGroupMembershipDestroy(ctx context.Context) resource.TestC _, err := tfiot.FindThingGroupMembershipByTwoPartKey(ctx, conn, rs.Primary.Attributes["thing_group_name"], rs.Primary.Attributes["thing_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/thing_group_test.go b/internal/service/iot/thing_group_test.go index 262b3204662..fd876752632 100644 --- a/internal/service/iot/thing_group_test.go +++ b/internal/service/iot/thing_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -234,7 +234,7 @@ func testAccCheckThingGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindThingGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/thing_principal_attachment.go b/internal/service/iot/thing_principal_attachment.go index 14cfe893826..eadc81b6eb7 100644 --- a/internal/service/iot/thing_principal_attachment.go +++ b/internal/service/iot/thing_principal_attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func resourceThingPrincipalAttachmentRead(ctx context.Context, d *schema.Resourc out, err := findThingPrincipalAttachmentByTwoPartKey(ctx, conn, thing, principal) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Thing Principal Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/thing_principal_attachment_test.go b/internal/service/iot/thing_principal_attachment_test.go index 45632a98df3..a4333324b9a 100644 --- a/internal/service/iot/thing_principal_attachment_test.go +++ b/internal/service/iot/thing_principal_attachment_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -153,7 +153,7 @@ func testAccCheckThingPrincipalAttachmentDestroy(ctx context.Context) resource.T _, err := tfiot.FindThingPrincipalAttachmentByTwoPartKey(ctx, conn, rs.Primary.Attributes["thing"], rs.Primary.Attributes[names.AttrPrincipal]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/thing_test.go b/internal/service/iot/thing_test.go index 532d73769ef..9ef36734d0a 100644 --- a/internal/service/iot/thing_test.go +++ b/internal/service/iot/thing_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func testAccCheckThingDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindThingByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/thing_type.go b/internal/service/iot/thing_type.go index d8126190df3..b4a6b4b3ac6 100644 --- a/internal/service/iot/thing_type.go +++ b/internal/service/iot/thing_type.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -135,7 +136,7 @@ func resourceThingTypeRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findThingTypeByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Thing Type (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/thing_type_test.go b/internal/service/iot/thing_type_test.go index 913a2b1d7dd..c02fa3bc29d 100644 --- a/internal/service/iot/thing_type_test.go +++ b/internal/service/iot/thing_type_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -182,7 +182,7 @@ func testAccCheckThingTypeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindThingTypeByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/topic_rule.go b/internal/service/iot/topic_rule.go index d14d36f52c9..102eed85367 100644 --- a/internal/service/iot/topic_rule.go +++ b/internal/service/iot/topic_rule.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -1277,7 +1278,7 @@ func resourceTopicRuleRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findTopicRuleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Topic Rule %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/iot/topic_rule_destination.go b/internal/service/iot/topic_rule_destination.go index de1e53c9c65..f9f5024d4b1 100644 --- a/internal/service/iot/topic_rule_destination.go +++ b/internal/service/iot/topic_rule_destination.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -143,7 +144,7 @@ func resourceTopicRuleDestinationRead(ctx context.Context, d *schema.ResourceDat output, err := findTopicRuleDestinationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IoT Topic Rule Destination %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -279,7 +280,7 @@ func statusTopicRuleDestination(ctx context.Context, conn *iot.Client, arn strin return func() (any, string, error) { output, err := findTopicRuleDestinationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/iot/topic_rule_destination_test.go b/internal/service/iot/topic_rule_destination_test.go index 2212d74baa4..17544e3e2a9 100644 --- a/internal/service/iot/topic_rule_destination_test.go +++ b/internal/service/iot/topic_rule_destination_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func testAccCheckTopicRuleDestinationDestroy(ctx context.Context) resource.TestC _, err := tfiot.FindTopicRuleDestinationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/iot/topic_rule_test.go b/internal/service/iot/topic_rule_test.go index 4952f73ef9e..03183857a20 100644 --- a/internal/service/iot/topic_rule_test.go +++ b/internal/service/iot/topic_rule_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2429,7 +2429,7 @@ func testAccCheckTopicRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfiot.FindTopicRuleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From d0cb81442b620bb17d027b07a763cc3b51752808 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:42 -0800 Subject: [PATCH 110/227] `ivs` --- internal/service/ivs/channel.go | 4 ++-- internal/service/ivs/playback_key_pair.go | 4 ++-- internal/service/ivs/recording_configuration.go | 4 ++-- internal/service/ivs/status.go | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/ivs/channel.go b/internal/service/ivs/channel.go index 57cd7067129..9fe59d75d42 100644 --- a/internal/service/ivs/channel.go +++ b/internal/service/ivs/channel.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -151,7 +151,7 @@ func resourceChannelRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := FindChannelByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IVS Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ivs/playback_key_pair.go b/internal/service/ivs/playback_key_pair.go index 2188e6fae3e..00b60f38dce 100644 --- a/internal/service/ivs/playback_key_pair.go +++ b/internal/service/ivs/playback_key_pair.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func resourcePlaybackKeyPairRead(ctx context.Context, d *schema.ResourceData, me out, err := FindPlaybackKeyPairByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IVS PlaybackKeyPair (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ivs/recording_configuration.go b/internal/service/ivs/recording_configuration.go index 264d8d7386a..c4d521f0149 100644 --- a/internal/service/ivs/recording_configuration.go +++ b/internal/service/ivs/recording_configuration.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func resourceRecordingConfigurationRead(ctx context.Context, d *schema.ResourceD out, err := FindRecordingConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IVS RecordingConfiguration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ivs/status.go b/internal/service/ivs/status.go index 8489643bfe8..10f10279328 100644 --- a/internal/service/ivs/status.go +++ b/internal/service/ivs/status.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ivs" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) const ( @@ -21,7 +21,7 @@ const ( func statusPlaybackKeyPair(ctx context.Context, conn *ivs.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindPlaybackKeyPairByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -36,7 +36,7 @@ func statusPlaybackKeyPair(ctx context.Context, conn *ivs.Client, id string) sdk func statusRecordingConfiguration(ctx context.Context, conn *ivs.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindRecordingConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -51,7 +51,7 @@ func statusRecordingConfiguration(ctx context.Context, conn *ivs.Client, id stri func statusChannel(ctx context.Context, conn *ivs.Client, arn string, updateDetails *ivs.UpdateChannelInput) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindChannelByID(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From a1afc9fefd23bba628ec3e30a01c7596f727eea0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:43 -0800 Subject: [PATCH 111/227] `ivschat` --- internal/service/ivschat/logging_configuration.go | 4 ++-- internal/service/ivschat/room.go | 4 ++-- internal/service/ivschat/status.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/ivschat/logging_configuration.go b/internal/service/ivschat/logging_configuration.go index 3bc15022976..b20e2e490d5 100644 --- a/internal/service/ivschat/logging_configuration.go +++ b/internal/service/ivschat/logging_configuration.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -182,7 +182,7 @@ func resourceLoggingConfigurationRead(ctx context.Context, d *schema.ResourceDat out, err := findLoggingConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IVSChat LoggingConfiguration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ivschat/room.go b/internal/service/ivschat/room.go index 1e868752f14..3ec752335fb 100644 --- a/internal/service/ivschat/room.go +++ b/internal/service/ivschat/room.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func resourceRoomRead(ctx context.Context, d *schema.ResourceData, meta any) dia out, err := findRoomByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] IVSChat Room (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ivschat/status.go b/internal/service/ivschat/status.go index 3b3c80c5b08..d3c242430e0 100644 --- a/internal/service/ivschat/status.go +++ b/internal/service/ivschat/status.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ivschat" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) const ( @@ -22,7 +22,7 @@ const ( func statusLoggingConfiguration(ctx context.Context, conn *ivschat.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findLoggingConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -37,7 +37,7 @@ func statusLoggingConfiguration(ctx context.Context, conn *ivschat.Client, id st func statusRoom(ctx context.Context, conn *ivschat.Client, id string, updateDetails *ivschat.UpdateRoomInput) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findRoomByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 3d9d9b63663990b270ea69e8ece3e1d6727dd8ae Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:43 -0800 Subject: [PATCH 112/227] `kafka` --- internal/service/kafka/cluster.go | 7 ++++--- internal/service/kafka/cluster_policy.go | 3 ++- internal/service/kafka/cluster_policy_test.go | 4 ++-- internal/service/kafka/cluster_test.go | 4 ++-- internal/service/kafka/configuration.go | 5 +++-- internal/service/kafka/configuration_test.go | 4 ++-- internal/service/kafka/replicator.go | 5 +++-- internal/service/kafka/replicator_test.go | 4 ++-- internal/service/kafka/scram_secret_association.go | 3 ++- internal/service/kafka/scram_secret_association_test.go | 4 ++-- internal/service/kafka/serverless_cluster.go | 3 ++- internal/service/kafka/serverless_cluster_test.go | 4 ++-- internal/service/kafka/single_scram_secret_association.go | 3 ++- .../service/kafka/single_scram_secret_association_test.go | 4 ++-- internal/service/kafka/vpc_connection.go | 5 +++-- internal/service/kafka/vpc_connection_test.go | 4 ++-- 16 files changed, 37 insertions(+), 29 deletions(-) diff --git a/internal/service/kafka/cluster.go b/internal/service/kafka/cluster.go index baeccbaef9b..1986f94d14c 100644 --- a/internal/service/kafka/cluster.go +++ b/internal/service/kafka/cluster.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/semver" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -656,7 +657,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) cluster, err := findClusterByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MSK Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1219,7 +1220,7 @@ func statusClusterState(ctx context.Context, conn *kafka.Client, arn string) sdk return func() (any, string, error) { output, err := findClusterV2ByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1235,7 +1236,7 @@ func statusClusterOperationState(ctx context.Context, conn *kafka.Client, arn st return func() (any, string, error) { output, err := findClusterOperationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafka/cluster_policy.go b/internal/service/kafka/cluster_policy.go index bb46c8de5ab..a8a8f8705de 100644 --- a/internal/service/kafka/cluster_policy.go +++ b/internal/service/kafka/cluster_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -97,7 +98,7 @@ func resourceClusterPolicyRead(ctx context.Context, d *schema.ResourceData, meta output, err := findClusterPolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MSK Cluster Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kafka/cluster_policy_test.go b/internal/service/kafka/cluster_policy_test.go index 67eb6aa58c6..e7dde3dd5ce 100644 --- a/internal/service/kafka/cluster_policy_test.go +++ b/internal/service/kafka/cluster_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +128,7 @@ func testAccCheckClusterPolicyDestroy(ctx context.Context) resource.TestCheckFun _, err := tfkafka.FindClusterPolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index e91b051829f..f053e87423d 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1461,7 +1461,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkafka.FindClusterByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/configuration.go b/internal/service/kafka/configuration.go index a0ff9e9b263..2c405d8b5e3 100644 --- a/internal/service/kafka/configuration.go +++ b/internal/service/kafka/configuration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +111,7 @@ func resourceConfigurationRead(ctx context.Context, d *schema.ResourceData, meta configurationOutput, err := findConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MSK Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -231,7 +232,7 @@ func statusConfigurationState(ctx context.Context, conn *kafka.Client, arn strin return func() (any, string, error) { output, err := findConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafka/configuration_test.go b/internal/service/kafka/configuration_test.go index 28e42bb7105..a2a45c7296c 100644 --- a/internal/service/kafka/configuration_test.go +++ b/internal/service/kafka/configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -232,7 +232,7 @@ func testAccCheckConfigurationDestroy(ctx context.Context) resource.TestCheckFun _, err := tfkafka.FindConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/replicator.go b/internal/service/kafka/replicator.go index 7394fdb04ba..da3162f23c6 100644 --- a/internal/service/kafka/replicator.go +++ b/internal/service/kafka/replicator.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -297,7 +298,7 @@ func resourceReplicatorRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findReplicatorByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kafka Replicator (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -459,7 +460,7 @@ func statusReplicator(ctx context.Context, conn *kafka.Client, arn string) sdkre return func() (any, string, error) { output, err := findReplicatorByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafka/replicator_test.go b/internal/service/kafka/replicator_test.go index cf30443ce8d..fa6e69ff677 100644 --- a/internal/service/kafka/replicator_test.go +++ b/internal/service/kafka/replicator_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -262,7 +262,7 @@ func testAccCheckReplicatorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkafka.FindReplicatorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/scram_secret_association.go b/internal/service/kafka/scram_secret_association.go index ee66c4ea783..6b29cd2c7fc 100644 --- a/internal/service/kafka/scram_secret_association.go +++ b/internal/service/kafka/scram_secret_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -80,7 +81,7 @@ func resourceSCRAMSecretAssociationRead(ctx context.Context, d *schema.ResourceD scramSecrets, err := findSCRAMSecretAssociation(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MSK SCRAM Secret Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kafka/scram_secret_association_test.go b/internal/service/kafka/scram_secret_association_test.go index 0e842aecb27..4c6686fbddb 100644 --- a/internal/service/kafka/scram_secret_association_test.go +++ b/internal/service/kafka/scram_secret_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func testAccCheckSCRAMSecretAssociationDestroy(ctx context.Context) resource.Tes _, err := tfkafka.FindSCRAMSecretAssociation(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/serverless_cluster.go b/internal/service/kafka/serverless_cluster.go index 1aaf4c89f1f..d6803a78e34 100644 --- a/internal/service/kafka/serverless_cluster.go +++ b/internal/service/kafka/serverless_cluster.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -163,7 +164,7 @@ func resourceServerlessClusterRead(ctx context.Context, d *schema.ResourceData, cluster, err := findServerlessClusterByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MSK Serverless Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kafka/serverless_cluster_test.go b/internal/service/kafka/serverless_cluster_test.go index a0b11c4c713..a44053b219a 100644 --- a/internal/service/kafka/serverless_cluster_test.go +++ b/internal/service/kafka/serverless_cluster_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -170,7 +170,7 @@ func testAccCheckServerlessClusterDestroy(ctx context.Context) resource.TestChec _, err := tfkafka.FindServerlessClusterByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/single_scram_secret_association.go b/internal/service/kafka/single_scram_secret_association.go index 64bdd022b32..ee2b94c4139 100644 --- a/internal/service/kafka/single_scram_secret_association.go +++ b/internal/service/kafka/single_scram_secret_association.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +111,7 @@ func (r *singleSCRAMSecretAssociationResource) Read(ctx context.Context, request err := findSingleSCRAMSecretAssociationByTwoPartKey(ctx, conn, data.ClusterARN.ValueString(), data.SecretARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/kafka/single_scram_secret_association_test.go b/internal/service/kafka/single_scram_secret_association_test.go index dfe59d9bd84..3ff921d3f67 100644 --- a/internal/service/kafka/single_scram_secret_association_test.go +++ b/internal/service/kafka/single_scram_secret_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +103,7 @@ func testAccCheckSingleSCRAMSecretAssociationDestroy(ctx context.Context) resour err := tfkafka.FindSingleSCRAMSecretAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["cluster_arn"], rs.Primary.Attributes["secret_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafka/vpc_connection.go b/internal/service/kafka/vpc_connection.go index debbef058ba..6617f60e2e1 100644 --- a/internal/service/kafka/vpc_connection.go +++ b/internal/service/kafka/vpc_connection.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -109,7 +110,7 @@ func resourceVPCConnectionRead(ctx context.Context, d *schema.ResourceData, meta output, err := findVPCConnectionByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MSK VPC Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -201,7 +202,7 @@ func statusVPCConnection(ctx context.Context, conn *kafka.Client, arn string) sd return func() (any, string, error) { output, err := findVPCConnectionByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafka/vpc_connection_test.go b/internal/service/kafka/vpc_connection_test.go index a98a5de95f8..d00ceddc3f2 100644 --- a/internal/service/kafka/vpc_connection_test.go +++ b/internal/service/kafka/vpc_connection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +134,7 @@ func testAccCheckVPCConnectionDestroy(ctx context.Context) resource.TestCheckFun _, err := tfkafka.FindVPCConnectionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 4806395461d36cc306c3a4365567c121feb3a9be Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:44 -0800 Subject: [PATCH 113/227] `kafkaconnect` --- internal/service/kafkaconnect/connector.go | 5 +++-- internal/service/kafkaconnect/connector_test.go | 4 ++-- internal/service/kafkaconnect/custom_plugin.go | 5 +++-- internal/service/kafkaconnect/custom_plugin_test.go | 4 ++-- internal/service/kafkaconnect/worker_configuration.go | 5 +++-- internal/service/kafkaconnect/worker_configuration_test.go | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/internal/service/kafkaconnect/connector.go b/internal/service/kafkaconnect/connector.go index d9fb7a85bc1..0d9558017ba 100644 --- a/internal/service/kafkaconnect/connector.go +++ b/internal/service/kafkaconnect/connector.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -445,7 +446,7 @@ func resourceConnectorRead(ctx context.Context, d *schema.ResourceData, meta any connector, err := findConnectorByARN(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] MSK Connect Connector (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -615,7 +616,7 @@ func statusConnector(ctx context.Context, conn *kafkaconnect.Client, arn string) return func() (any, string, error) { output, err := findConnectorByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafkaconnect/connector_test.go b/internal/service/kafkaconnect/connector_test.go index 5f4613c8050..4e49a52f23e 100644 --- a/internal/service/kafkaconnect/connector_test.go +++ b/internal/service/kafkaconnect/connector_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafkaconnect "github.com/hashicorp/terraform-provider-aws/internal/service/kafkaconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -310,7 +310,7 @@ func testAccCheckConnectorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkafkaconnect.FindConnectorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafkaconnect/custom_plugin.go b/internal/service/kafkaconnect/custom_plugin.go index 06a0593350a..be279352830 100644 --- a/internal/service/kafkaconnect/custom_plugin.go +++ b/internal/service/kafkaconnect/custom_plugin.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -151,7 +152,7 @@ func resourceCustomPluginRead(ctx context.Context, d *schema.ResourceData, meta plugin, err := findCustomPluginByARN(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] MSK Connect Custom Plugin (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -246,7 +247,7 @@ func statusCustomPlugin(ctx context.Context, conn *kafkaconnect.Client, arn stri return func() (any, string, error) { output, err := findCustomPluginByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafkaconnect/custom_plugin_test.go b/internal/service/kafkaconnect/custom_plugin_test.go index 7f3c7689f02..8a6d90ce560 100644 --- a/internal/service/kafkaconnect/custom_plugin_test.go +++ b/internal/service/kafkaconnect/custom_plugin_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafkaconnect "github.com/hashicorp/terraform-provider-aws/internal/service/kafkaconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -205,7 +205,7 @@ func testAccCheckCustomPluginDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfkafkaconnect.FindCustomPluginByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kafkaconnect/worker_configuration.go b/internal/service/kafkaconnect/worker_configuration.go index dad056b1a6f..09d7e4c516b 100644 --- a/internal/service/kafkaconnect/worker_configuration.go +++ b/internal/service/kafkaconnect/worker_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -112,7 +113,7 @@ func resourceWorkerConfigurationRead(ctx context.Context, d *schema.ResourceData config, err := findWorkerConfigurationByARN(ctx, conn, d.Id()) - if tfresource.NotFound(err) && !d.IsNewResource() { + if retry.NotFound(err) && !d.IsNewResource() { log.Printf("[WARN] MSK Connect Worker Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -198,7 +199,7 @@ func statusWorkerConfiguration(ctx context.Context, conn *kafkaconnect.Client, a return func() (any, string, error) { output, err := findWorkerConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kafkaconnect/worker_configuration_test.go b/internal/service/kafkaconnect/worker_configuration_test.go index 65b5d920c0f..d52144551ce 100644 --- a/internal/service/kafkaconnect/worker_configuration_test.go +++ b/internal/service/kafkaconnect/worker_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkafkaconnect "github.com/hashicorp/terraform-provider-aws/internal/service/kafkaconnect" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +171,7 @@ func testAccCheckWorkerConfigurationDestroy(ctx context.Context) resource.TestCh _, err := tfkafkaconnect.FindWorkerConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 4b4548df3004cc4e03674db3a5b41c0a00a7c3be Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:45 -0800 Subject: [PATCH 114/227] `kendra` --- internal/service/kendra/data_source.go | 5 +++-- internal/service/kendra/data_source_test.go | 4 ++-- internal/service/kendra/experience.go | 5 +++-- internal/service/kendra/experience_test.go | 4 ++-- internal/service/kendra/faq.go | 5 +++-- internal/service/kendra/faq_test.go | 4 ++-- internal/service/kendra/index.go | 5 +++-- internal/service/kendra/query_suggestions_block_list.go | 5 +++-- internal/service/kendra/query_suggestions_block_list_test.go | 4 ++-- internal/service/kendra/thesaurus.go | 5 +++-- internal/service/kendra/thesaurus_test.go | 4 ++-- 11 files changed, 28 insertions(+), 22 deletions(-) diff --git a/internal/service/kendra/data_source.go b/internal/service/kendra/data_source.go index 81ffec641e5..6513bb0eb57 100644 --- a/internal/service/kendra/data_source.go +++ b/internal/service/kendra/data_source.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -697,7 +698,7 @@ func resourceDataSourceRead(ctx context.Context, d *schema.ResourceData, meta an resp, err := FindDataSourceByID(ctx, conn, id, indexId) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kendra Data Source (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -919,7 +920,7 @@ func statusDataSource(ctx context.Context, conn *kendra.Client, id, indexId stri return func() (any, string, error) { output, err := FindDataSourceByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kendra/data_source_test.go b/internal/service/kendra/data_source_test.go index 75eef5edda3..106e4e328a8 100644 --- a/internal/service/kendra/data_source_test.go +++ b/internal/service/kendra/data_source_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1826,7 +1826,7 @@ func testAccCheckDataSourceDestroy(ctx context.Context) resource.TestCheckFunc { } _, err = tfkendra.FindDataSourceByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kendra/experience.go b/internal/service/kendra/experience.go index 5f59a805772..b5cd1c82b57 100644 --- a/internal/service/kendra/experience.go +++ b/internal/service/kendra/experience.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -231,7 +232,7 @@ func resourceExperienceRead(ctx context.Context, d *schema.ResourceData, meta an out, err := FindExperienceByID(ctx, conn, id, indexId) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kendra Experience (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -405,7 +406,7 @@ func waitExperienceDeleted(ctx context.Context, conn *kendra.Client, id, indexId func statusExperience(ctx context.Context, conn *kendra.Client, id, indexId string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindExperienceByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kendra/experience_test.go b/internal/service/kendra/experience_test.go index 99ad5a37cc4..9572ab72b10 100644 --- a/internal/service/kendra/experience_test.go +++ b/internal/service/kendra/experience_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -600,7 +600,7 @@ func testAccCheckExperienceDestroy(ctx context.Context) resource.TestCheckFunc { } _, err = tfkendra.FindExperienceByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kendra/faq.go b/internal/service/kendra/faq.go index 84c66bc224c..bdbe956c61b 100644 --- a/internal/service/kendra/faq.go +++ b/internal/service/kendra/faq.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -225,7 +226,7 @@ func resourceFaqRead(ctx context.Context, d *schema.ResourceData, meta any) diag resp, err := FindFaqByID(ctx, conn, id, indexId) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kendra Faq (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -346,7 +347,7 @@ func statusFaq(ctx context.Context, conn *kendra.Client, id, indexId string) sdk return func() (any, string, error) { output, err := FindFaqByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kendra/faq_test.go b/internal/service/kendra/faq_test.go index 34930d6ba7d..b5de9618aab 100644 --- a/internal/service/kendra/faq_test.go +++ b/internal/service/kendra/faq_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -273,7 +273,7 @@ func testAccCheckFaqDestroy(ctx context.Context) resource.TestCheckFunc { } _, err = tfkendra.FindFaqByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kendra/index.go b/internal/service/kendra/index.go index 95565ff669a..62cde330ba4 100644 --- a/internal/service/kendra/index.go +++ b/internal/service/kendra/index.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -474,7 +475,7 @@ func resourceIndexRead(ctx context.Context, d *schema.ResourceData, meta any) di resp, err := findIndexByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kendra Index (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -647,7 +648,7 @@ func statusIndex(ctx context.Context, conn *kendra.Client, id string) sdkretry.S return func() (any, string, error) { output, err := findIndexByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kendra/query_suggestions_block_list.go b/internal/service/kendra/query_suggestions_block_list.go index 733f97231d7..dffcf5fdd5c 100644 --- a/internal/service/kendra/query_suggestions_block_list.go +++ b/internal/service/kendra/query_suggestions_block_list.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -167,7 +168,7 @@ func resourceQuerySuggestionsBlockListRead(ctx context.Context, d *schema.Resour out, err := FindQuerySuggestionsBlockListByID(ctx, conn, id, indexId) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kendra QuerySuggestionsBlockList (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -298,7 +299,7 @@ func resourceQuerySuggestionsBlockListDelete(ctx context.Context, d *schema.Reso func statusQuerySuggestionsBlockList(ctx context.Context, conn *kendra.Client, id, indexId string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindQuerySuggestionsBlockListByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kendra/query_suggestions_block_list_test.go b/internal/service/kendra/query_suggestions_block_list_test.go index 12481ea23e2..821416cf7c6 100644 --- a/internal/service/kendra/query_suggestions_block_list_test.go +++ b/internal/service/kendra/query_suggestions_block_list_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -339,7 +339,7 @@ func testAccCheckQuerySuggestionsBlockListDestroy(ctx context.Context) resource. _, err = tfkendra.FindQuerySuggestionsBlockListByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kendra/thesaurus.go b/internal/service/kendra/thesaurus.go index 17928f9f641..0e267e93279 100644 --- a/internal/service/kendra/thesaurus.go +++ b/internal/service/kendra/thesaurus.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -168,7 +169,7 @@ func resourceThesaurusRead(ctx context.Context, d *schema.ResourceData, meta any out, err := FindThesaurusByID(ctx, conn, id, indexId) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kendra Thesaurus (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -298,7 +299,7 @@ func resourceThesaurusDelete(ctx context.Context, d *schema.ResourceData, meta a func statusThesaurus(ctx context.Context, conn *kendra.Client, id, indexId string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindThesaurusByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kendra/thesaurus_test.go b/internal/service/kendra/thesaurus_test.go index 9ef7c1559f8..1493df960cf 100644 --- a/internal/service/kendra/thesaurus_test.go +++ b/internal/service/kendra/thesaurus_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -340,7 +340,7 @@ func testAccCheckThesaurusDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfkendra.FindThesaurusByID(ctx, conn, id, indexId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 217394001258ccd09cca94e03f8b8618d23be4b2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:46 -0800 Subject: [PATCH 115/227] `keyspaces` --- internal/service/keyspaces/keyspace.go | 3 ++- internal/service/keyspaces/keyspace_test.go | 4 ++-- internal/service/keyspaces/table.go | 5 +++-- internal/service/keyspaces/table_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/keyspaces/keyspace.go b/internal/service/keyspaces/keyspace.go index decde13e948..06e87f1f71f 100644 --- a/internal/service/keyspaces/keyspace.go +++ b/internal/service/keyspaces/keyspace.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -139,7 +140,7 @@ func resourceKeyspaceRead(ctx context.Context, d *schema.ResourceData, meta any) keyspace, err := findKeyspaceByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Keyspaces Keyspace (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/keyspaces/keyspace_test.go b/internal/service/keyspaces/keyspace_test.go index 2248334f203..36f0795d783 100644 --- a/internal/service/keyspaces/keyspace_test.go +++ b/internal/service/keyspaces/keyspace_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkeyspaces "github.com/hashicorp/terraform-provider-aws/internal/service/keyspaces" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -170,7 +170,7 @@ func testAccCheckKeyspaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkeyspaces.FindKeyspaceByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/keyspaces/table.go b/internal/service/keyspaces/table.go index 31dc5963323..1bc352a71ff 100644 --- a/internal/service/keyspaces/table.go +++ b/internal/service/keyspaces/table.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -373,7 +374,7 @@ func resourceTableRead(ctx context.Context, d *schema.ResourceData, meta any) di table, err := findTableByTwoPartKey(ctx, conn, keyspaceName, tableName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Keyspaces Table (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -696,7 +697,7 @@ func statusTable(ctx context.Context, conn *keyspaces.Client, keyspaceName, tabl return func() (any, string, error) { output, err := findTableByTwoPartKey(ctx, conn, keyspaceName, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/keyspaces/table_test.go b/internal/service/keyspaces/table_test.go index 9b7ff8c11ad..1a490abf883 100644 --- a/internal/service/keyspaces/table_test.go +++ b/internal/service/keyspaces/table_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkeyspaces "github.com/hashicorp/terraform-provider-aws/internal/service/keyspaces" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -497,7 +497,7 @@ func testAccCheckTableDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfkeyspaces.FindTableByTwoPartKey(ctx, conn, keyspaceName, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 226b0d214e4bcd382cdd031d18a6cf4bbcd446a3 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:47 -0800 Subject: [PATCH 116/227] `kinesis` --- internal/service/kinesis/resource_policy.go | 3 ++- internal/service/kinesis/resource_policy_test.go | 4 ++-- internal/service/kinesis/stream.go | 5 +++-- internal/service/kinesis/stream_consumer.go | 5 +++-- internal/service/kinesis/stream_consumer_test.go | 4 ++-- internal/service/kinesis/stream_test.go | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/service/kinesis/resource_policy.go b/internal/service/kinesis/resource_policy.go index 38aa26c8975..6ad921b21cf 100644 --- a/internal/service/kinesis/resource_policy.go +++ b/internal/service/kinesis/resource_policy.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +104,7 @@ func (r *resourcePolicyResource) Read(ctx context.Context, request resource.Read output, err := findResourcePolicyByARN(ctx, conn, data.ResourceARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/kinesis/resource_policy_test.go b/internal/service/kinesis/resource_policy_test.go index 290363e4699..5c4a5417941 100644 --- a/internal/service/kinesis/resource_policy_test.go +++ b/internal/service/kinesis/resource_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkinesis "github.com/hashicorp/terraform-provider-aws/internal/service/kinesis" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfkinesis.FindResourcePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kinesis/stream.go b/internal/service/kinesis/stream.go index 0f33bfe221f..ec6b1a589fd 100644 --- a/internal/service/kinesis/stream.go +++ b/internal/service/kinesis/stream.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -282,7 +283,7 @@ func resourceStreamRead(ctx context.Context, d *schema.ResourceData, meta any) d name := d.Get(names.AttrName).(string) stream, err := findStreamByName(ctx, conn, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kinesis Stream (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -598,7 +599,7 @@ func streamStatus(ctx context.Context, conn *kinesis.Client, name string) sdkret return func() (any, string, error) { output, err := findStreamByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kinesis/stream_consumer.go b/internal/service/kinesis/stream_consumer.go index 6185a9750df..1b300d3470b 100644 --- a/internal/service/kinesis/stream_consumer.go +++ b/internal/service/kinesis/stream_consumer.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -98,7 +99,7 @@ func resourceStreamConsumerRead(ctx context.Context, d *schema.ResourceData, met consumer, err := findStreamConsumerByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kinesis Stream Consumer (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -178,7 +179,7 @@ func statusStreamConsumer(ctx context.Context, conn *kinesis.Client, arn string) return func() (any, string, error) { output, err := findStreamConsumerByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kinesis/stream_consumer_test.go b/internal/service/kinesis/stream_consumer_test.go index cf1612a3e6d..fd4d3a7c8b7 100644 --- a/internal/service/kinesis/stream_consumer_test.go +++ b/internal/service/kinesis/stream_consumer_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkinesis "github.com/hashicorp/terraform-provider-aws/internal/service/kinesis" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func testAccCheckStreamConsumerDestroy(ctx context.Context) resource.TestCheckFu _, err := tfkinesis.FindStreamConsumerByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kinesis/stream_test.go b/internal/service/kinesis/stream_test.go index 9aebb5a1dd2..aec7829ae54 100644 --- a/internal/service/kinesis/stream_test.go +++ b/internal/service/kinesis/stream_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkinesis "github.com/hashicorp/terraform-provider-aws/internal/service/kinesis" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -733,7 +733,7 @@ func testAccCheckStreamDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkinesis.FindStreamByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5ac628105cbbf67ae5a82a4173ede0ea4e2d104e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:47 -0800 Subject: [PATCH 117/227] `kinesisanalytics` --- internal/service/kinesisanalytics/application.go | 4 ++-- internal/service/kinesisanalytics/application_test.go | 4 ++-- internal/service/kinesisanalytics/status.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/kinesisanalytics/application.go b/internal/service/kinesisanalytics/application.go index f4d4562dcbd..6ec5bed0e98 100644 --- a/internal/service/kinesisanalytics/application.go +++ b/internal/service/kinesisanalytics/application.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -652,7 +652,7 @@ func resourceApplicationRead(ctx context.Context, d *schema.ResourceData, meta a application, err := findApplicationDetailByName(ctx, conn, d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kinesis Analytics Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kinesisanalytics/application_test.go b/internal/service/kinesisanalytics/application_test.go index 80d91a5cb85..5890c9896fe 100644 --- a/internal/service/kinesisanalytics/application_test.go +++ b/internal/service/kinesisanalytics/application_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkinesisanalytics "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisanalytics" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1913,7 +1913,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfkinesisanalytics.FindApplicationDetailByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kinesisanalytics/status.go b/internal/service/kinesisanalytics/status.go index 512ed5bcc8f..c05d18d2898 100644 --- a/internal/service/kinesisanalytics/status.go +++ b/internal/service/kinesisanalytics/status.go @@ -8,14 +8,14 @@ import ( "github.com/aws/aws-sdk-go-v2/service/kinesisanalytics" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusApplication(ctx context.Context, conn *kinesisanalytics.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { applicationDetail, err := findApplicationDetailByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 1e1311222fa5644753520162ef95b59566e75807 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:48 -0800 Subject: [PATCH 118/227] `kinesisanalyticsv2` --- internal/service/kinesisanalyticsv2/application.go | 7 ++++--- .../service/kinesisanalyticsv2/application_snapshot.go | 5 +++-- .../kinesisanalyticsv2/application_snapshot_test.go | 4 ++-- internal/service/kinesisanalyticsv2/application_test.go | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/kinesisanalyticsv2/application.go b/internal/service/kinesisanalyticsv2/application.go index 6d7df349d66..9dfcb6c5b38 100644 --- a/internal/service/kinesisanalyticsv2/application.go +++ b/internal/service/kinesisanalyticsv2/application.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -918,7 +919,7 @@ func resourceApplicationRead(ctx context.Context, d *schema.ResourceData, meta a application, err := findApplicationDetailByName(ctx, conn, d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kinesis Analytics v2 Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1588,7 +1589,7 @@ func statusApplication(ctx context.Context, conn *kinesisanalyticsv2.Client, nam return func() (any, string, error) { output, err := findApplicationDetailByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1702,7 +1703,7 @@ func statusApplicationOperation(ctx context.Context, conn *kinesisanalyticsv2.Cl return func() (any, string, error) { output, err := findApplicationOperationByTwoPartKey(ctx, conn, applicationName, operationID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kinesisanalyticsv2/application_snapshot.go b/internal/service/kinesisanalyticsv2/application_snapshot.go index 2a558d755e4..52cf14cd019 100644 --- a/internal/service/kinesisanalyticsv2/application_snapshot.go +++ b/internal/service/kinesisanalyticsv2/application_snapshot.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -117,7 +118,7 @@ func resourceApplicationSnapshotRead(ctx context.Context, d *schema.ResourceData snapshot, err := findSnapshotDetailsByTwoPartKey(ctx, conn, applicationName, snapshotName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Kinesis Analytics v2 Application Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -235,7 +236,7 @@ func statusSnapshotDetails(ctx context.Context, conn *kinesisanalyticsv2.Client, return func() (any, string, error) { output, err := findSnapshotDetailsByTwoPartKey(ctx, conn, applicationName, snapshotName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/kinesisanalyticsv2/application_snapshot_test.go b/internal/service/kinesisanalyticsv2/application_snapshot_test.go index 4971a01f63b..5f72ed55bd4 100644 --- a/internal/service/kinesisanalyticsv2/application_snapshot_test.go +++ b/internal/service/kinesisanalyticsv2/application_snapshot_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkinesisanalyticsv2 "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisanalyticsv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func testAccCheckApplicationSnapshotDestroy(ctx context.Context) resource.TestCh _, err := tfkinesisanalyticsv2.FindSnapshotDetailsByTwoPartKey(ctx, conn, rs.Primary.Attributes["application_name"], rs.Primary.Attributes["snapshot_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kinesisanalyticsv2/application_test.go b/internal/service/kinesisanalyticsv2/application_test.go index 75891927b73..a7e5d45c84f 100644 --- a/internal/service/kinesisanalyticsv2/application_test.go +++ b/internal/service/kinesisanalyticsv2/application_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkinesisanalyticsv2 "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisanalyticsv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -4226,7 +4226,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfkinesisanalyticsv2.FindApplicationDetailByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5f7af712e8d05654bab44ec41cea92227734580a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:49 -0800 Subject: [PATCH 119/227] `kinesisvideo` --- internal/service/kinesisvideo/stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/kinesisvideo/stream.go b/internal/service/kinesisvideo/stream.go index def3aa77ee7..ed7c44b96a6 100644 --- a/internal/service/kinesisvideo/stream.go +++ b/internal/service/kinesisvideo/stream.go @@ -247,7 +247,7 @@ func statusStream(conn *kinesisvideo.Client, arn string) retry.StateRefreshFunc return func(ctx context.Context) (any, string, error) { output, err := findStreamByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 7b4816322756832e692421083c108953cd96057b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:50 -0800 Subject: [PATCH 120/227] `kms` --- internal/service/kms/alias.go | 3 ++- internal/service/kms/alias_test.go | 4 ++-- internal/service/kms/custom_key_store.go | 3 ++- internal/service/kms/custom_key_store_test.go | 4 ++-- internal/service/kms/external_key.go | 5 +++-- internal/service/kms/external_key_test.go | 3 ++- internal/service/kms/grant.go | 5 +++-- internal/service/kms/grant_test.go | 4 ++-- internal/service/kms/key.go | 13 +++++++------ internal/service/kms/key_policy.go | 4 ++-- internal/service/kms/key_test.go | 3 ++- internal/service/kms/replica_external_key.go | 4 ++-- internal/service/kms/replica_key.go | 4 ++-- internal/service/kms/sweep.go | 4 ++-- internal/service/kms/tags_gen.go | 2 +- 15 files changed, 36 insertions(+), 29 deletions(-) diff --git a/internal/service/kms/alias.go b/internal/service/kms/alias.go index 69bbd713887..3d475c55eb4 100644 --- a/internal/service/kms/alias.go +++ b/internal/service/kms/alias.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -101,7 +102,7 @@ func resourceAliasRead(ctx context.Context, d *schema.ResourceData, meta any) di return findAliasByName(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS Alias (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kms/alias_test.go b/internal/service/kms/alias_test.go index 883cce23774..e30da3d0fdd 100644 --- a/internal/service/kms/alias_test.go +++ b/internal/service/kms/alias_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -269,7 +269,7 @@ func testAccCheckAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkms.FindAliasByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kms/custom_key_store.go b/internal/service/kms/custom_key_store.go index 42968d767be..bc5ead0bb1b 100644 --- a/internal/service/kms/custom_key_store.go +++ b/internal/service/kms/custom_key_store.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -168,7 +169,7 @@ func resourceCustomKeyStoreRead(ctx context.Context, d *schema.ResourceData, met output, err := findCustomKeyStoreByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS Custom Key Store (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kms/custom_key_store_test.go b/internal/service/kms/custom_key_store_test.go index 5aaafb114ef..27860408de3 100644 --- a/internal/service/kms/custom_key_store_test.go +++ b/internal/service/kms/custom_key_store_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckCustomKeyStoreDestroy(ctx context.Context) resource.TestCheckFu _, err := tfkms.FindCustomKeyStoreByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kms/external_key.go b/internal/service/kms/external_key.go index ebaf73b1c43..cfa1c9d7155 100644 --- a/internal/service/kms/external_key.go +++ b/internal/service/kms/external_key.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -222,7 +223,7 @@ func resourceExternalKeyRead(ctx context.Context, d *schema.ResourceData, meta a key, err := findKeyInfo(ctx, conn, d.Id(), d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS External Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -439,7 +440,7 @@ func waitKeyValidToPropagated(ctx context.Context, conn *kms.Client, id string, checkFunc := func(ctx context.Context) (bool, error) { output, err := findKeyByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } diff --git a/internal/service/kms/external_key_test.go b/internal/service/kms/external_key_test.go index d9746162dcb..e8c064a47f2 100644 --- a/internal/service/kms/external_key_test.go +++ b/internal/service/kms/external_key_test.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -580,7 +581,7 @@ func testAccCheckExternalKeyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfkms.FindKeyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kms/grant.go b/internal/service/kms/grant.go index 9aa96d85da1..df231bbd41f 100644 --- a/internal/service/kms/grant.go +++ b/internal/service/kms/grant.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -203,7 +204,7 @@ func resourceGrantRead(ctx context.Context, d *schema.ResourceData, meta any) di grant, err := findGrantByTwoPartKeyWithRetry(ctx, conn, keyID, grantID, propagationTimeout) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS Grant (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -331,7 +332,7 @@ func findGrantByTwoPartKeyWithRetry(ctx context.Context, conn *kms.Client, keyID err := tfresource.Retry(ctx, timeout, func(ctx context.Context) *tfresource.RetryError { grant, err := findGrantByTwoPartKey(ctx, conn, keyID, grantID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return tfresource.RetryableError(err) } diff --git a/internal/service/kms/grant_test.go b/internal/service/kms/grant_test.go index 21849e39279..d9e7eb1770c 100644 --- a/internal/service/kms/grant_test.go +++ b/internal/service/kms/grant_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -328,7 +328,7 @@ func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfkms.FindGrantByTwoPartKey(ctx, conn, keyID, grantID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kms/key.go b/internal/service/kms/key.go index 2e1be6c0e15..108845180c2 100644 --- a/internal/service/kms/key.go +++ b/internal/service/kms/key.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -220,7 +221,7 @@ func resourceKeyRead(ctx context.Context, d *schema.ResourceData, meta any) diag key, err := findKeyInfo(ctx, conn, d.Id(), d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -634,7 +635,7 @@ func statusKeyState(ctx context.Context, conn *kms.Client, keyID string) sdkretr return func() (any, string, error) { output, err := findKeyByID(ctx, conn, keyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -650,7 +651,7 @@ func waitKeyDescriptionPropagated(ctx context.Context, conn *kms.Client, keyID s checkFunc := func(ctx context.Context) (bool, error) { output, err := findKeyByID(ctx, conn, keyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } @@ -695,7 +696,7 @@ func waitKeyPolicyPropagated(ctx context.Context, conn *kms.Client, keyID, polic checkFunc := func(ctx context.Context) (bool, error) { output, err := findKeyPolicyByTwoPartKey(ctx, conn, keyID, policyNameDefault) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } @@ -726,7 +727,7 @@ func waitKeyRotationEnabledPropagated(ctx context.Context, conn *kms.Client, key checkFunc := func(ctx context.Context) (bool, error) { rotation, rotationPeriodGot, err := findKeyRotationEnabledByKeyID(ctx, conn, keyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } @@ -752,7 +753,7 @@ func waitKeyStatePropagated(ctx context.Context, conn *kms.Client, keyID string, checkFunc := func(ctx context.Context) (bool, error) { output, err := findKeyByID(ctx, conn, keyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } diff --git a/internal/service/kms/key_policy.go b/internal/service/kms/key_policy.go index 64b00ed1758..ac352b762a1 100644 --- a/internal/service/kms/key_policy.go +++ b/internal/service/kms/key_policy.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -67,7 +67,7 @@ func resourceKeyPolicyRead(ctx context.Context, d *schema.ResourceData, meta any key, err := findKeyInfo(ctx, conn, d.Id(), d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kms/key_test.go b/internal/service/kms/key_test.go index 65755f40cd4..5c7d96766a4 100644 --- a/internal/service/kms/key_test.go +++ b/internal/service/kms/key_test.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -742,7 +743,7 @@ func testAccCheckKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkms.FindKeyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kms/replica_external_key.go b/internal/service/kms/replica_external_key.go index c7184b7d941..c24ba4086bc 100644 --- a/internal/service/kms/replica_external_key.go +++ b/internal/service/kms/replica_external_key.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func resourceReplicaExternalKeyRead(ctx context.Context, d *schema.ResourceData, key, err := findKeyInfo(ctx, conn, d.Id(), d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS External Replica Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kms/replica_key.go b/internal/service/kms/replica_key.go index a061d46e8fe..0ade416120e 100644 --- a/internal/service/kms/replica_key.go +++ b/internal/service/kms/replica_key.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/logging" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func resourceReplicaKeyRead(ctx context.Context, d *schema.ResourceData, meta an key, err := findKeyInfo(ctx, conn, d.Id(), d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] KMS Replica Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/kms/sweep.go b/internal/service/kms/sweep.go index 020de559bb3..6fa72ec7d82 100644 --- a/internal/service/kms/sweep.go +++ b/internal/service/kms/sweep.go @@ -12,10 +12,10 @@ import ( awstypes "github.com/aws/aws-sdk-go-v2/service/kms/types" "github.com/hashicorp/aws-sdk-go-base/v2/tfawserr" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" "github.com/hashicorp/terraform-provider-aws/internal/sweep/sdk" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -55,7 +55,7 @@ func sweepKeys(region string) error { keyID := aws.ToString(v.KeyId) key, err := findKeyByID(ctx, conn, keyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/kms/tags_gen.go b/internal/service/kms/tags_gen.go index 5ebfd05630a..57b17be7659 100644 --- a/internal/service/kms/tags_gen.go +++ b/internal/service/kms/tags_gen.go @@ -179,7 +179,7 @@ func waitTagsPropagated(ctx context.Context, conn *kms.Client, id string, tags t checkFunc := func(ctx context.Context) (bool, error) { output, err := listTags(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } From 86b0a2f52596c1e7d77c92c16aa2b488087b9afc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:51 -0800 Subject: [PATCH 121/227] `lakeformation` --- internal/service/lakeformation/data_cells_filter.go | 3 ++- internal/service/lakeformation/data_cells_filter_test.go | 4 ++-- internal/service/lakeformation/opt_in.go | 3 ++- internal/service/lakeformation/resource.go | 3 ++- internal/service/lakeformation/resource_lf_tag.go | 3 ++- internal/service/lakeformation/resource_test.go | 4 ++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/service/lakeformation/data_cells_filter.go b/internal/service/lakeformation/data_cells_filter.go index 0fb27617d2a..4b08b94f347 100644 --- a/internal/service/lakeformation/data_cells_filter.go +++ b/internal/service/lakeformation/data_cells_filter.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -245,7 +246,7 @@ func (r *dataCellsFilterResource) Read(ctx context.Context, req resource.ReadReq out, err := findDataCellsFilterByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/lakeformation/data_cells_filter_test.go b/internal/service/lakeformation/data_cells_filter_test.go index 6120eb909ea..936a8b4cc9a 100644 --- a/internal/service/lakeformation/data_cells_filter_test.go +++ b/internal/service/lakeformation/data_cells_filter_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflakeformation "github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -183,7 +183,7 @@ func testAccCheckDataCellsFilterDestroy(ctx context.Context) resource.TestCheckF _, err := tflakeformation.FindDataCellsFilterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/lakeformation/opt_in.go b/internal/service/lakeformation/opt_in.go index 8c04e75b369..214537e36eb 100644 --- a/internal/service/lakeformation/opt_in.go +++ b/internal/service/lakeformation/opt_in.go @@ -35,6 +35,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -463,7 +464,7 @@ func (r *optInResource) Read(ctx context.Context, req resource.ReadRequest, resp } out, err := findOptInByID(ctx, conn, principalData.DataLakePrincipalIdentifier.ValueString(), opinr) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/lakeformation/resource.go b/internal/service/lakeformation/resource.go index 48bb3d1c84d..ebba3bb5f1c 100644 --- a/internal/service/lakeformation/resource.go +++ b/internal/service/lakeformation/resource.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -124,7 +125,7 @@ func resourceResourceRead(ctx context.Context, d *schema.ResourceData, meta any) resource, err := FindResourceByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Resource Lake Formation Resource (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lakeformation/resource_lf_tag.go b/internal/service/lakeformation/resource_lf_tag.go index 550dcc34b11..420a9a1268a 100644 --- a/internal/service/lakeformation/resource_lf_tag.go +++ b/internal/service/lakeformation/resource_lf_tag.go @@ -38,6 +38,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -388,7 +389,7 @@ func (r *resourceLFTagResource) Read(ctx context.Context, req resource.ReadReque } out, err := findResourceLFTagByID(ctx, conn, state.CatalogID.ValueString(), res) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/lakeformation/resource_test.go b/internal/service/lakeformation/resource_test.go index bb14b33b15e..37d2f3663c5 100644 --- a/internal/service/lakeformation/resource_test.go +++ b/internal/service/lakeformation/resource_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflakeformation "github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -250,7 +250,7 @@ func testAccCheckResourceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflakeformation.FindResourceByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7346ea049363b1b0b5c84b65f20b939ecb7101ec Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:51 -0800 Subject: [PATCH 122/227] `lambda` --- internal/service/lambda/alias.go | 3 ++- internal/service/lambda/alias_test.go | 4 ++-- internal/service/lambda/code_signing_config.go | 3 ++- internal/service/lambda/code_signing_config_test.go | 4 ++-- internal/service/lambda/event_source_mapping.go | 5 +++-- internal/service/lambda/event_source_mapping_test.go | 3 ++- internal/service/lambda/function.go | 9 +++++---- internal/service/lambda/function_event_invoke_config.go | 3 ++- .../service/lambda/function_event_invoke_config_test.go | 4 ++-- internal/service/lambda/function_recursion_config.go | 3 ++- internal/service/lambda/function_test.go | 4 ++-- internal/service/lambda/function_url.go | 3 ++- internal/service/lambda/function_url_test.go | 4 ++-- internal/service/lambda/layer_version.go | 3 ++- internal/service/lambda/layer_version_permission.go | 3 ++- internal/service/lambda/layer_version_permission_test.go | 4 ++-- internal/service/lambda/layer_version_test.go | 4 ++-- internal/service/lambda/permission.go | 3 ++- internal/service/lambda/permission_test.go | 4 ++-- .../service/lambda/provisioned_concurrency_config.go | 5 +++-- .../lambda/provisioned_concurrency_config_test.go | 4 ++-- internal/service/lambda/runtime_management_config.go | 3 ++- 22 files changed, 49 insertions(+), 36 deletions(-) diff --git a/internal/service/lambda/alias.go b/internal/service/lambda/alias.go index 789dcdce1c0..2ea5f812a2e 100644 --- a/internal/service/lambda/alias.go +++ b/internal/service/lambda/alias.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +112,7 @@ func resourceAliasRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findAliasByTwoPartKey(ctx, conn, d.Get("function_name").(string), d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Alias %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/alias_test.go b/internal/service/lambda/alias_test.go index 8a04cad52d0..30a5e0ad145 100644 --- a/internal/service/lambda/alias_test.go +++ b/internal/service/lambda/alias_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -253,7 +253,7 @@ func testAccCheckAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflambda.FindAliasByTwoPartKey(ctx, conn, rs.Primary.Attributes["function_name"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/code_signing_config.go b/internal/service/lambda/code_signing_config.go index 3ffb786f010..07178b718da 100644 --- a/internal/service/lambda/code_signing_config.go +++ b/internal/service/lambda/code_signing_config.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -131,7 +132,7 @@ func resourceCodeSigningConfigRead(ctx context.Context, d *schema.ResourceData, output, err := findCodeSigningConfigByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Code Signing Config %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/code_signing_config_test.go b/internal/service/lambda/code_signing_config_test.go index 25054b11d4e..ad8865fe488 100644 --- a/internal/service/lambda/code_signing_config_test.go +++ b/internal/service/lambda/code_signing_config_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -244,7 +244,7 @@ func testAccCheckCodeSigningConfigDestroy(ctx context.Context) resource.TestChec _, err := tflambda.FindCodeSigningConfigByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/event_source_mapping.go b/internal/service/lambda/event_source_mapping.go index 4a1d801144b..15bc64fc29f 100644 --- a/internal/service/lambda/event_source_mapping.go +++ b/internal/service/lambda/event_source_mapping.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -638,7 +639,7 @@ func resourceEventSourceMappingRead(ctx context.Context, d *schema.ResourceData, output, err := findEventSourceMappingByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Event Source Mapping (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -975,7 +976,7 @@ func statusEventSourceMapping(ctx context.Context, conn *lambda.Client, id strin return func() (any, string, error) { output, err := findEventSourceMappingByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lambda/event_source_mapping_test.go b/internal/service/lambda/event_source_mapping_test.go index 508f64373c1..11cee573861 100644 --- a/internal/service/lambda/event_source_mapping_test.go +++ b/internal/service/lambda/event_source_mapping_test.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -1745,7 +1746,7 @@ func testAccCheckEventSourceMappingDestroy(ctx context.Context) resource.TestChe _, err := tflambda.FindEventSourceMappingByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/function.go b/internal/service/lambda/function.go index 803a0e995f4..d38ca7766f3 100644 --- a/internal/service/lambda/function.go +++ b/internal/service/lambda/function.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/flex" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -721,7 +722,7 @@ func resourceFunctionRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findFunction(ctx, conn, &input) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Function %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -1392,7 +1393,7 @@ func statusFunctionLastUpdateStatus(ctx context.Context, conn *lambda.Client, na return func() (any, string, error) { output, err := findFunctionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1408,7 +1409,7 @@ func statusFunctionState(ctx context.Context, conn *lambda.Client, name string) return func() (any, string, error) { output, err := findFunctionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -1424,7 +1425,7 @@ func statusFunctionConfigurationLastUpdateStatus(ctx context.Context, conn *lamb return func() (any, string, error) { output, err := findFunctionConfigurationByTwoPartKey(ctx, conn, name, qualifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lambda/function_event_invoke_config.go b/internal/service/lambda/function_event_invoke_config.go index 54d8024397c..302ff2b4351 100644 --- a/internal/service/lambda/function_event_invoke_config.go +++ b/internal/service/lambda/function_event_invoke_config.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -166,7 +167,7 @@ func resourceFunctionEventInvokeConfigRead(ctx context.Context, d *schema.Resour output, err := findFunctionEventInvokeConfigByTwoPartKey(ctx, conn, functionName, qualifier) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Function Event Invoke Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/function_event_invoke_config_test.go b/internal/service/lambda/function_event_invoke_config_test.go index 48bc6cfdf95..3f706dd01c8 100644 --- a/internal/service/lambda/function_event_invoke_config_test.go +++ b/internal/service/lambda/function_event_invoke_config_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -513,7 +513,7 @@ func testAccCheckFunctionEventInvokeConfigDestroy(ctx context.Context) resource. _, err = tflambda.FindFunctionEventInvokeConfigByTwoPartKey(ctx, conn, functionName, qualifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/function_recursion_config.go b/internal/service/lambda/function_recursion_config.go index b47452b24c7..b88e869bf4f 100644 --- a/internal/service/lambda/function_recursion_config.go +++ b/internal/service/lambda/function_recursion_config.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +110,7 @@ func (r *functionRecursionConfigResource) Read(ctx context.Context, req resource } out, err := findFunctionRecursionConfigByName(ctx, conn, state.FunctionName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 1ceb3486ed1..7ed4fbf8059 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -27,8 +27,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2601,7 +2601,7 @@ func testAccCheckFunctionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflambda.FindFunctionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/function_url.go b/internal/service/lambda/function_url.go index b9db41928bc..74e90204a14 100644 --- a/internal/service/lambda/function_url.go +++ b/internal/service/lambda/function_url.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +189,7 @@ func resourceFunctionURLRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findFunctionURLByTwoPartKey(ctx, conn, name, qualifier) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Function URL %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/function_url_test.go b/internal/service/lambda/function_url_test.go index 8b6d7f13d0d..8ded2cbc750 100644 --- a/internal/service/lambda/function_url_test.go +++ b/internal/service/lambda/function_url_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -310,7 +310,7 @@ func testAccCheckFunctionURLDestroy(ctx context.Context) resource.TestCheckFunc _, err := tflambda.FindFunctionURLByTwoPartKey(ctx, conn, rs.Primary.Attributes["function_name"], rs.Primary.Attributes["qualifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/layer_version.go b/internal/service/lambda/layer_version.go index ce7496d3f3e..c51edd2fe80 100644 --- a/internal/service/lambda/layer_version.go +++ b/internal/service/lambda/layer_version.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -228,7 +229,7 @@ func resourceLayerVersionRead(ctx context.Context, d *schema.ResourceData, meta output, err := findLayerVersionByTwoPartKey(ctx, conn, layerName, versionNumber) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Layer Version %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/layer_version_permission.go b/internal/service/lambda/layer_version_permission.go index 34c417c7534..4f0aab41a1e 100644 --- a/internal/service/lambda/layer_version_permission.go +++ b/internal/service/lambda/layer_version_permission.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -138,7 +139,7 @@ func resourceLayerVersionPermissionRead(ctx context.Context, d *schema.ResourceD output, err := findLayerVersionPolicyByTwoPartKey(ctx, conn, layerName, versionNumber) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Layer Version Permission (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/layer_version_permission_test.go b/internal/service/lambda/layer_version_permission_test.go index c90346a0021..992329aba44 100644 --- a/internal/service/lambda/layer_version_permission_test.go +++ b/internal/service/lambda/layer_version_permission_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -323,7 +323,7 @@ func testAccCheckLayerVersionPermissionDestroy(ctx context.Context) resource.Tes _, err = tflambda.FindLayerVersionPolicyByTwoPartKey(ctx, conn, layerName, versionNumber) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/layer_version_test.go b/internal/service/lambda/layer_version_test.go index 8939d0289c9..be237d17c22 100644 --- a/internal/service/lambda/layer_version_test.go +++ b/internal/service/lambda/layer_version_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -365,7 +365,7 @@ func testAccCheckLayerVersionDestroy(ctx context.Context) resource.TestCheckFunc _, err = tflambda.FindLayerVersionByTwoPartKey(ctx, conn, layerName, versionNumber) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/permission.go b/internal/service/lambda/permission.go index a70d8f58181..7932aa006d2 100644 --- a/internal/service/lambda/permission.go +++ b/internal/service/lambda/permission.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -185,7 +186,7 @@ func resourcePermissionRead(ctx context.Context, d *schema.ResourceData, meta an return findPolicyStatementByTwoPartKey(ctx, conn, functionName, d.Id(), d.Get("qualifier").(string)) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Permission (%s/%s) not found, removing from state", functionName, d.Id()) d.SetId("") return diags diff --git a/internal/service/lambda/permission_test.go b/internal/service/lambda/permission_test.go index e94af32e00d..91efefd8bab 100644 --- a/internal/service/lambda/permission_test.go +++ b/internal/service/lambda/permission_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -747,7 +747,7 @@ func testAccCheckPermissionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflambda.FindPolicyStatementByTwoPartKey(ctx, conn, rs.Primary.Attributes["function_name"], rs.Primary.ID, rs.Primary.Attributes["qualifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/provisioned_concurrency_config.go b/internal/service/lambda/provisioned_concurrency_config.go index b0e8bac72b7..a9028b551d1 100644 --- a/internal/service/lambda/provisioned_concurrency_config.go +++ b/internal/service/lambda/provisioned_concurrency_config.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +125,7 @@ func resourceProvisionedConcurrencyConfigRead(ctx context.Context, d *schema.Res output, err := findProvisionedConcurrencyConfigByTwoPartKey(ctx, conn, functionName, qualifier) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lambda Provisioned Concurrency Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -238,7 +239,7 @@ func statusProvisionedConcurrencyConfig(ctx context.Context, conn *lambda.Client return func() (any, string, error) { output, err := findProvisionedConcurrencyConfigByTwoPartKey(ctx, conn, functionName, qualifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lambda/provisioned_concurrency_config_test.go b/internal/service/lambda/provisioned_concurrency_config_test.go index 738f760df0f..bf5688e5a32 100644 --- a/internal/service/lambda/provisioned_concurrency_config_test.go +++ b/internal/service/lambda/provisioned_concurrency_config_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -315,7 +315,7 @@ func testAccCheckProvisionedConcurrencyConfigDestroy(ctx context.Context) resour _, err := tflambda.FindProvisionedConcurrencyConfigByTwoPartKey(ctx, conn, rs.Primary.Attributes["function_name"], rs.Primary.Attributes["qualifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lambda/runtime_management_config.go b/internal/service/lambda/runtime_management_config.go index 6184086afa4..9791270fe11 100644 --- a/internal/service/lambda/runtime_management_config.go +++ b/internal/service/lambda/runtime_management_config.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +114,7 @@ func (r *runtimeManagementConfigResource) Read(ctx context.Context, req resource } out, err := findRuntimeManagementConfigByTwoPartKey(ctx, conn, state.FunctionName.ValueString(), state.Qualifier.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } From 0eab0e2187f975818ce81d21823ea631b0b53234 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:52 -0800 Subject: [PATCH 123/227] `lexmodels` --- internal/service/lexmodels/bot.go | 3 ++- internal/service/lexmodels/bot_test.go | 4 ++-- internal/service/lexmodels/slot_type.go | 3 ++- internal/service/lexmodels/slot_type_test.go | 4 ++-- internal/service/lexmodels/status.go | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/lexmodels/bot.go b/internal/service/lexmodels/bot.go index 591333cc33d..371931966a5 100644 --- a/internal/service/lexmodels/bot.go +++ b/internal/service/lexmodels/bot.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -284,7 +285,7 @@ func resourceBotRead(ctx context.Context, d *schema.ResourceData, meta any) diag output, err := findBotVersionByName(ctx, conn, d.Id(), BotVersionLatest) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lex Bot (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lexmodels/bot_test.go b/internal/service/lexmodels/bot_test.go index 66504dd44fe..28c0d9f2a54 100644 --- a/internal/service/lexmodels/bot_test.go +++ b/internal/service/lexmodels/bot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflexmodels "github.com/hashicorp/terraform-provider-aws/internal/service/lexmodels" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -802,7 +802,7 @@ func testAccCheckBotNotExists(ctx context.Context, botName, botVersion string) r _, err := tflexmodels.FindBotVersionByName(ctx, conn, botName, botVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/lexmodels/slot_type.go b/internal/service/lexmodels/slot_type.go index 2b018c8876a..275e900c3ee 100644 --- a/internal/service/lexmodels/slot_type.go +++ b/internal/service/lexmodels/slot_type.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -180,7 +181,7 @@ func resourceSlotTypeRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findSlotTypeVersionByName(ctx, conn, d.Id(), SlotTypeVersionLatest) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lex Slot Type (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lexmodels/slot_type_test.go b/internal/service/lexmodels/slot_type_test.go index 0426d56eb24..762aa3ec090 100644 --- a/internal/service/lexmodels/slot_type_test.go +++ b/internal/service/lexmodels/slot_type_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflexmodels "github.com/hashicorp/terraform-provider-aws/internal/service/lexmodels" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -416,7 +416,7 @@ func testAccCheckSlotTypeNotExists(ctx context.Context, slotTypeName, slotTypeVe _, err := tflexmodels.FindSlotTypeVersionByName(ctx, conn, slotTypeName, slotTypeVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/lexmodels/status.go b/internal/service/lexmodels/status.go index c57d3b06589..c34dcf7164c 100644 --- a/internal/service/lexmodels/status.go +++ b/internal/service/lexmodels/status.go @@ -11,7 +11,7 @@ import ( awstypes "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/errs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) const ( @@ -24,7 +24,7 @@ func statusBotVersion(ctx context.Context, conn *lexmodelbuildingservice.Client, return func() (any, string, error) { output, err := findBotVersionByName(ctx, conn, name, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -40,7 +40,7 @@ func statusSlotType(ctx context.Context, conn *lexmodelbuildingservice.Client, n return func() (any, string, error) { output, err := findSlotTypeVersionByName(ctx, conn, name, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From d7462140065e5cf3a6f4ddaf1fef47f12fc2312e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:53 -0800 Subject: [PATCH 124/227] `lexv2models` --- internal/service/lexv2models/bot.go | 5 +++-- internal/service/lexv2models/bot_locale.go | 5 +++-- internal/service/lexv2models/bot_locale_test.go | 4 ++-- internal/service/lexv2models/bot_test.go | 4 ++-- internal/service/lexv2models/bot_version.go | 5 +++-- internal/service/lexv2models/bot_version_test.go | 4 ++-- internal/service/lexv2models/intent.go | 5 +++-- internal/service/lexv2models/slot.go | 3 ++- internal/service/lexv2models/slot_type.go | 3 ++- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/internal/service/lexv2models/bot.go b/internal/service/lexv2models/bot.go index e755ead8503..07909b28435 100644 --- a/internal/service/lexv2models/bot.go +++ b/internal/service/lexv2models/bot.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -189,7 +190,7 @@ func (r *botResource) Read(ctx context.Context, request resource.ReadRequest, re output, err := findBotByID(ctx, conn, data.BotID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -325,7 +326,7 @@ func statusBot(ctx context.Context, conn *lexmodelsv2.Client, id string) sdkretr return func() (any, string, error) { output, err := findBotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lexv2models/bot_locale.go b/internal/service/lexv2models/bot_locale.go index c9150563b8f..865442cf91c 100644 --- a/internal/service/lexv2models/bot_locale.go +++ b/internal/service/lexv2models/bot_locale.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -183,7 +184,7 @@ func (r *botLocaleResource) Read(ctx context.Context, request resource.ReadReque localeID, botID, botVersion := parts[0], parts[1], parts[2] output, err := findBotLocaleByThreePartKey(ctx, conn, localeID, botID, botVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -332,7 +333,7 @@ func statusBotLocale(ctx context.Context, conn *lexmodelsv2.Client, localeID, bo return func() (any, string, error) { output, err := findBotLocaleByThreePartKey(ctx, conn, localeID, botID, botVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lexv2models/bot_locale_test.go b/internal/service/lexv2models/bot_locale_test.go index b70853d5d0f..d986927bd01 100644 --- a/internal/service/lexv2models/bot_locale_test.go +++ b/internal/service/lexv2models/bot_locale_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflexv2models "github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckBotLocaleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflexv2models.FindBotLocaleByThreePartKey(ctx, conn, rs.Primary.Attributes["locale_id"], rs.Primary.Attributes["bot_id"], rs.Primary.Attributes["bot_version"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lexv2models/bot_test.go b/internal/service/lexv2models/bot_test.go index 0535a7c4afd..5414087ed50 100644 --- a/internal/service/lexv2models/bot_test.go +++ b/internal/service/lexv2models/bot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflexv2models "github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -179,7 +179,7 @@ func testAccCheckBotDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflexv2models.FindBotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lexv2models/bot_version.go b/internal/service/lexv2models/bot_version.go index 9764c15a3cb..72aebf7b4cf 100644 --- a/internal/service/lexv2models/bot_version.go +++ b/internal/service/lexv2models/bot_version.go @@ -29,6 +29,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -165,7 +166,7 @@ func (r *botVersionResource) Read(ctx context.Context, request resource.ReadRequ botID, botVersion := parts[0], parts[1] output, err := findBotVersionByTwoPartKey(ctx, conn, botID, botVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -257,7 +258,7 @@ func statusBotVersion(ctx context.Context, conn *lexmodelsv2.Client, botID, botV return func() (any, string, error) { output, err := findBotVersionByTwoPartKey(ctx, conn, botID, botVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lexv2models/bot_version_test.go b/internal/service/lexv2models/bot_version_test.go index a8d1a298154..e073784f754 100644 --- a/internal/service/lexv2models/bot_version_test.go +++ b/internal/service/lexv2models/bot_version_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflexv2models "github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +91,7 @@ func testAccCheckBotVersionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflexv2models.FindBotVersionByTwoPartKey(ctx, conn, rs.Primary.Attributes["bot_id"], rs.Primary.Attributes["bot_version"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lexv2models/intent.go b/internal/service/lexv2models/intent.go index 2726cc50dd6..cc86e6b37f4 100644 --- a/internal/service/lexv2models/intent.go +++ b/internal/service/lexv2models/intent.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -970,7 +971,7 @@ func (r *intentResource) Read(ctx context.Context, req resource.ReadRequest, res out, err := findIntentByIDs(ctx, conn, data.IntentID.ValueString(), data.BotID.ValueString(), data.BotVersion.ValueString(), data.LocaleID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -1187,7 +1188,7 @@ func waitIntentDeleted(ctx context.Context, conn *lexmodelsv2.Client, intentID, func statusIntent(ctx context.Context, conn *lexmodelsv2.Client, intentID, botID, botVersion, localeID string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findIntentByIDs(ctx, conn, intentID, botID, botVersion, localeID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/lexv2models/slot.go b/internal/service/lexv2models/slot.go index 227f88180fb..53f0f1d3686 100644 --- a/internal/service/lexv2models/slot.go +++ b/internal/service/lexv2models/slot.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -650,7 +651,7 @@ func (r *slotResource) Read(ctx context.Context, req resource.ReadRequest, resp } out, err := findSlotByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/lexv2models/slot_type.go b/internal/service/lexv2models/slot_type.go index afe53156a1a..8875fa9d16f 100644 --- a/internal/service/lexv2models/slot_type.go +++ b/internal/service/lexv2models/slot_type.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -293,7 +294,7 @@ func (r *slotTypeResource) Read(ctx context.Context, req resource.ReadRequest, r } out, err := FindSlotTypeByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } From da6b883e5f61c3768c2f453c05e31c61f65935b1 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:54 -0800 Subject: [PATCH 125/227] `licensemanager` --- internal/service/licensemanager/association.go | 3 ++- internal/service/licensemanager/association_test.go | 4 ++-- internal/service/licensemanager/grant.go | 3 ++- internal/service/licensemanager/grant_accepter.go | 3 ++- internal/service/licensemanager/grant_accepter_test.go | 4 ++-- internal/service/licensemanager/grant_test.go | 4 ++-- internal/service/licensemanager/license_configuration.go | 3 ++- internal/service/licensemanager/license_configuration_test.go | 4 ++-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/service/licensemanager/association.go b/internal/service/licensemanager/association.go index d279f7c0f43..ccfec0bca6b 100644 --- a/internal/service/licensemanager/association.go +++ b/internal/service/licensemanager/association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -86,7 +87,7 @@ func resourceAssociationRead(ctx context.Context, d *schema.ResourceData, meta a err = findAssociationByTwoPartKey(ctx, conn, resourceARN, licenseConfigurationARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] License Manager Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/licensemanager/association_test.go b/internal/service/licensemanager/association_test.go index 6d2249b9077..06af0e11a2a 100644 --- a/internal/service/licensemanager/association_test.go +++ b/internal/service/licensemanager/association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckAssociationDestroy(ctx context.Context) resource.TestCheckFunc err := tflicensemanager.FindAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrResourceARN], rs.Primary.Attributes["license_configuration_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 253af50d038..30a7844a3ca 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -127,7 +128,7 @@ func resourceGrantRead(ctx context.Context, d *schema.ResourceData, meta any) di grant, err := findGrantByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] License Manager Grant %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/licensemanager/grant_accepter.go b/internal/service/licensemanager/grant_accepter.go index 401e7c08f68..17a5bab7835 100644 --- a/internal/service/licensemanager/grant_accepter.go +++ b/internal/service/licensemanager/grant_accepter.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -114,7 +115,7 @@ func resourceGrantAccepterRead(ctx context.Context, d *schema.ResourceData, meta grant, err := findReceivedGrantByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] License Manager Received Grant %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index ff5773831e9..601655462f2 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckGrantAccepterDestroyWithProvider(ctx context.Context) acctest.T _, err := tflicensemanager.FindReceivedGrantByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index e2284410c8a..49631ad9ace 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflicensemanager.FindGrantByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/licensemanager/license_configuration.go b/internal/service/licensemanager/license_configuration.go index d17f2e8812c..c62c76c402e 100644 --- a/internal/service/licensemanager/license_configuration.go +++ b/internal/service/licensemanager/license_configuration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -129,7 +130,7 @@ func resourceLicenseConfigurationRead(ctx context.Context, d *schema.ResourceDat output, err := findLicenseConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] License Manager License Configuration %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/licensemanager/license_configuration_test.go b/internal/service/licensemanager/license_configuration_test.go index d14cc7f4f42..85f72a47609 100644 --- a/internal/service/licensemanager/license_configuration_test.go +++ b/internal/service/licensemanager/license_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -222,7 +222,7 @@ func testAccCheckLicenseConfigurationDestroy(ctx context.Context) resource.TestC _, err := tflicensemanager.FindLicenseConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a0ea8fb5ea6bbc1915b2c417eb29fec4e566ec29 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:55 -0800 Subject: [PATCH 126/227] `lightsail` --- internal/service/lightsail/bucket.go | 3 ++- internal/service/lightsail/bucket_access_key.go | 3 ++- internal/service/lightsail/bucket_access_key_test.go | 4 ++-- internal/service/lightsail/bucket_resource_access.go | 3 ++- internal/service/lightsail/bucket_resource_access_test.go | 4 ++-- internal/service/lightsail/bucket_test.go | 4 ++-- internal/service/lightsail/certificate.go | 3 ++- internal/service/lightsail/certificate_test.go | 4 ++-- internal/service/lightsail/container_service.go | 3 ++- .../lightsail/container_service_deployment_version.go | 3 ++- internal/service/lightsail/container_service_test.go | 4 ++-- internal/service/lightsail/disk.go | 3 ++- internal/service/lightsail/disk_attachment.go | 3 ++- internal/service/lightsail/disk_attachment_test.go | 4 ++-- internal/service/lightsail/disk_test.go | 4 ++-- internal/service/lightsail/distribution.go | 3 ++- internal/service/lightsail/distribution_test.go | 4 ++-- internal/service/lightsail/domain_entry.go | 3 ++- internal/service/lightsail/domain_entry_test.go | 4 ++-- internal/service/lightsail/instance.go | 3 ++- internal/service/lightsail/instance_test.go | 4 ++-- internal/service/lightsail/lb.go | 3 ++- internal/service/lightsail/lb_attachment.go | 3 ++- internal/service/lightsail/lb_attachment_test.go | 4 ++-- internal/service/lightsail/lb_certificate.go | 3 ++- internal/service/lightsail/lb_certificate_attachment.go | 3 ++- internal/service/lightsail/lb_certificate_test.go | 4 ++-- internal/service/lightsail/lb_https_redirection_policy.go | 3 ++- internal/service/lightsail/lb_stickiness_policy.go | 3 ++- internal/service/lightsail/lb_test.go | 4 ++-- internal/service/lightsail/status.go | 6 +++--- 31 files changed, 63 insertions(+), 46 deletions(-) diff --git a/internal/service/lightsail/bucket.go b/internal/service/lightsail/bucket.go index 7676f7dfe2f..c45600ffb43 100644 --- a/internal/service/lightsail/bucket.go +++ b/internal/service/lightsail/bucket.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d out, err := FindBucketById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResBucket, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/bucket_access_key.go b/internal/service/lightsail/bucket_access_key.go index 792af6a7d50..2e465e261e6 100644 --- a/internal/service/lightsail/bucket_access_key.go +++ b/internal/service/lightsail/bucket_access_key.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +106,7 @@ func resourceBucketAccessKeyRead(ctx context.Context, d *schema.ResourceData, me out, err := FindBucketAccessKeyById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResBucketAccessKey, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/bucket_access_key_test.go b/internal/service/lightsail/bucket_access_key_test.go index 93401414027..a75c8757308 100644 --- a/internal/service/lightsail/bucket_access_key_test.go +++ b/internal/service/lightsail/bucket_access_key_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -123,7 +123,7 @@ func testAccCheckBucketAccessKeyDestroy(ctx context.Context) resource.TestCheckF _, err := tflightsail.FindBucketAccessKeyById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/bucket_resource_access.go b/internal/service/lightsail/bucket_resource_access.go index 61d58aef2a8..f796cc31bc0 100644 --- a/internal/service/lightsail/bucket_resource_access.go +++ b/internal/service/lightsail/bucket_resource_access.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +96,7 @@ func resourceBucketResourceAccessRead(ctx context.Context, d *schema.ResourceDat out, err := FindBucketResourceAccessById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResBucketResourceAccess, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/bucket_resource_access_test.go b/internal/service/lightsail/bucket_resource_access_test.go index 2d660a3cea6..8b3b178178e 100644 --- a/internal/service/lightsail/bucket_resource_access_test.go +++ b/internal/service/lightsail/bucket_resource_access_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckBucketResourceAccessDestroy(ctx context.Context) resource.TestC _, err := tflightsail.FindBucketResourceAccessById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/bucket_test.go b/internal/service/lightsail/bucket_test.go index cca6f0f76c3..fd90b8ac457 100644 --- a/internal/service/lightsail/bucket_test.go +++ b/internal/service/lightsail/bucket_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -279,7 +279,7 @@ func testAccCheckBucketDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflightsail.FindBucketById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/certificate.go b/internal/service/lightsail/certificate.go index cc852ed939a..0281629fa31 100644 --- a/internal/service/lightsail/certificate.go +++ b/internal/service/lightsail/certificate.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -171,7 +172,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a certificate, err := FindCertificateById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResCertificate, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/certificate_test.go b/internal/service/lightsail/certificate_test.go index dda3e564ef6..0feae96e6b0 100644 --- a/internal/service/lightsail/certificate_test.go +++ b/internal/service/lightsail/certificate_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -283,7 +283,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tflightsail.FindCertificateById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/container_service.go b/internal/service/lightsail/container_service.go index 3da4eb13b08..3487ff53716 100644 --- a/internal/service/lightsail/container_service.go +++ b/internal/service/lightsail/container_service.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -225,7 +226,7 @@ func resourceContainerServiceRead(ctx context.Context, d *schema.ResourceData, m cs, err := FindContainerServiceByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lightsail Container Service (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/container_service_deployment_version.go b/internal/service/lightsail/container_service_deployment_version.go index ecd34e3bcd5..f760e900501 100644 --- a/internal/service/lightsail/container_service_deployment_version.go +++ b/internal/service/lightsail/container_service_deployment_version.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -223,7 +224,7 @@ func resourceContainerServiceDeploymentVersionRead(ctx context.Context, d *schem deployment, err := FindContainerServiceDeploymentByVersion(ctx, conn, serviceName, version) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lightsail Container Service (%s) Deployment Version (%d) not found, removing from state", serviceName, version) d.SetId("") return diags diff --git a/internal/service/lightsail/container_service_test.go b/internal/service/lightsail/container_service_test.go index 980c734dbb6..f82c28e53d1 100644 --- a/internal/service/lightsail/container_service_test.go +++ b/internal/service/lightsail/container_service_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -394,7 +394,7 @@ func testAccCheckContainerServiceDestroy(ctx context.Context) resource.TestCheck _, err := tflightsail.FindContainerServiceByName(ctx, conn, r.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/disk.go b/internal/service/lightsail/disk.go index c770ea8df99..49d5ef952d2 100644 --- a/internal/service/lightsail/disk.go +++ b/internal/service/lightsail/disk.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -111,7 +112,7 @@ func resourceDiskRead(ctx context.Context, d *schema.ResourceData, meta any) dia out, err := FindDiskById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResDisk, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/disk_attachment.go b/internal/service/lightsail/disk_attachment.go index 8a931ca6d31..631db0074ce 100644 --- a/internal/service/lightsail/disk_attachment.go +++ b/internal/service/lightsail/disk_attachment.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +93,7 @@ func resourceDiskAttachmentRead(ctx context.Context, d *schema.ResourceData, met out, err := FindDiskAttachmentById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResDiskAttachment, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/disk_attachment_test.go b/internal/service/lightsail/disk_attachment_test.go index 0f7d356eb89..f533aaeab3e 100644 --- a/internal/service/lightsail/disk_attachment_test.go +++ b/internal/service/lightsail/disk_attachment_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -125,7 +125,7 @@ func testAccCheckDiskAttachmentDestroy(ctx context.Context) resource.TestCheckFu _, err := tflightsail.FindDiskAttachmentById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/disk_test.go b/internal/service/lightsail/disk_test.go index 759c4e68f39..2c149c80375 100644 --- a/internal/service/lightsail/disk_test.go +++ b/internal/service/lightsail/disk_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -222,7 +222,7 @@ func testAccCheckDiskDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflightsail.FindDiskById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/distribution.go b/internal/service/lightsail/distribution.go index c557291f3e1..b5f793b83dc 100644 --- a/internal/service/lightsail/distribution.go +++ b/internal/service/lightsail/distribution.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -403,7 +404,7 @@ func resourceDistributionRead(ctx context.Context, d *schema.ResourceData, meta out, err := FindDistributionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Lightsail Distribution (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/distribution_test.go b/internal/service/lightsail/distribution_test.go index 229b3c851e7..9e649865abf 100644 --- a/internal/service/lightsail/distribution_test.go +++ b/internal/service/lightsail/distribution_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -524,7 +524,7 @@ func testAccCheckDistributionDestroy(ctx context.Context) resource.TestCheckFunc _, err := tflightsail.FindDistributionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/domain_entry.go b/internal/service/lightsail/domain_entry.go index 58b5378ff50..e00710a22d6 100644 --- a/internal/service/lightsail/domain_entry.go +++ b/internal/service/lightsail/domain_entry.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +134,7 @@ func resourceDomainEntryRead(ctx context.Context, d *schema.ResourceData, meta a entry, err := FindDomainEntryById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResNameDomainEntry, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/domain_entry_test.go b/internal/service/lightsail/domain_entry_test.go index fd95e4b33f6..ef8b82db362 100644 --- a/internal/service/lightsail/domain_entry_test.go +++ b/internal/service/lightsail/domain_entry_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" tfsync "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -267,7 +267,7 @@ func testAccCheckDomainEntryDestroy(ctx context.Context) resource.TestCheckFunc _, err := tflightsail.FindDomainEntryById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/instance.go b/internal/service/lightsail/instance.go index 293dea26552..ce7f84feafe 100644 --- a/internal/service/lightsail/instance.go +++ b/internal/service/lightsail/instance.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -239,7 +240,7 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := FindInstanceById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResInstance, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/instance_test.go b/internal/service/lightsail/instance_test.go index 72b6c390adc..7ab4c76b435 100644 --- a/internal/service/lightsail/instance_test.go +++ b/internal/service/lightsail/instance_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -445,7 +445,7 @@ func testAccCheckInstanceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tflightsail.FindInstanceById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/lb.go b/internal/service/lightsail/lb.go index 398b72fb8f8..7b74de78c0a 100644 --- a/internal/service/lightsail/lb.go +++ b/internal/service/lightsail/lb.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -138,7 +139,7 @@ func resourceLoadBalancerRead(ctx context.Context, d *schema.ResourceData, meta lb, err := FindLoadBalancerById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResLoadBalancer, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/lb_attachment.go b/internal/service/lightsail/lb_attachment.go index e657d816e8d..b10b9707d64 100644 --- a/internal/service/lightsail/lb_attachment.go +++ b/internal/service/lightsail/lb_attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +94,7 @@ func resourceLoadBalancerAttachmentRead(ctx context.Context, d *schema.ResourceD out, err := FindLoadBalancerAttachmentById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResLoadBalancerAttachment, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/lb_attachment_test.go b/internal/service/lightsail/lb_attachment_test.go index 42dbf703b37..7bd2ecd507b 100644 --- a/internal/service/lightsail/lb_attachment_test.go +++ b/internal/service/lightsail/lb_attachment_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -118,7 +118,7 @@ func testAccCheckLoadBalancerAttachmentDestroy(ctx context.Context) resource.Tes _, err := tflightsail.FindLoadBalancerAttachmentById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/lb_certificate.go b/internal/service/lightsail/lb_certificate.go index b639530243a..fca51d692fc 100644 --- a/internal/service/lightsail/lb_certificate.go +++ b/internal/service/lightsail/lb_certificate.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -189,7 +190,7 @@ func resourceLoadBalancerCertificateRead(ctx context.Context, d *schema.Resource out, err := FindLoadBalancerCertificateById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResLoadBalancerCertificate, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/lb_certificate_attachment.go b/internal/service/lightsail/lb_certificate_attachment.go index 23b27bbdcb7..7bbbc537569 100644 --- a/internal/service/lightsail/lb_certificate_attachment.go +++ b/internal/service/lightsail/lb_certificate_attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +95,7 @@ func resourceLoadBalancerCertificateAttachmentRead(ctx context.Context, d *schem out, err := FindLoadBalancerCertificateAttachmentById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResLoadBalancerCertificateAttachment, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/lb_certificate_test.go b/internal/service/lightsail/lb_certificate_test.go index eeaf88e5698..07fe63723ba 100644 --- a/internal/service/lightsail/lb_certificate_test.go +++ b/internal/service/lightsail/lb_certificate_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -168,7 +168,7 @@ func testAccCheckLoadBalancerCertificateDestroy(ctx context.Context) resource.Te _, err := tflightsail.FindLoadBalancerCertificateById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/lb_https_redirection_policy.go b/internal/service/lightsail/lb_https_redirection_policy.go index 140282ee2f1..405d00b58e9 100644 --- a/internal/service/lightsail/lb_https_redirection_policy.go +++ b/internal/service/lightsail/lb_https_redirection_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +88,7 @@ func resourceLoadBalancerHTTPSRedirectionPolicyRead(ctx context.Context, d *sche out, err := FindLoadBalancerHTTPSRedirectionPolicyById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResLoadBalancerHTTPSRedirectionPolicy, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/lb_stickiness_policy.go b/internal/service/lightsail/lb_stickiness_policy.go index 82d9c6fbba7..73756786ac4 100644 --- a/internal/service/lightsail/lb_stickiness_policy.go +++ b/internal/service/lightsail/lb_stickiness_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -101,7 +102,7 @@ func resourceLoadBalancerStickinessPolicyRead(ctx context.Context, d *schema.Res out, err := FindLoadBalancerStickinessPolicyById(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { create.LogNotFoundRemoveState(names.Lightsail, create.ErrActionReading, ResLoadBalancerStickinessPolicy, d.Id()) d.SetId("") return diags diff --git a/internal/service/lightsail/lb_test.go b/internal/service/lightsail/lb_test.go index dbcb3af8cf7..0ae07cddcd7 100644 --- a/internal/service/lightsail/lb_test.go +++ b/internal/service/lightsail/lb_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -362,7 +362,7 @@ func testAccCheckLoadBalancerDestroy(ctx context.Context) resource.TestCheckFunc _, err := tflightsail.FindLoadBalancerById(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/lightsail/status.go b/internal/service/lightsail/status.go index ab044adec8f..fe809c27b39 100644 --- a/internal/service/lightsail/status.go +++ b/internal/service/lightsail/status.go @@ -12,14 +12,14 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lightsail" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusContainerService(ctx context.Context, conn *lightsail.Client, serviceName string) sdkretry.StateRefreshFunc { return func() (any, string, error) { containerService, err := FindContainerServiceByName(ctx, conn, serviceName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -35,7 +35,7 @@ func statusContainerServiceDeploymentVersion(ctx context.Context, conn *lightsai return func() (any, string, error) { deployment, err := FindContainerServiceDeploymentByVersion(ctx, conn, serviceName, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From b9e227522de7263a21120206ff7f283540c3079d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:56 -0800 Subject: [PATCH 127/227] `location` --- internal/service/location/geofence_collection.go | 3 ++- internal/service/location/route_calculator.go | 3 ++- internal/service/location/tracker_association.go | 4 ++-- internal/service/location/tracker_association_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/location/geofence_collection.go b/internal/service/location/geofence_collection.go index a66b195fcad..e05a69d91a6 100644 --- a/internal/service/location/geofence_collection.go +++ b/internal/service/location/geofence_collection.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -122,7 +123,7 @@ func resourceGeofenceCollectionRead(ctx context.Context, d *schema.ResourceData, out, err := findGeofenceCollectionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Location GeofenceCollection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/location/route_calculator.go b/internal/service/location/route_calculator.go index e0f4c8575fc..47da082048c 100644 --- a/internal/service/location/route_calculator.go +++ b/internal/service/location/route_calculator.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceRouteCalculatorRead(ctx context.Context, d *schema.ResourceData, me out, err := findRouteCalculatorByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Location Service Route Calculator (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/location/tracker_association.go b/internal/service/location/tracker_association.go index 752c774a163..e50cb040ef6 100644 --- a/internal/service/location/tracker_association.go +++ b/internal/service/location/tracker_association.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +103,7 @@ func resourceTrackerAssociationRead(ctx context.Context, d *schema.ResourceData, err = FindTrackerAssociationByTrackerNameAndConsumerARN(ctx, conn, trackerAssociationId.TrackerName, trackerAssociationId.ConsumerARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Location TrackerAssociation (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/location/tracker_association_test.go b/internal/service/location/tracker_association_test.go index 400c4651096..34623b37179 100644 --- a/internal/service/location/tracker_association_test.go +++ b/internal/service/location/tracker_association_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tflocation "github.com/hashicorp/terraform-provider-aws/internal/service/location" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckTrackerAssociationDestroy(ctx context.Context) resource.TestChe err = tflocation.FindTrackerAssociationByTrackerNameAndConsumerARN(ctx, conn, trackerAssociationId.TrackerName, trackerAssociationId.ConsumerARN) if err != nil { - if tfresource.NotFound(err) || errs.IsA[*awstypes.ResourceNotFoundException](err) { + if retry.NotFound(err) || errs.IsA[*awstypes.ResourceNotFoundException](err) { return nil } return err From 09c0b56d158cd7a663c09eee8187bc22fd31110e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:56 -0800 Subject: [PATCH 128/227] `m2` --- internal/service/m2/application.go | 9 +++++---- internal/service/m2/application_test.go | 4 ++-- internal/service/m2/deployment.go | 5 +++-- internal/service/m2/deployment_test.go | 4 ++-- internal/service/m2/environment.go | 5 +++-- internal/service/m2/environment_test.go | 4 ++-- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/internal/service/m2/application.go b/internal/service/m2/application.go index 56f7ec6c64a..71e84a776cc 100644 --- a/internal/service/m2/application.go +++ b/internal/service/m2/application.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -208,7 +209,7 @@ func (r *applicationResource) Read(ctx context.Context, request resource.ReadReq outputGA, err := findApplicationByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -347,7 +348,7 @@ func startApplication(ctx context.Context, conn *m2.Client, id string, timeout t func stopApplicationIfRunning(ctx context.Context, conn *m2.Client, id string, forceStop bool, timeout time.Duration) (*m2.GetApplicationOutput, error) { //nolint:unparam app, err := findApplicationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, nil } @@ -428,7 +429,7 @@ func statusApplication(ctx context.Context, conn *m2.Client, id string) sdkretry return func() (any, string, error) { output, err := findApplicationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -444,7 +445,7 @@ func statusApplicationVersion(ctx context.Context, conn *m2.Client, id string, v return func() (any, string, error) { output, err := findApplicationVersionByTwoPartKey(ctx, conn, id, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/m2/application_test.go b/internal/service/m2/application_test.go index e2191b82eff..f4810fd4183 100644 --- a/internal/service/m2/application_test.go +++ b/internal/service/m2/application_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfm2 "github.com/hashicorp/terraform-provider-aws/internal/service/m2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -264,7 +264,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfm2.FindEnvironmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/m2/deployment.go b/internal/service/m2/deployment.go index 187581b6ff1..aca6fb678a6 100644 --- a/internal/service/m2/deployment.go +++ b/internal/service/m2/deployment.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -157,7 +158,7 @@ func (r *deploymentResource) Read(ctx context.Context, request resource.ReadRequ outputGD, err := findDeploymentByTwoPartKey(ctx, conn, data.ApplicationID.ValueString(), data.DeploymentID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -373,7 +374,7 @@ func statusDeployment(ctx context.Context, conn *m2.Client, applicationID, deplo return func() (any, string, error) { output, err := findDeploymentByTwoPartKey(ctx, conn, applicationID, deploymentID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/m2/deployment_test.go b/internal/service/m2/deployment_test.go index e6d129d7624..4ee904936a1 100644 --- a/internal/service/m2/deployment_test.go +++ b/internal/service/m2/deployment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfm2 "github.com/hashicorp/terraform-provider-aws/internal/service/m2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func testAccCheckDeploymentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfm2.FindDeploymentByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrApplicationID], rs.Primary.Attributes["deployment_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/m2/environment.go b/internal/service/m2/environment.go index abf3e06ccd0..c4a2dcf0469 100644 --- a/internal/service/m2/environment.go +++ b/internal/service/m2/environment.go @@ -37,6 +37,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -331,7 +332,7 @@ func (r *environmentResource) Read(ctx context.Context, request resource.ReadReq output, err := findEnvironmentByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -480,7 +481,7 @@ func statusEnvironment(ctx context.Context, conn *m2.Client, id string) sdkretry return func() (any, string, error) { output, err := findEnvironmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/m2/environment_test.go b/internal/service/m2/environment_test.go index 8a06fb813d6..6f386ed7d20 100644 --- a/internal/service/m2/environment_test.go +++ b/internal/service/m2/environment_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfm2 "github.com/hashicorp/terraform-provider-aws/internal/service/m2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -307,7 +307,7 @@ func testAccCheckEnvironmentDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfm2.FindEnvironmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 6b452b38189e0021338cad9201d88580fa015805 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:57 -0800 Subject: [PATCH 129/227] `macie2` --- internal/service/macie2/classification_job.go | 3 ++- internal/service/macie2/classification_job_test.go | 4 ++-- internal/service/macie2/custom_data_identifier.go | 3 ++- internal/service/macie2/custom_data_identifier_test.go | 4 ++-- internal/service/macie2/findings_filter.go | 3 ++- internal/service/macie2/findings_filter_test.go | 4 ++-- internal/service/macie2/member.go | 5 +++-- internal/service/macie2/member_test.go | 4 ++-- internal/service/macie2/organization_configuration.go | 3 ++- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/internal/service/macie2/classification_job.go b/internal/service/macie2/classification_job.go index fe64a2077d2..d51ae3de460 100644 --- a/internal/service/macie2/classification_job.go +++ b/internal/service/macie2/classification_job.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -696,7 +697,7 @@ func resourceClassificationJobRead(ctx context.Context, d *schema.ResourceData, output, err := findClassificationJobByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Macie Classification Job (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/macie2/classification_job_test.go b/internal/service/macie2/classification_job_test.go index fa6a7345d81..7e249a45b79 100644 --- a/internal/service/macie2/classification_job_test.go +++ b/internal/service/macie2/classification_job_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -483,7 +483,7 @@ func testAccCheckClassificationJobDestroy(ctx context.Context) resource.TestChec _, err := tfmacie2.FindClassificationJobByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/macie2/custom_data_identifier.go b/internal/service/macie2/custom_data_identifier.go index b64bc431ffd..58fefef97b3 100644 --- a/internal/service/macie2/custom_data_identifier.go +++ b/internal/service/macie2/custom_data_identifier.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -165,7 +166,7 @@ func resourceCustomDataIdentifierRead(ctx context.Context, d *schema.ResourceDat output, err := findCustomDataIdentifierByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Macie Custom Data Identifier (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/macie2/custom_data_identifier_test.go b/internal/service/macie2/custom_data_identifier_test.go index 46084bef489..d0a2b4a5b0d 100644 --- a/internal/service/macie2/custom_data_identifier_test.go +++ b/internal/service/macie2/custom_data_identifier_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -273,7 +273,7 @@ func testAccCheckCustomDataIdentifierDestroy(ctx context.Context) resource.TestC _, err := tfmacie2.FindCustomDataIdentifierByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/macie2/findings_filter.go b/internal/service/macie2/findings_filter.go index 811d444cb07..41607542b93 100644 --- a/internal/service/macie2/findings_filter.go +++ b/internal/service/macie2/findings_filter.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -188,7 +189,7 @@ func resourceFindingsFilterRead(ctx context.Context, d *schema.ResourceData, met output, err := findFindingsFilterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Macie Findings Filter (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/macie2/findings_filter_test.go b/internal/service/macie2/findings_filter_test.go index cc2f27ce580..8766c217815 100644 --- a/internal/service/macie2/findings_filter_test.go +++ b/internal/service/macie2/findings_filter_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -471,7 +471,7 @@ func testAccCheckFindingsFilterDestroy(ctx context.Context) resource.TestCheckFu _, err := tfmacie2.FindFindingsFilterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/macie2/member.go b/internal/service/macie2/member.go index 81c8db1d4c8..fdb4a88fbc4 100644 --- a/internal/service/macie2/member.go +++ b/internal/service/macie2/member.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -142,7 +143,7 @@ func resourceMemberRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findMemberByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Macie Member (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -341,7 +342,7 @@ func statusMemberRelationship(ctx context.Context, conn *macie2.Client, adminAcc return func() (any, string, error) { output, err := findMemberNotAssociated(ctx, conn, adminAccountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/macie2/member_test.go b/internal/service/macie2/member_test.go index 419d2dd56db..31eaacd4559 100644 --- a/internal/service/macie2/member_test.go +++ b/internal/service/macie2/member_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -401,7 +401,7 @@ func testAccCheckMemberDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmacie2.FindMemberByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/macie2/organization_configuration.go b/internal/service/macie2/organization_configuration.go index c33414370f0..145ed285524 100644 --- a/internal/service/macie2/organization_configuration.go +++ b/internal/service/macie2/organization_configuration.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -79,7 +80,7 @@ func (r *organizationConfigurationResource) Read(ctx context.Context, request re var input macie2.DescribeOrganizationConfigurationInput output, err := findOrganizationConfiguration(ctx, conn, &input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) From a5738c8db5bca0774e5052207f0a9ee043e17f34 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:58 -0800 Subject: [PATCH 130/227] `mediaconvert` --- internal/service/mediaconvert/queue.go | 3 ++- internal/service/mediaconvert/queue_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/service/mediaconvert/queue.go b/internal/service/mediaconvert/queue.go index 27132f85842..c8033bbf3a1 100644 --- a/internal/service/mediaconvert/queue.go +++ b/internal/service/mediaconvert/queue.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -138,7 +139,7 @@ func resourceQueueRead(ctx context.Context, d *schema.ResourceData, meta any) di queue, err := findQueueByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Media Convert Queue (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/mediaconvert/queue_test.go b/internal/service/mediaconvert/queue_test.go index 3d8370a15e5..17f5792c72e 100644 --- a/internal/service/mediaconvert/queue_test.go +++ b/internal/service/mediaconvert/queue_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmediaconvert "github.com/hashicorp/terraform-provider-aws/internal/service/mediaconvert" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -276,7 +276,7 @@ func testAccCheckQueueDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmediaconvert.FindQueueByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5fbd864f20a40cd54a59ff10ca5437a9474ebb12 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:32:59 -0800 Subject: [PATCH 131/227] `medialive` --- internal/service/medialive/channel.go | 7 ++++--- internal/service/medialive/channel_test.go | 4 ++-- internal/service/medialive/input.go | 5 +++-- internal/service/medialive/input_security_group.go | 5 +++-- internal/service/medialive/input_security_group_test.go | 4 ++-- internal/service/medialive/input_test.go | 4 ++-- internal/service/medialive/multiplex.go | 7 ++++--- internal/service/medialive/multiplex_program.go | 3 ++- internal/service/medialive/multiplex_program_test.go | 4 ++-- internal/service/medialive/multiplex_test.go | 4 ++-- 10 files changed, 26 insertions(+), 21 deletions(-) diff --git a/internal/service/medialive/channel.go b/internal/service/medialive/channel.go index 4dae588d0bc..f94a205d6a6 100644 --- a/internal/service/medialive/channel.go +++ b/internal/service/medialive/channel.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -808,7 +809,7 @@ func resourceChannelRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := findChannelByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MediaLive Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -959,7 +960,7 @@ func resourceChannelDelete(ctx context.Context, d *schema.ResourceData, meta any channel, err := findChannelByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -1115,7 +1116,7 @@ func waitChannelStopped(ctx context.Context, conn *medialive.Client, id string, func statusChannel(ctx context.Context, conn *medialive.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findChannelByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index 266e37ffe88..30f4f45d0d0 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmedialive "github.com/hashicorp/terraform-provider-aws/internal/service/medialive" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -862,7 +862,7 @@ func testAccCheckChannelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmedialive.FindChannelByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/medialive/input.go b/internal/service/medialive/input.go index df0e61c2c30..a95c419fd94 100644 --- a/internal/service/medialive/input.go +++ b/internal/service/medialive/input.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -262,7 +263,7 @@ func resourceInputRead(ctx context.Context, d *schema.ResourceData, meta any) di out, err := findInputByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MediaLive Input (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -433,7 +434,7 @@ func waitInputDeleted(ctx context.Context, conn *medialive.Client, id string, ti func statusInput(ctx context.Context, conn *medialive.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findInputByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/medialive/input_security_group.go b/internal/service/medialive/input_security_group.go index 01559f7e23f..12b7d861586 100644 --- a/internal/service/medialive/input_security_group.go +++ b/internal/service/medialive/input_security_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -115,7 +116,7 @@ func resourceInputSecurityGroupRead(ctx context.Context, d *schema.ResourceData, out, err := findInputSecurityGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MediaLive InputSecurityGroup (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -242,7 +243,7 @@ func waitInputSecurityGroupDeleted(ctx context.Context, conn *medialive.Client, func statusInputSecurityGroup(ctx context.Context, conn *medialive.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findInputSecurityGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/medialive/input_security_group_test.go b/internal/service/medialive/input_security_group_test.go index 81116f9d95e..8b825ddd96c 100644 --- a/internal/service/medialive/input_security_group_test.go +++ b/internal/service/medialive/input_security_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmedialive "github.com/hashicorp/terraform-provider-aws/internal/service/medialive" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -147,7 +147,7 @@ func testAccCheckInputSecurityGroupDestroy(ctx context.Context) resource.TestChe _, err := tfmedialive.FindInputSecurityGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/medialive/input_test.go b/internal/service/medialive/input_test.go index d6929b75419..0575a17170b 100644 --- a/internal/service/medialive/input_test.go +++ b/internal/service/medialive/input_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmedialive "github.com/hashicorp/terraform-provider-aws/internal/service/medialive" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func testAccCheckInputDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmedialive.FindInputByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/medialive/multiplex.go b/internal/service/medialive/multiplex.go index c97b07f3fd9..70e3d6500f1 100644 --- a/internal/service/medialive/multiplex.go +++ b/internal/service/medialive/multiplex.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -155,7 +156,7 @@ func resourceMultiplexRead(ctx context.Context, d *schema.ResourceData, meta any out, err := findMultiplexByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MediaLive Multiplex (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -236,7 +237,7 @@ func resourceMultiplexDelete(ctx context.Context, d *schema.ResourceData, meta a out, err := findMultiplexByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -359,7 +360,7 @@ func waitMultiplexStopped(ctx context.Context, conn *medialive.Client, id string func statusMultiplex(ctx context.Context, conn *medialive.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findMultiplexByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/medialive/multiplex_program.go b/internal/service/medialive/multiplex_program.go index bcb0c11ecc7..93aa7eb80e0 100644 --- a/internal/service/medialive/multiplex_program.go +++ b/internal/service/medialive/multiplex_program.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -237,7 +238,7 @@ func (m *multiplexProgramResource) Read(ctx context.Context, req resource.ReadRe out, err := findMultiplexProgramByID(ctx, conn, multiplexId, programName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/medialive/multiplex_program_test.go b/internal/service/medialive/multiplex_program_test.go index b062050aff0..68f61e463b3 100644 --- a/internal/service/medialive/multiplex_program_test.go +++ b/internal/service/medialive/multiplex_program_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmedialive "github.com/hashicorp/terraform-provider-aws/internal/service/medialive" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -200,7 +200,7 @@ func testAccCheckMultiplexProgramDestroy(ctx context.Context) resource.TestCheck _, err := tfmedialive.FindMultiplexProgramByID(ctx, conn, attributes["multiplex_id"], attributes["program_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/medialive/multiplex_test.go b/internal/service/medialive/multiplex_test.go index 3b0f95b222f..e250f70c4d8 100644 --- a/internal/service/medialive/multiplex_test.go +++ b/internal/service/medialive/multiplex_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmedialive "github.com/hashicorp/terraform-provider-aws/internal/service/medialive" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func testAccCheckMultiplexDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmedialive.FindInputSecurityGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 841bd58f85edea04ffd3a3af58798c044b7ad916 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:00 -0800 Subject: [PATCH 132/227] `mediapackagev2` --- internal/service/mediapackagev2/channel_group.go | 3 ++- internal/service/mediapackagev2/channel_group_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/service/mediapackagev2/channel_group.go b/internal/service/mediapackagev2/channel_group.go index 7cb256e655f..b249296d5ee 100644 --- a/internal/service/mediapackagev2/channel_group.go +++ b/internal/service/mediapackagev2/channel_group.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -118,7 +119,7 @@ func (r *channelGroupResource) Read(ctx context.Context, request resource.ReadRe output, err := findChannelGroupByID(ctx, conn, data.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/mediapackagev2/channel_group_test.go b/internal/service/mediapackagev2/channel_group_test.go index 40fbd3a1d88..5e436e93ff9 100644 --- a/internal/service/mediapackagev2/channel_group_test.go +++ b/internal/service/mediapackagev2/channel_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmediapackagev2 "github.com/hashicorp/terraform-provider-aws/internal/service/mediapackagev2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -143,7 +143,7 @@ func testAccCheckChannelGroupDestroy(ctx context.Context) resource.TestCheckFunc return fmt.Errorf("MediaPackageV2 Channel Group: %s not deleted", rs.Primary.ID) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 72fc43ad7a7a1233c56470b5118897baf19fcd51 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:00 -0800 Subject: [PATCH 133/227] `mediastore` --- internal/service/mediastore/container.go | 5 +++-- internal/service/mediastore/container_policy.go | 3 ++- internal/service/mediastore/container_policy_test.go | 4 ++-- internal/service/mediastore/container_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/mediastore/container.go b/internal/service/mediastore/container.go index f4e4286ee50..ba26091fec0 100644 --- a/internal/service/mediastore/container.go +++ b/internal/service/mediastore/container.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -89,7 +90,7 @@ func resourceContainerRead(ctx context.Context, d *schema.ResourceData, meta any resp, err := findContainerByName(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { log.Printf("[WARN] No Container found: %s, removing from state", d.Id()) d.SetId("") return diags @@ -145,7 +146,7 @@ func containerRefreshStatusFunc(ctx context.Context, conn *mediastore.Client, cn return func() (any, string, error) { resp, err := findContainerByName(ctx, conn, cn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/mediastore/container_policy.go b/internal/service/mediastore/container_policy.go index b2665d5a5c8..1c5a82f7da3 100644 --- a/internal/service/mediastore/container_policy.go +++ b/internal/service/mediastore/container_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -85,7 +86,7 @@ func resourceContainerPolicyRead(ctx context.Context, d *schema.ResourceData, me resp, err := findContainerPolicyByContainerName(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { log.Printf("[WARN] MediaStore Container Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/mediastore/container_policy_test.go b/internal/service/mediastore/container_policy_test.go index d7d8f2ade10..19ab7babea4 100644 --- a/internal/service/mediastore/container_policy_test.go +++ b/internal/service/mediastore/container_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmediastore "github.com/hashicorp/terraform-provider-aws/internal/service/mediastore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckContainerPolicyDestroy(ctx context.Context) resource.TestCheckF _, err := tfmediastore.FindContainerPolicyByContainerName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/mediastore/container_test.go b/internal/service/mediastore/container_test.go index 1fa5a028404..5e7a2dbf984 100644 --- a/internal/service/mediastore/container_test.go +++ b/internal/service/mediastore/container_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmediastore "github.com/hashicorp/terraform-provider-aws/internal/service/mediastore" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +131,7 @@ func testAccCheckContainerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmediastore.FindContainerByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8426e19f11bb4d4c6ffe155aa25c0aac363050c9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:01 -0800 Subject: [PATCH 134/227] `memorydb` --- internal/service/memorydb/acl.go | 5 +++-- internal/service/memorydb/acl_test.go | 4 ++-- internal/service/memorydb/cluster.go | 9 +++++---- internal/service/memorydb/cluster_test.go | 6 +++--- internal/service/memorydb/multi_region_cluster.go | 7 ++++--- internal/service/memorydb/multi_region_cluster_test.go | 4 ++-- internal/service/memorydb/parameter_group.go | 3 ++- internal/service/memorydb/parameter_group_test.go | 4 ++-- internal/service/memorydb/snapshot.go | 5 +++-- internal/service/memorydb/snapshot_test.go | 4 ++-- internal/service/memorydb/subnet_group.go | 3 ++- internal/service/memorydb/subnet_group_test.go | 4 ++-- internal/service/memorydb/user.go | 5 +++-- internal/service/memorydb/user_test.go | 4 ++-- 14 files changed, 37 insertions(+), 30 deletions(-) diff --git a/internal/service/memorydb/acl.go b/internal/service/memorydb/acl.go index b81d67684c3..88f5c35fcbb 100644 --- a/internal/service/memorydb/acl.go +++ b/internal/service/memorydb/acl.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceACLRead(ctx context.Context, d *schema.ResourceData, meta any) diag acl, err := findACLByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MemoryDB ACL (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -261,7 +262,7 @@ func statusACL(ctx context.Context, conn *memorydb.Client, name string) sdkretry return func() (any, string, error) { output, err := findACLByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/memorydb/acl_test.go b/internal/service/memorydb/acl_test.go index 5afe655f55e..d73b854adb7 100644 --- a/internal/service/memorydb/acl_test.go +++ b/internal/service/memorydb/acl_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -306,7 +306,7 @@ func testAccCheckACLDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmemorydb.FindACLByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/memorydb/cluster.go b/internal/service/memorydb/cluster.go index 9c701ea7241..b1a65e04896 100644 --- a/internal/service/memorydb/cluster.go +++ b/internal/service/memorydb/cluster.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -397,7 +398,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) cluster, err := findClusterByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MemoryDB Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -651,7 +652,7 @@ func statusCluster(ctx context.Context, conn *memorydb.Client, name string) sdkr return func() (any, string, error) { output, err := findClusterByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -667,7 +668,7 @@ func statusClusterParameterGroup(ctx context.Context, conn *memorydb.Client, nam return func() (any, string, error) { output, err := findClusterByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -683,7 +684,7 @@ func statusClusterSecurityGroups(ctx context.Context, conn *memorydb.Client, nam return func() (any, string, error) { output, err := findClusterByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/memorydb/cluster_test.go b/internal/service/memorydb/cluster_test.go index b4f43a08cb5..e9a30172e51 100644 --- a/internal/service/memorydb/cluster_test.go +++ b/internal/service/memorydb/cluster_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1130,7 +1130,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmemorydb.FindClusterByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1170,7 +1170,7 @@ func testAccCheckSnapshotExistsByName(ctx context.Context, snapshotName string) _, err := tfmemorydb.FindSnapshotByName(ctx, conn, snapshotName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return fmt.Errorf("MemoryDB Snapshot %s not found", snapshotName) } diff --git a/internal/service/memorydb/multi_region_cluster.go b/internal/service/memorydb/multi_region_cluster.go index 212dccab53b..87b43320cb7 100644 --- a/internal/service/memorydb/multi_region_cluster.go +++ b/internal/service/memorydb/multi_region_cluster.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -215,7 +216,7 @@ func (r *multiRegionClusterResource) Read(ctx context.Context, req resource.Read } out, err := findMultiRegionClusterByName(ctx, conn, state.MultiRegionClusterName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -366,7 +367,7 @@ func (r *multiRegionClusterResource) Delete(ctx context.Context, req resource.De // Before deleting the multi-region cluster, ensure it is ready for deletion. // Removing an `aws_memorydb_cluster` from a multi-region cluster may temporarily block deletion. output, err := findMultiRegionClusterByName(ctx, conn, state.MultiRegionClusterName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } if err != nil { @@ -494,7 +495,7 @@ func statusMultiRegionCluster(ctx context.Context, conn *memorydb.Client, name s return func() (any, string, error) { output, err := findMultiRegionClusterByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/memorydb/multi_region_cluster_test.go b/internal/service/memorydb/multi_region_cluster_test.go index 9a0c4fbcd7f..662a9fee484 100644 --- a/internal/service/memorydb/multi_region_cluster_test.go +++ b/internal/service/memorydb/multi_region_cluster_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -431,7 +431,7 @@ func testAccCheckMultiRegionClusterDestroy(ctx context.Context) resource.TestChe name := rs.Primary.Attributes["multi_region_cluster_name"] _, err := tfmemorydb.FindMultiRegionClusterByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/memorydb/parameter_group.go b/internal/service/memorydb/parameter_group.go index e0868213c2a..60c7d7b7144 100644 --- a/internal/service/memorydb/parameter_group.go +++ b/internal/service/memorydb/parameter_group.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -132,7 +133,7 @@ func resourceParameterGroupRead(ctx context.Context, d *schema.ResourceData, met group, err := findParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MemoryDB Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/memorydb/parameter_group_test.go b/internal/service/memorydb/parameter_group_test.go index 52fd67ce37b..090aa833abc 100644 --- a/internal/service/memorydb/parameter_group_test.go +++ b/internal/service/memorydb/parameter_group_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -402,7 +402,7 @@ func testAccCheckParameterGroupDestroy(ctx context.Context) resource.TestCheckFu _, err := tfmemorydb.FindParameterGroupByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/memorydb/snapshot.go b/internal/service/memorydb/snapshot.go index f446dfe2320..9e0869c5caa 100644 --- a/internal/service/memorydb/snapshot.go +++ b/internal/service/memorydb/snapshot.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -189,7 +190,7 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta any) snapshot, err := findSnapshotByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MemoryDB Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -287,7 +288,7 @@ func statusSnapshot(ctx context.Context, conn *memorydb.Client, name string) sdk return func() (any, string, error) { output, err := findSnapshotByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/memorydb/snapshot_test.go b/internal/service/memorydb/snapshot_test.go index 9b66a59609f..4b9b6b13c0c 100644 --- a/internal/service/memorydb/snapshot_test.go +++ b/internal/service/memorydb/snapshot_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -244,7 +244,7 @@ func testAccCheckSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmemorydb.FindSnapshotByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/memorydb/subnet_group.go b/internal/service/memorydb/subnet_group.go index 8136ad64967..80f551c7d8c 100644 --- a/internal/service/memorydb/subnet_group.go +++ b/internal/service/memorydb/subnet_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -109,7 +110,7 @@ func resourceSubnetGroupRead(ctx context.Context, d *schema.ResourceData, meta a group, err := findSubnetGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MemoryDB Subnet Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/memorydb/subnet_group_test.go b/internal/service/memorydb/subnet_group_test.go index d0f9bb64b17..ed1aab45b2e 100644 --- a/internal/service/memorydb/subnet_group_test.go +++ b/internal/service/memorydb/subnet_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -307,7 +307,7 @@ func testAccCheckSubnetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfmemorydb.FindSubnetGroupByName(ctx, conn, rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/memorydb/user.go b/internal/service/memorydb/user.go index 62cf3d12367..4bdc857ddf2 100644 --- a/internal/service/memorydb/user.go +++ b/internal/service/memorydb/user.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -125,7 +126,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia user, err := findUserByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MemoryDB User (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -255,7 +256,7 @@ func statusUser(ctx context.Context, conn *memorydb.Client, userName string) sdk return func() (any, string, error) { user, err := findUserByName(ctx, conn, userName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/memorydb/user_test.go b/internal/service/memorydb/user_test.go index 2b9da17a435..66f8c67393b 100644 --- a/internal/service/memorydb/user_test.go +++ b/internal/service/memorydb/user_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -259,7 +259,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmemorydb.FindUserByName(ctx, conn, rs.Primary.Attributes[names.AttrUserName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 04c1f5e0d5918e59c21bb08ce1d9d9efc1617b89 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:02 -0800 Subject: [PATCH 135/227] `mq` --- internal/service/mq/broker.go | 5 +++-- internal/service/mq/broker_test.go | 4 ++-- internal/service/mq/configuration.go | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/service/mq/broker.go b/internal/service/mq/broker.go index 6ae940c0e04..663e6bd902e 100644 --- a/internal/service/mq/broker.go +++ b/internal/service/mq/broker.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" "github.com/hashicorp/terraform-provider-aws/internal/semver" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -469,7 +470,7 @@ func resourceBrokerRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findBrokerByID(ctx, conn, d.Id()) - if !d.IsNewResource() && (tfresource.NotFound(err) || errs.IsA[*types.ForbiddenException](err)) { + if !d.IsNewResource() && (retry.NotFound(err) || errs.IsA[*types.ForbiddenException](err)) { log.Printf("[WARN] MQ Broker (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -720,7 +721,7 @@ func statusBrokerState(ctx context.Context, conn *mq.Client, id string) sdkretry return func() (any, string, error) { output, err := findBrokerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/mq/broker_test.go b/internal/service/mq/broker_test.go index 16cedf4cfbb..9d6668b414e 100644 --- a/internal/service/mq/broker_test.go +++ b/internal/service/mq/broker_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfmq "github.com/hashicorp/terraform-provider-aws/internal/service/mq" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1691,7 +1691,7 @@ func testAccCheckBrokerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfmq.FindBrokerByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/mq/configuration.go b/internal/service/mq/configuration.go index ccd13ca4456..89c27d92d36 100644 --- a/internal/service/mq/configuration.go +++ b/internal/service/mq/configuration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -155,7 +156,7 @@ func resourceConfigurationRead(ctx context.Context, d *schema.ResourceData, meta configuration, err := findConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] MQ Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags From 236f51e619a2685a1d3089c2a7b193a2a46110f7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:03 -0800 Subject: [PATCH 136/227] `mwaa` --- internal/service/mwaa/environment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/mwaa/environment.go b/internal/service/mwaa/environment.go index fdab7f3fbae..bed42c6e3b8 100644 --- a/internal/service/mwaa/environment.go +++ b/internal/service/mwaa/environment.go @@ -702,7 +702,7 @@ func statusEnvironment(conn *mwaa.Client, name string) retry.StateRefreshFunc { return func(ctx context.Context) (any, string, error) { environment, err := findEnvironmentByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From fa6e04b246b81075295ecd3af7bc34126ac98249 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:04 -0800 Subject: [PATCH 137/227] `neptune` --- internal/service/neptune/cluster.go | 7 ++++--- internal/service/neptune/cluster_endpoint.go | 5 +++-- internal/service/neptune/cluster_endpoint_test.go | 4 ++-- internal/service/neptune/cluster_instance.go | 5 +++-- internal/service/neptune/cluster_instance_test.go | 4 ++-- internal/service/neptune/cluster_parameter_group.go | 3 ++- internal/service/neptune/cluster_parameter_group_test.go | 4 ++-- internal/service/neptune/cluster_snapshot.go | 5 +++-- internal/service/neptune/cluster_snapshot_test.go | 4 ++-- internal/service/neptune/cluster_test.go | 6 +++--- internal/service/neptune/event_subscription.go | 5 +++-- internal/service/neptune/event_subscription_test.go | 4 ++-- internal/service/neptune/global_cluster.go | 5 +++-- internal/service/neptune/global_cluster_test.go | 4 ++-- internal/service/neptune/parameter_group.go | 3 ++- internal/service/neptune/parameter_group_test.go | 4 ++-- internal/service/neptune/subnet_group.go | 3 ++- internal/service/neptune/subnet_group_test.go | 4 ++-- internal/service/neptune/sweep.go | 4 ++-- 19 files changed, 46 insertions(+), 37 deletions(-) diff --git a/internal/service/neptune/cluster.go b/internal/service/neptune/cluster.go index 2699aca6660..879361c285b 100644 --- a/internal/service/neptune/cluster.go +++ b/internal/service/neptune/cluster.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -538,7 +539,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) dbc, err := findDBClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -567,7 +568,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) // Ignore the following API error for regions/partitions that do not support Neptune Global Clusters: // InvalidParameterValue: Access Denied to API Version: APIGlobalDatabases - if globalCluster, err := findGlobalClusterByClusterARN(ctx, conn, aws.ToString(dbc.DBClusterArn)); tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "Access Denied to API Version: APIGlobalDatabases") { + if globalCluster, err := findGlobalClusterByClusterARN(ctx, conn, aws.ToString(dbc.DBClusterArn)); retry.NotFound(err) || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "Access Denied to API Version: APIGlobalDatabases") { d.Set("global_cluster_identifier", "") } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading Neptune Global Cluster information for Neptune Cluster (%s): %s", d.Id(), err) @@ -891,7 +892,7 @@ func statusDBCluster(ctx context.Context, conn *neptune.Client, id string, waitN return func() (any, string, error) { output, err := findDBClusterByID(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/neptune/cluster_endpoint.go b/internal/service/neptune/cluster_endpoint.go index 65dbd459ba9..39824620f13 100644 --- a/internal/service/neptune/cluster_endpoint.go +++ b/internal/service/neptune/cluster_endpoint.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -134,7 +135,7 @@ func resourceClusterEndpointRead(ctx context.Context, d *schema.ResourceData, me ep, err := findClusterEndpointByTwoPartKey(ctx, conn, clusterID, clusterEndpointID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Cluster Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -289,7 +290,7 @@ func statusClusterEndpoint(ctx context.Context, conn *neptune.Client, clusterID, return func() (any, string, error) { output, err := findClusterEndpointByTwoPartKey(ctx, conn, clusterID, clusterEndpointID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/neptune/cluster_endpoint_test.go b/internal/service/neptune/cluster_endpoint_test.go index f2be6ed108b..a8067676d06 100644 --- a/internal/service/neptune/cluster_endpoint_test.go +++ b/internal/service/neptune/cluster_endpoint_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckClusterEndpointDestroy(ctx context.Context) resource.TestCheckF _, err := tfneptune.FindClusterEndpointByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrClusterIdentifier], rs.Primary.Attributes["cluster_endpoint_identifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/cluster_instance.go b/internal/service/neptune/cluster_instance.go index 2617f00b762..a759865d01c 100644 --- a/internal/service/neptune/cluster_instance.go +++ b/internal/service/neptune/cluster_instance.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -256,7 +257,7 @@ func resourceClusterInstanceRead(ctx context.Context, d *schema.ResourceData, me db, err := findDBInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Cluster Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -461,7 +462,7 @@ func statusDBInstance(ctx context.Context, conn *neptune.Client, id string) sdkr return func() (any, string, error) { output, err := findDBInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/neptune/cluster_instance_test.go b/internal/service/neptune/cluster_instance_test.go index dc6e5bf3118..d72fdbd4020 100644 --- a/internal/service/neptune/cluster_instance_test.go +++ b/internal/service/neptune/cluster_instance_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -323,7 +323,7 @@ func testAccCheckClusterInstanceDestroy(ctx context.Context) resource.TestCheckF _, err := tfneptune.FindDBInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/cluster_parameter_group.go b/internal/service/neptune/cluster_parameter_group.go index b573ee081f3..8b90cb8e239 100644 --- a/internal/service/neptune/cluster_parameter_group.go +++ b/internal/service/neptune/cluster_parameter_group.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -134,7 +135,7 @@ func resourceClusterParameterGroupRead(ctx context.Context, d *schema.ResourceDa dbClusterParameterGroup, err := findDBClusterParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Cluster Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/neptune/cluster_parameter_group_test.go b/internal/service/neptune/cluster_parameter_group_test.go index f304506fc90..a8a8974bc61 100644 --- a/internal/service/neptune/cluster_parameter_group_test.go +++ b/internal/service/neptune/cluster_parameter_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -295,7 +295,7 @@ func testAccCheckClusterParameterGroupDestroy(ctx context.Context) resource.Test _, err := tfneptune.FindDBClusterParameterGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/cluster_snapshot.go b/internal/service/neptune/cluster_snapshot.go index 2f6799e09cb..09bbcf1c83d 100644 --- a/internal/service/neptune/cluster_snapshot.go +++ b/internal/service/neptune/cluster_snapshot.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +136,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me snapshot, err := findClusterSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Cluster Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -242,7 +243,7 @@ func statusClusterSnapshot(ctx context.Context, conn *neptune.Client, id string) return func() (any, string, error) { output, err := findClusterSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/neptune/cluster_snapshot_test.go b/internal/service/neptune/cluster_snapshot_test.go index e313040c6e5..be1b151ec99 100644 --- a/internal/service/neptune/cluster_snapshot_test.go +++ b/internal/service/neptune/cluster_snapshot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func testAccCheckClusterSnapshotDestroy(ctx context.Context) resource.TestCheckF _, err := tfneptune.FindClusterSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/cluster_test.go b/internal/service/neptune/cluster_test.go index 5358e581372..7450d0bdfc8 100644 --- a/internal/service/neptune/cluster_test.go +++ b/internal/service/neptune/cluster_test.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -986,7 +986,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfneptune.FindDBClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1052,7 +1052,7 @@ func testAccCheckClusterDestroyWithFinalSnapshot(ctx context.Context) resource.T _, err = tfneptune.FindDBClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/event_subscription.go b/internal/service/neptune/event_subscription.go index ebfa57b3c4e..f3960fdb8bd 100644 --- a/internal/service/neptune/event_subscription.go +++ b/internal/service/neptune/event_subscription.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -148,7 +149,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, output, err := findEventSubscriptionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Event Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -334,7 +335,7 @@ func statusEventSubscription(ctx context.Context, conn *neptune.Client, name str return func() (any, string, error) { output, err := findEventSubscriptionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/neptune/event_subscription_test.go b/internal/service/neptune/event_subscription_test.go index 24116946f67..6f2d1b33a96 100644 --- a/internal/service/neptune/event_subscription_test.go +++ b/internal/service/neptune/event_subscription_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -284,7 +284,7 @@ func testAccCheckEventSubscriptionDestroy(ctx context.Context) resource.TestChec _, err := tfneptune.FindEventSubscriptionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/global_cluster.go b/internal/service/neptune/global_cluster.go index ddd88f2aba2..68440a746d1 100644 --- a/internal/service/neptune/global_cluster.go +++ b/internal/service/neptune/global_cluster.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func resourceGlobalClusterRead(ctx context.Context, d *schema.ResourceData, meta globalCluster, err := findGlobalClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Global Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -610,7 +611,7 @@ func statusGlobalCluster(ctx context.Context, conn *neptune.Client, id string) s return func() (any, string, error) { output, err := findGlobalClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/neptune/global_cluster_test.go b/internal/service/neptune/global_cluster_test.go index 1ccbcc4732c..a9295633600 100644 --- a/internal/service/neptune/global_cluster_test.go +++ b/internal/service/neptune/global_cluster_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -347,7 +347,7 @@ func testAccCheckGlobalClusterDestroy(ctx context.Context) resource.TestCheckFun _, err := tfneptune.FindGlobalClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/parameter_group.go b/internal/service/neptune/parameter_group.go index 1a884d96d25..ff81f2afdce 100644 --- a/internal/service/neptune/parameter_group.go +++ b/internal/service/neptune/parameter_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -140,7 +141,7 @@ func resourceParameterGroupRead(ctx context.Context, d *schema.ResourceData, met dbParameterGroup, err := findDBParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/neptune/parameter_group_test.go b/internal/service/neptune/parameter_group_test.go index 2e1e5640912..906ca361e0e 100644 --- a/internal/service/neptune/parameter_group_test.go +++ b/internal/service/neptune/parameter_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -271,7 +271,7 @@ func testAccCheckParameterGroupDestroy(ctx context.Context) resource.TestCheckFu _, err := tfneptune.FindDBParameterGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/subnet_group.go b/internal/service/neptune/subnet_group.go index 8d1dc49bf22..023dff903d2 100644 --- a/internal/service/neptune/subnet_group.go +++ b/internal/service/neptune/subnet_group.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -103,7 +104,7 @@ func resourceSubnetGroupRead(ctx context.Context, d *schema.ResourceData, meta a subnetGroup, err := findSubnetGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Neptune Subnet Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/neptune/subnet_group_test.go b/internal/service/neptune/subnet_group_test.go index 638feb81549..6fd18fd4779 100644 --- a/internal/service/neptune/subnet_group_test.go +++ b/internal/service/neptune/subnet_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -225,7 +225,7 @@ func testAccCheckSubnetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfneptune.FindSubnetGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/neptune/sweep.go b/internal/service/neptune/sweep.go index 7626594e205..7a118377d97 100644 --- a/internal/service/neptune/sweep.go +++ b/internal/service/neptune/sweep.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/neptune" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func sweepClusters(region string) error { globalCluster, err := findGlobalClusterByClusterARN(ctx, conn, arn) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { log.Printf("[WARN] Reading Neptune Cluster %s Global Cluster information: %s", id, err) continue } From f5aaf305486739c9181c0bdf60a56f2d4a40301c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:04 -0800 Subject: [PATCH 138/227] `neptunegraph` --- internal/service/neptunegraph/graph.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/neptunegraph/graph.go b/internal/service/neptunegraph/graph.go index 3e7cdd008b1..f9ac4b7e67f 100644 --- a/internal/service/neptunegraph/graph.go +++ b/internal/service/neptunegraph/graph.go @@ -378,7 +378,7 @@ func statusGraph(conn *neptunegraph.Client, id string) retry.StateRefreshFunc { return func(ctx context.Context) (any, string, error) { output, err := findGraphByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From f38eccad33ecb2fdc9b4d1ff00c312792511081b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:05 -0800 Subject: [PATCH 139/227] `networkfirewall` --- internal/service/networkfirewall/firewall.go | 7 ++++--- internal/service/networkfirewall/firewall_policy.go | 5 +++-- internal/service/networkfirewall/firewall_policy_test.go | 4 ++-- internal/service/networkfirewall/firewall_test.go | 4 ++-- .../firewall_transit_gateway_attachment_accepter.go | 3 ++- .../firewall_transit_gateway_attachment_accepter_test.go | 4 ++-- internal/service/networkfirewall/logging_configuration.go | 5 +++-- .../service/networkfirewall/logging_configuration_test.go | 4 ++-- internal/service/networkfirewall/resource_policy.go | 3 ++- internal/service/networkfirewall/resource_policy_test.go | 4 ++-- internal/service/networkfirewall/rule_group.go | 5 +++-- internal/service/networkfirewall/rule_group_test.go | 4 ++-- .../networkfirewall/tls_inspection_configuration.go | 7 ++++--- .../networkfirewall/tls_inspection_configuration_test.go | 4 ++-- .../service/networkfirewall/vpc_endpoint_association.go | 5 +++-- .../networkfirewall/vpc_endpoint_association_test.go | 4 ++-- 16 files changed, 40 insertions(+), 32 deletions(-) diff --git a/internal/service/networkfirewall/firewall.go b/internal/service/networkfirewall/firewall.go index ed4ea11d3fc..ae7f3f68ad8 100644 --- a/internal/service/networkfirewall/firewall.go +++ b/internal/service/networkfirewall/firewall.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -286,7 +287,7 @@ func resourceFirewallRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findFirewallByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] NetworkFirewall Firewall (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -624,7 +625,7 @@ func statusFirewall(ctx context.Context, conn *networkfirewall.Client, arn strin return func() (any, string, error) { output, err := findFirewallByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -640,7 +641,7 @@ func statusFirewallTransitGatewayAttachment(ctx context.Context, conn *networkfi return func() (any, string, error) { output, err := findFirewallByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkfirewall/firewall_policy.go b/internal/service/networkfirewall/firewall_policy.go index 7c576490a8a..a77d80e67bc 100644 --- a/internal/service/networkfirewall/firewall_policy.go +++ b/internal/service/networkfirewall/firewall_policy.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -274,7 +275,7 @@ func resourceFirewallPolicyRead(ctx context.Context, d *schema.ResourceData, met output, err := findFirewallPolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] NetworkFirewall Firewall Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -390,7 +391,7 @@ func statusFirewallPolicy(ctx context.Context, conn *networkfirewall.Client, arn return func() (any, string, error) { output, err := findFirewallPolicyByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkfirewall/firewall_policy_test.go b/internal/service/networkfirewall/firewall_policy_test.go index bfa7dc80506..cb9511282d4 100644 --- a/internal/service/networkfirewall/firewall_policy_test.go +++ b/internal/service/networkfirewall/firewall_policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1212,7 +1212,7 @@ func testAccCheckFirewallPolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfnetworkfirewall.FindFirewallPolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/firewall_test.go b/internal/service/networkfirewall/firewall_test.go index b0d79dba9ee..2361d99d6be 100644 --- a/internal/service/networkfirewall/firewall_test.go +++ b/internal/service/networkfirewall/firewall_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -594,7 +594,7 @@ func testAccCheckFirewallDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkfirewall.FindFirewallByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter.go b/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter.go index 917d05d8b92..5d29a9cf18c 100644 --- a/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter.go +++ b/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -108,7 +109,7 @@ func (r *firewallTransitGatewayAttachmentAccepterResource) Read(ctx context.Cont err = tfresource.NewEmptyResultError(tgwAttachmentID) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter_test.go b/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter_test.go index 107823c4804..dfdd3eb0ef4 100644 --- a/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter_test.go +++ b/internal/service/networkfirewall/firewall_transit_gateway_attachment_accepter_test.go @@ -15,9 +15,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckFirewallTransitGatewayAttachmentAccepterDestroy(ctx context.Con output, err := tfec2.FindTransitGatewayAttachmentByID(ctx, conn, rs.Primary.Attributes[names.AttrTransitGatewayAttachmentID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/logging_configuration.go b/internal/service/networkfirewall/logging_configuration.go index 0e07e8d29cd..7a5a80ccaaf 100644 --- a/internal/service/networkfirewall/logging_configuration.go +++ b/internal/service/networkfirewall/logging_configuration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -153,7 +154,7 @@ func resourceLoggingConfigurationRead(ctx context.Context, d *schema.ResourceDat output, err := findLoggingConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] NetworkFirewall Logging Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -223,7 +224,7 @@ func resourceLoggingConfigurationDelete(ctx context.Context, d *schema.ResourceD output, err := findLoggingConfigurationByARN(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/networkfirewall/logging_configuration_test.go b/internal/service/networkfirewall/logging_configuration_test.go index a98bb142fc8..8970f8317bd 100644 --- a/internal/service/networkfirewall/logging_configuration_test.go +++ b/internal/service/networkfirewall/logging_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -889,7 +889,7 @@ func testAccCheckLoggingConfigurationDestroy(ctx context.Context) resource.TestC _, err := tfnetworkfirewall.FindLoggingConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/resource_policy.go b/internal/service/networkfirewall/resource_policy.go index 4eed9eebdbd..f48e22432da 100644 --- a/internal/service/networkfirewall/resource_policy.go +++ b/internal/service/networkfirewall/resource_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -82,7 +83,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met policy, err := findResourcePolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] NetworkFirewall Resource Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/networkfirewall/resource_policy_test.go b/internal/service/networkfirewall/resource_policy_test.go index 09721d48099..b537aff0c8c 100644 --- a/internal/service/networkfirewall/resource_policy_test.go +++ b/internal/service/networkfirewall/resource_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -203,7 +203,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfnetworkfirewall.FindResourcePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/rule_group.go b/internal/service/networkfirewall/rule_group.go index c401b068a41..a305cbcd07d 100644 --- a/internal/service/networkfirewall/rule_group.go +++ b/internal/service/networkfirewall/rule_group.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -517,7 +518,7 @@ func resourceRuleGroupRead(ctx context.Context, d *schema.ResourceData, meta any err = tfresource.NewEmptyResultError(d.Id()) } - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] NetworkFirewall Rule Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -653,7 +654,7 @@ func statusRuleGroup(ctx context.Context, conn *networkfirewall.Client, arn stri return func() (any, string, error) { output, err := findRuleGroupByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkfirewall/rule_group_test.go b/internal/service/networkfirewall/rule_group_test.go index 438f0a11e83..659638485b6 100644 --- a/internal/service/networkfirewall/rule_group_test.go +++ b/internal/service/networkfirewall/rule_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1077,7 +1077,7 @@ func testAccCheckRuleGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkfirewall.FindRuleGroupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/tls_inspection_configuration.go b/internal/service/networkfirewall/tls_inspection_configuration.go index fdf3e31996e..8cbfe53b8a2 100644 --- a/internal/service/networkfirewall/tls_inspection_configuration.go +++ b/internal/service/networkfirewall/tls_inspection_configuration.go @@ -35,6 +35,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -342,7 +343,7 @@ func (r *tlsInspectionConfigurationResource) Read(ctx context.Context, request r output, err := findTLSInspectionConfigurationByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -490,7 +491,7 @@ func statusTLSInspectionConfiguration(ctx context.Context, conn *networkfirewall return func() (any, string, error) { output, err := findTLSInspectionConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -510,7 +511,7 @@ func statusTLSInspectionConfigurationCertificates(ctx context.Context, conn *net return func() (any, string, error) { output, err := findTLSInspectionConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkfirewall/tls_inspection_configuration_test.go b/internal/service/networkfirewall/tls_inspection_configuration_test.go index 945c447e85b..3b238ab5c5b 100644 --- a/internal/service/networkfirewall/tls_inspection_configuration_test.go +++ b/internal/service/networkfirewall/tls_inspection_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -331,7 +331,7 @@ func testAccCheckTLSInspectionConfigurationDestroy(ctx context.Context) resource _, err := tfnetworkfirewall.FindTLSInspectionConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkfirewall/vpc_endpoint_association.go b/internal/service/networkfirewall/vpc_endpoint_association.go index b42a26af44a..9a2bb0c86a3 100644 --- a/internal/service/networkfirewall/vpc_endpoint_association.go +++ b/internal/service/networkfirewall/vpc_endpoint_association.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -191,7 +192,7 @@ func (r *vpcEndpointAssociationResource) Read(ctx context.Context, request resou arn := fwflex.StringValueFromFramework(ctx, data.VPCEndpointAssociationARN) output, err := findVPCEndpointAssociationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -289,7 +290,7 @@ func statusVPCEndpointAssociation(ctx context.Context, conn *networkfirewall.Cli return func() (any, string, error) { output, err := findVPCEndpointAssociationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkfirewall/vpc_endpoint_association_test.go b/internal/service/networkfirewall/vpc_endpoint_association_test.go index 13fb263b180..6a777b09eb0 100644 --- a/internal/service/networkfirewall/vpc_endpoint_association_test.go +++ b/internal/service/networkfirewall/vpc_endpoint_association_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -249,7 +249,7 @@ func testAccCheckVPCEndpointAssociationDestroy(ctx context.Context) resource.Tes _, err := tfnetworkfirewall.FindVPCEndpointAssociationByARN(ctx, conn, rs.Primary.Attributes["vpc_endpoint_association_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From da589e83a1f197224126155a04eaaa04bb4c2b0c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:06 -0800 Subject: [PATCH 140/227] `networkflowmonitor` --- internal/service/networkflowmonitor/monitor.go | 5 +++-- internal/service/networkflowmonitor/monitor_test.go | 4 ++-- internal/service/networkflowmonitor/scope.go | 5 +++-- internal/service/networkflowmonitor/scope_test.go | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/service/networkflowmonitor/monitor.go b/internal/service/networkflowmonitor/monitor.go index c5d9532319b..b5b0994974e 100644 --- a/internal/service/networkflowmonitor/monitor.go +++ b/internal/service/networkflowmonitor/monitor.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -170,7 +171,7 @@ func (r *monitorResource) Read(ctx context.Context, request resource.ReadRequest monitorName := fwflex.StringValueFromFramework(ctx, data.MonitorName) output, err := findMonitorByName(ctx, conn, monitorName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -332,7 +333,7 @@ func statusMonitor(ctx context.Context, conn *networkflowmonitor.Client, name st return func() (any, string, error) { output, err := findMonitorByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkflowmonitor/monitor_test.go b/internal/service/networkflowmonitor/monitor_test.go index cddc4e7454d..7cf122e1a25 100644 --- a/internal/service/networkflowmonitor/monitor_test.go +++ b/internal/service/networkflowmonitor/monitor_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkflowmonitor "github.com/hashicorp/terraform-provider-aws/internal/service/networkflowmonitor" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -281,7 +281,7 @@ func testAccCheckMonitorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkflowmonitor.FindMonitorByName(ctx, conn, rs.Primary.Attributes["monitor_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkflowmonitor/scope.go b/internal/service/networkflowmonitor/scope.go index 6d09cccf1be..921e7fca970 100644 --- a/internal/service/networkflowmonitor/scope.go +++ b/internal/service/networkflowmonitor/scope.go @@ -30,6 +30,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -177,7 +178,7 @@ func (r *scopeResource) Read(ctx context.Context, request resource.ReadRequest, scopeID := fwflex.StringValueFromFramework(ctx, data.ScopeID) output, err := findScopeByID(ctx, conn, scopeID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -322,7 +323,7 @@ func statusScope(ctx context.Context, conn *networkflowmonitor.Client, id string return func() (any, string, error) { output, err := findScopeByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkflowmonitor/scope_test.go b/internal/service/networkflowmonitor/scope_test.go index 6c8d5f604f0..750d5d5767b 100644 --- a/internal/service/networkflowmonitor/scope_test.go +++ b/internal/service/networkflowmonitor/scope_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkflowmonitor "github.com/hashicorp/terraform-provider-aws/internal/service/networkflowmonitor" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -200,7 +200,7 @@ func testAccCheckScopeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkflowmonitor.FindScopeByID(ctx, conn, rs.Primary.Attributes["scope_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 0265381e08943cfb8986436a4ba12898b0f5f728 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:07 -0800 Subject: [PATCH 141/227] `networkmanager` --- .../service/networkmanager/attachment_accepter.go | 12 ++++++------ .../service/networkmanager/connect_attachment.go | 5 +++-- .../networkmanager/connect_attachment_test.go | 4 ++-- internal/service/networkmanager/connect_peer.go | 5 +++-- internal/service/networkmanager/connect_peer_test.go | 4 ++-- internal/service/networkmanager/connection.go | 5 +++-- internal/service/networkmanager/connection_test.go | 4 ++-- internal/service/networkmanager/core_network.go | 7 ++++--- .../networkmanager/core_network_policy_attachment.go | 6 +++--- internal/service/networkmanager/core_network_test.go | 4 ++-- .../networkmanager/customer_gateway_association.go | 5 +++-- .../customer_gateway_association_test.go | 4 ++-- internal/service/networkmanager/device.go | 5 +++-- internal/service/networkmanager/device_test.go | 4 ++-- .../service/networkmanager/dx_gateway_attachment.go | 5 +++-- .../networkmanager/dx_gateway_attachment_test.go | 4 ++-- internal/service/networkmanager/global_network.go | 11 ++++++----- .../service/networkmanager/global_network_test.go | 4 ++-- internal/service/networkmanager/link.go | 5 +++-- internal/service/networkmanager/link_association.go | 5 +++-- .../service/networkmanager/link_association_test.go | 4 ++-- internal/service/networkmanager/link_test.go | 4 ++-- internal/service/networkmanager/site.go | 5 +++-- internal/service/networkmanager/site_test.go | 4 ++-- .../networkmanager/site_to_site_vpn_attachment.go | 5 +++-- .../site_to_site_vpn_attachment_test.go | 4 ++-- .../transit_gateway_connect_peer_association.go | 5 +++-- .../transit_gateway_connect_peer_association_test.go | 4 ++-- .../networkmanager/transit_gateway_peering.go | 5 +++-- .../networkmanager/transit_gateway_peering_test.go | 4 ++-- .../networkmanager/transit_gateway_registration.go | 5 +++-- .../transit_gateway_registration_test.go | 4 ++-- .../transit_gateway_route_table_attachment.go | 5 +++-- .../transit_gateway_route_table_attachment_test.go | 4 ++-- internal/service/networkmanager/vpc_attachment.go | 5 +++-- .../service/networkmanager/vpc_attachment_test.go | 4 ++-- 36 files changed, 98 insertions(+), 81 deletions(-) diff --git a/internal/service/networkmanager/attachment_accepter.go b/internal/service/networkmanager/attachment_accepter.go index 062e2e10c8c..a835424414b 100644 --- a/internal/service/networkmanager/attachment_accepter.go +++ b/internal/service/networkmanager/attachment_accepter.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -211,7 +211,7 @@ func resourceAttachmentAccepterRead(ctx context.Context, d *schema.ResourceData, case awstypes.AttachmentTypeVpc: vpcAttachment, err := findVPCAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager VPC Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -228,7 +228,7 @@ func resourceAttachmentAccepterRead(ctx context.Context, d *schema.ResourceData, case awstypes.AttachmentTypeSiteToSiteVpn: vpnAttachment, err := findSiteToSiteVPNAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Site To Site VPN Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -245,7 +245,7 @@ func resourceAttachmentAccepterRead(ctx context.Context, d *schema.ResourceData, case awstypes.AttachmentTypeConnect: connectAttachment, err := findConnectAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Connect Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -262,7 +262,7 @@ func resourceAttachmentAccepterRead(ctx context.Context, d *schema.ResourceData, case awstypes.AttachmentTypeTransitGatewayRouteTable: tgwAttachment, err := findTransitGatewayRouteTableAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Transit Gateway Route Table Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -279,7 +279,7 @@ func resourceAttachmentAccepterRead(ctx context.Context, d *schema.ResourceData, case awstypes.AttachmentTypeDirectConnectGateway: dxgwAttachment, err := findDirectConnectGatewayAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Direct Connect Gateway Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/networkmanager/connect_attachment.go b/internal/service/networkmanager/connect_attachment.go index 96c950860ef..bd599493986 100644 --- a/internal/service/networkmanager/connect_attachment.go +++ b/internal/service/networkmanager/connect_attachment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -199,7 +200,7 @@ func resourceConnectAttachmentRead(ctx context.Context, d *schema.ResourceData, connectAttachment, err := findConnectAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Connect Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -309,7 +310,7 @@ func statusConnectAttachment(ctx context.Context, conn *networkmanager.Client, i return func() (any, string, error) { output, err := findConnectAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/connect_attachment_test.go b/internal/service/networkmanager/connect_attachment_test.go index 2b07dce204c..c8e1141a413 100644 --- a/internal/service/networkmanager/connect_attachment_test.go +++ b/internal/service/networkmanager/connect_attachment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -187,7 +187,7 @@ func testAccCheckConnectAttachmentDestroy(ctx context.Context) resource.TestChec _, err := tfnetworkmanager.FindConnectAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/connect_peer.go b/internal/service/networkmanager/connect_peer.go index 9807f69fe0e..9509954d211 100644 --- a/internal/service/networkmanager/connect_peer.go +++ b/internal/service/networkmanager/connect_peer.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -261,7 +262,7 @@ func resourceConnectPeerRead(ctx context.Context, d *schema.ResourceData, meta a connectPeer, err := findConnectPeerByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Connect Peer %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -410,7 +411,7 @@ func statusConnectPeerState(ctx context.Context, conn *networkmanager.Client, id return func() (any, string, error) { output, err := findConnectPeerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/connect_peer_test.go b/internal/service/networkmanager/connect_peer_test.go index 8855d7d1165..a79e71d0cba 100644 --- a/internal/service/networkmanager/connect_peer_test.go +++ b/internal/service/networkmanager/connect_peer_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +188,7 @@ func testAccCheckConnectPeerDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfnetworkmanager.FindConnectPeerByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/connection.go b/internal/service/networkmanager/connection.go index e08d284afd1..5da937307f2 100644 --- a/internal/service/networkmanager/connection.go +++ b/internal/service/networkmanager/connection.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -156,7 +157,7 @@ func resourceConnectionRead(ctx context.Context, d *schema.ResourceData, meta an globalNetworkID := d.Get("global_network_id").(string) connection, err := findConnectionByTwoPartKey(ctx, conn, globalNetworkID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Connection %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -306,7 +307,7 @@ func statusConnectionState(ctx context.Context, conn *networkmanager.Client, glo return func() (any, string, error) { output, err := findConnectionByTwoPartKey(ctx, conn, globalNetworkID, connectionID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/connection_test.go b/internal/service/networkmanager/connection_test.go index 4e0ae0efca7..699cf4ae499 100644 --- a/internal/service/networkmanager/connection_test.go +++ b/internal/service/networkmanager/connection_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func testAccCheckConnectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkmanager.FindConnectionByTwoPartKey(ctx, conn, rs.Primary.Attributes["global_network_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/core_network.go b/internal/service/networkmanager/core_network.go index b2fc6fd56c7..2ab7e7658d9 100644 --- a/internal/service/networkmanager/core_network.go +++ b/internal/service/networkmanager/core_network.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -225,7 +226,7 @@ func resourceCoreNetworkRead(ctx context.Context, d *schema.ResourceData, meta a coreNetwork, err := findCoreNetworkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Core Network %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -387,7 +388,7 @@ func statusCoreNetworkState(ctx context.Context, conn *networkmanager.Client, id return func() (any, string, error) { output, err := findCoreNetworkByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -554,7 +555,7 @@ func statusCoreNetworkPolicyState(ctx context.Context, conn *networkmanager.Clie return func() (any, string, error) { output, err := findCoreNetworkPolicyByTwoPartKey(ctx, conn, coreNetworkId, policyVersionId) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/core_network_policy_attachment.go b/internal/service/networkmanager/core_network_policy_attachment.go index 6c2162854f8..e6394c754b3 100644 --- a/internal/service/networkmanager/core_network_policy_attachment.go +++ b/internal/service/networkmanager/core_network_policy_attachment.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -81,7 +81,7 @@ func resourceCoreNetworkPolicyAttachmentRead(ctx context.Context, d *schema.Reso coreNetwork, err := findCoreNetworkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Core Network %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -98,7 +98,7 @@ func resourceCoreNetworkPolicyAttachmentRead(ctx context.Context, d *schema.Reso // pass in latestPolicyVersionId to get the latest version id by default coreNetworkPolicy, err := findCoreNetworkPolicyByTwoPartKey(ctx, conn, d.Id(), aws.Int32(latestPolicyVersionID)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { d.Set("policy_document", nil) } else if err != nil { return sdkdiag.AppendErrorf(diags, "reading Network Manager Core Network (%s) policy: %s", d.Id(), err) diff --git a/internal/service/networkmanager/core_network_test.go b/internal/service/networkmanager/core_network_test.go index 90bf3704283..8db08e8e788 100644 --- a/internal/service/networkmanager/core_network_test.go +++ b/internal/service/networkmanager/core_network_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -292,7 +292,7 @@ func testAccCheckCoreNetworkDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfnetworkmanager.FindCoreNetworkByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/customer_gateway_association.go b/internal/service/networkmanager/customer_gateway_association.go index 541e3d37d57..a594777ec2d 100644 --- a/internal/service/networkmanager/customer_gateway_association.go +++ b/internal/service/networkmanager/customer_gateway_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -136,7 +137,7 @@ func resourceCustomerGatewayAssociationRead(ctx context.Context, d *schema.Resou output, err := findCustomerGatewayAssociationByTwoPartKey(ctx, conn, globalNetworkID, customerGatewayARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Customer Gateway Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -273,7 +274,7 @@ func statusCustomerGatewayAssociationState(ctx context.Context, conn *networkman return func() (any, string, error) { output, err := findCustomerGatewayAssociationByTwoPartKey(ctx, conn, globalNetworkID, customerGatewayARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/customer_gateway_association_test.go b/internal/service/networkmanager/customer_gateway_association_test.go index 6a46b898fd7..5b04796af56 100644 --- a/internal/service/networkmanager/customer_gateway_association_test.go +++ b/internal/service/networkmanager/customer_gateway_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func testAccCheckCustomerGatewayAssociationDestroy(ctx context.Context) resource _, err = tfnetworkmanager.FindCustomerGatewayAssociationByTwoPartKey(ctx, conn, globalNetworkID, customerGatewayARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/device.go b/internal/service/networkmanager/device.go index 2e1ad3c78a7..e5047c61dec 100644 --- a/internal/service/networkmanager/device.go +++ b/internal/service/networkmanager/device.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -224,7 +225,7 @@ func resourceDeviceRead(ctx context.Context, d *schema.ResourceData, meta any) d globalNetworkID := d.Get("global_network_id").(string) device, err := findDeviceByTwoPartKey(ctx, conn, globalNetworkID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Device %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -400,7 +401,7 @@ func statusDeviceState(ctx context.Context, conn *networkmanager.Client, globalN return func() (any, string, error) { output, err := findDeviceByTwoPartKey(ctx, conn, globalNetworkID, deviceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/device_test.go b/internal/service/networkmanager/device_test.go index 19512192ccf..d7a968130dd 100644 --- a/internal/service/networkmanager/device_test.go +++ b/internal/service/networkmanager/device_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +184,7 @@ func testAccCheckDeviceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkmanager.FindDeviceByTwoPartKey(ctx, conn, rs.Primary.Attributes["global_network_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/dx_gateway_attachment.go b/internal/service/networkmanager/dx_gateway_attachment.go index 81a9777e8ec..20701f0885d 100644 --- a/internal/service/networkmanager/dx_gateway_attachment.go +++ b/internal/service/networkmanager/dx_gateway_attachment.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -183,7 +184,7 @@ func (r *directConnectGatewayAttachmentResource) Read(ctx context.Context, reque dxgwAttachment, err := findDirectConnectGatewayAttachmentByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -344,7 +345,7 @@ func statusDirectConnectGatewayAttachment(ctx context.Context, conn *networkmana return func() (any, string, error) { output, err := findDirectConnectGatewayAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/dx_gateway_attachment_test.go b/internal/service/networkmanager/dx_gateway_attachment_test.go index 39d1518b46f..3cda95b358b 100644 --- a/internal/service/networkmanager/dx_gateway_attachment_test.go +++ b/internal/service/networkmanager/dx_gateway_attachment_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -225,7 +225,7 @@ func testAccCheckDirectConnectGatewayAttachmentDestroy(ctx context.Context) reso _, err := tfnetworkmanager.FindDirectConnectGatewayAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/global_network.go b/internal/service/networkmanager/global_network.go index fdf85b9b38d..b87638cd5bb 100644 --- a/internal/service/networkmanager/global_network.go +++ b/internal/service/networkmanager/global_network.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -97,7 +98,7 @@ func resourceGlobalNetworkRead(ctx context.Context, d *schema.ResourceData, meta globalNetwork, err := findGlobalNetworkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Global Network %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -196,7 +197,7 @@ func deregisterTransitGateways(ctx context.Context, conn *networkmanager.Client, GlobalNetworkId: aws.String(globalNetworkID), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { err = nil } @@ -226,7 +227,7 @@ func disassociateCustomerGateways(ctx context.Context, conn *networkmanager.Clie GlobalNetworkId: aws.String(globalNetworkID), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { err = nil } @@ -256,7 +257,7 @@ func disassociateTransitGatewayConnectPeers(ctx context.Context, conn *networkma GlobalNetworkId: aws.String(globalNetworkID), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { err = nil } @@ -343,7 +344,7 @@ func statusGlobalNetworkState(ctx context.Context, conn *networkmanager.Client, return func() (any, string, error) { output, err := findGlobalNetworkByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/global_network_test.go b/internal/service/networkmanager/global_network_test.go index f57542435e8..64943380e87 100644 --- a/internal/service/networkmanager/global_network_test.go +++ b/internal/service/networkmanager/global_network_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func testAccCheckGlobalNetworkDestroy(ctx context.Context) resource.TestCheckFun _, err := tfnetworkmanager.FindGlobalNetworkByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/link.go b/internal/service/networkmanager/link.go index 8b744187759..4d9d372ce45 100644 --- a/internal/service/networkmanager/link.go +++ b/internal/service/networkmanager/link.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -172,7 +173,7 @@ func resourceLinkRead(ctx context.Context, d *schema.ResourceData, meta any) dia globalNetworkID := d.Get("global_network_id").(string) link, err := findLinkByTwoPartKey(ctx, conn, globalNetworkID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Link %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -331,7 +332,7 @@ func statusLinkState(ctx context.Context, conn *networkmanager.Client, globalNet return func() (any, string, error) { output, err := findLinkByTwoPartKey(ctx, conn, globalNetworkID, linkID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/link_association.go b/internal/service/networkmanager/link_association.go index 9abfb093b1a..a868757fa6e 100644 --- a/internal/service/networkmanager/link_association.go +++ b/internal/service/networkmanager/link_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -103,7 +104,7 @@ func resourceLinkAssociationRead(ctx context.Context, d *schema.ResourceData, me output, err := findLinkAssociationByThreePartKey(ctx, conn, globalNetworkID, linkID, deviceID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Link Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -229,7 +230,7 @@ func statusLinkAssociationState(ctx context.Context, conn *networkmanager.Client return func() (any, string, error) { output, err := findLinkAssociationByThreePartKey(ctx, conn, globalNetworkID, linkID, deviceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/link_association_test.go b/internal/service/networkmanager/link_association_test.go index 723dd2ee918..fc7b9f33a0e 100644 --- a/internal/service/networkmanager/link_association_test.go +++ b/internal/service/networkmanager/link_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +84,7 @@ func testAccCheckLinkAssociationDestroy(ctx context.Context) resource.TestCheckF _, err = tfnetworkmanager.FindLinkAssociationByThreePartKey(ctx, conn, globalNetworkID, linkID, deviceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/link_test.go b/internal/service/networkmanager/link_test.go index be1454e9882..7960e0be92c 100644 --- a/internal/service/networkmanager/link_test.go +++ b/internal/service/networkmanager/link_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckLinkDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkmanager.FindLinkByTwoPartKey(ctx, conn, rs.Primary.Attributes["global_network_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/site.go b/internal/service/networkmanager/site.go index 9e195453fe0..85ed98ee248 100644 --- a/internal/service/networkmanager/site.go +++ b/internal/service/networkmanager/site.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -155,7 +156,7 @@ func resourceSiteRead(ctx context.Context, d *schema.ResourceData, meta any) dia globalNetworkID := d.Get("global_network_id").(string) site, err := findSiteByTwoPartKey(ctx, conn, globalNetworkID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Site %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -320,7 +321,7 @@ func statusSiteState(ctx context.Context, conn *networkmanager.Client, globalNet return func() (any, string, error) { output, err := findSiteByTwoPartKey(ctx, conn, globalNetworkID, siteID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/site_test.go b/internal/service/networkmanager/site_test.go index ebc073f6640..a9548984951 100644 --- a/internal/service/networkmanager/site_test.go +++ b/internal/service/networkmanager/site_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +159,7 @@ func testAccCheckSiteDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkmanager.FindSiteByTwoPartKey(ctx, conn, rs.Primary.Attributes["global_network_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/site_to_site_vpn_attachment.go b/internal/service/networkmanager/site_to_site_vpn_attachment.go index f44195d6f0d..f8934cc045e 100644 --- a/internal/service/networkmanager/site_to_site_vpn_attachment.go +++ b/internal/service/networkmanager/site_to_site_vpn_attachment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -135,7 +136,7 @@ func resourceSiteToSiteVPNAttachmentRead(ctx context.Context, d *schema.Resource vpnAttachment, err := findSiteToSiteVPNAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Site To Site VPN Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -237,7 +238,7 @@ func statusSiteToSiteVPNAttachment(ctx context.Context, conn *networkmanager.Cli return func() (any, string, error) { output, err := findSiteToSiteVPNAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/site_to_site_vpn_attachment_test.go b/internal/service/networkmanager/site_to_site_vpn_attachment_test.go index 3d693201ee0..f6e55cc5f87 100644 --- a/internal/service/networkmanager/site_to_site_vpn_attachment_test.go +++ b/internal/service/networkmanager/site_to_site_vpn_attachment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +128,7 @@ func testAccCheckSiteToSiteVPNAttachmentDestroy(ctx context.Context) resource.Te _, err := tfnetworkmanager.FindSiteToSiteVPNAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/transit_gateway_connect_peer_association.go b/internal/service/networkmanager/transit_gateway_connect_peer_association.go index 91bdf47fb2b..0b24a4c66ac 100644 --- a/internal/service/networkmanager/transit_gateway_connect_peer_association.go +++ b/internal/service/networkmanager/transit_gateway_connect_peer_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -113,7 +114,7 @@ func resourceTransitGatewayConnectPeerAssociationRead(ctx context.Context, d *sc output, err := findTransitGatewayConnectPeerAssociationByTwoPartKey(ctx, conn, globalNetworkID, connectPeerARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Transit Gateway Connect Peer Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -250,7 +251,7 @@ func statusTransitGatewayConnectPeerAssociationState(ctx context.Context, conn * return func() (any, string, error) { output, err := findTransitGatewayConnectPeerAssociationByTwoPartKey(ctx, conn, globalNetworkID, connectPeerARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go b/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go index 07d577f9129..9b406a53822 100644 --- a/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go +++ b/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckTransitGatewayConnectPeerAssociationDestroy(ctx context.Context _, err = tfnetworkmanager.FindTransitGatewayConnectPeerAssociationByTwoPartKey(ctx, conn, globalNetworkID, connectPeerARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/transit_gateway_peering.go b/internal/service/networkmanager/transit_gateway_peering.go index deef6f2f024..110b87af298 100644 --- a/internal/service/networkmanager/transit_gateway_peering.go +++ b/internal/service/networkmanager/transit_gateway_peering.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -124,7 +125,7 @@ func resourceTransitGatewayPeeringRead(ctx context.Context, d *schema.ResourceDa transitGatewayPeering, err := findTransitGatewayPeeringByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Transit Gateway Peering %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -207,7 +208,7 @@ func statusTransitGatewayPeeringState(ctx context.Context, conn *networkmanager. return func() (any, string, error) { output, err := findTransitGatewayPeeringByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/transit_gateway_peering_test.go b/internal/service/networkmanager/transit_gateway_peering_test.go index a80b956431b..d13de8cb645 100644 --- a/internal/service/networkmanager/transit_gateway_peering_test.go +++ b/internal/service/networkmanager/transit_gateway_peering_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +117,7 @@ func testAccCheckTransitGatewayPeeringDestroy(ctx context.Context) resource.Test _, err := tfnetworkmanager.FindTransitGatewayPeeringByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/transit_gateway_registration.go b/internal/service/networkmanager/transit_gateway_registration.go index 2f2fea982f5..f25f3c7f3d5 100644 --- a/internal/service/networkmanager/transit_gateway_registration.go +++ b/internal/service/networkmanager/transit_gateway_registration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -99,7 +100,7 @@ func resourceTransitGatewayRegistrationRead(ctx context.Context, d *schema.Resou transitGatewayRegistration, err := findTransitGatewayRegistrationByTwoPartKey(ctx, conn, globalNetworkID, transitGatewayARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Transit Gateway Registration %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -234,7 +235,7 @@ func statusTransitGatewayRegistrationState(ctx context.Context, conn *networkman return func() (any, string, error) { output, err := findTransitGatewayRegistrationByTwoPartKey(ctx, conn, globalNetworkID, transitGatewayARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/transit_gateway_registration_test.go b/internal/service/networkmanager/transit_gateway_registration_test.go index c989d4291dd..bad510742c9 100644 --- a/internal/service/networkmanager/transit_gateway_registration_test.go +++ b/internal/service/networkmanager/transit_gateway_registration_test.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func testAccCheckTransitGatewayRegistrationDestroy(ctx context.Context) resource _, err = tfnetworkmanager.FindTransitGatewayRegistrationByTwoPartKey(ctx, conn, globalNetworkID, transitGatewayARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/transit_gateway_route_table_attachment.go b/internal/service/networkmanager/transit_gateway_route_table_attachment.go index 4da39fdac76..44e737b5c0d 100644 --- a/internal/service/networkmanager/transit_gateway_route_table_attachment.go +++ b/internal/service/networkmanager/transit_gateway_route_table_attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -136,7 +137,7 @@ func resourceTransitGatewayRouteTableAttachmentRead(ctx context.Context, d *sche transitGatewayRouteTableAttachment, err := findTransitGatewayRouteTableAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager Transit Gateway Route Table Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -223,7 +224,7 @@ func statusTransitGatewayRouteTableAttachment(ctx context.Context, conn *network return func() (any, string, error) { output, err := findTransitGatewayRouteTableAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go b/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go index 91a2de93cc0..e2b44aee6f6 100644 --- a/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go +++ b/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func testAccCheckTransitGatewayRouteTableAttachmentDestroy(ctx context.Context) _, err := tfnetworkmanager.FindTransitGatewayRouteTableAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmanager/vpc_attachment.go b/internal/service/networkmanager/vpc_attachment.go index aaf9795d529..1f83c631adc 100644 --- a/internal/service/networkmanager/vpc_attachment.go +++ b/internal/service/networkmanager/vpc_attachment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -238,7 +239,7 @@ func resourceVPCAttachmentRead(ctx context.Context, d *schema.ResourceData, meta vpcAttachment, err := findVPCAttachmentByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Network Manager VPC Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -405,7 +406,7 @@ func statusVPCAttachment(ctx context.Context, conn *networkmanager.Client, id st return func() (any, string, error) { output, err := findVPCAttachmentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmanager/vpc_attachment_test.go b/internal/service/networkmanager/vpc_attachment_test.go index f8fa2437ab5..074ec54a724 100644 --- a/internal/service/networkmanager/vpc_attachment_test.go +++ b/internal/service/networkmanager/vpc_attachment_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -544,7 +544,7 @@ func testAccCheckVPCAttachmentDestroy(ctx context.Context) resource.TestCheckFun _, err := tfnetworkmanager.FindVPCAttachmentByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 2bd6014c68a49ec7e4e7751f1cd91dad3863b897 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:08 -0800 Subject: [PATCH 142/227] `networkmonitor` --- internal/service/networkmonitor/monitor.go | 5 +++-- internal/service/networkmonitor/monitor_test.go | 4 ++-- internal/service/networkmonitor/probe.go | 5 +++-- internal/service/networkmonitor/probe_test.go | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/networkmonitor/monitor.go b/internal/service/networkmonitor/monitor.go index d7d5c1d2f16..312d87794c9 100644 --- a/internal/service/networkmonitor/monitor.go +++ b/internal/service/networkmonitor/monitor.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -135,7 +136,7 @@ func (r *monitorResource) Read(ctx context.Context, request resource.ReadRequest output, err := findMonitorByName(ctx, conn, data.MonitorName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -260,7 +261,7 @@ func statusMonitor(ctx context.Context, conn *networkmonitor.Client, name string return func() (any, string, error) { output, err := findMonitorByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmonitor/monitor_test.go b/internal/service/networkmonitor/monitor_test.go index b8856f6152c..32dc46855ce 100644 --- a/internal/service/networkmonitor/monitor_test.go +++ b/internal/service/networkmonitor/monitor_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnetworkmonitor "github.com/hashicorp/terraform-provider-aws/internal/service/networkmonitor" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func testAccCheckMonitorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkmonitor.FindMonitorByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/networkmonitor/probe.go b/internal/service/networkmonitor/probe.go index 2835ac85745..4035fd6bb36 100644 --- a/internal/service/networkmonitor/probe.go +++ b/internal/service/networkmonitor/probe.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -191,7 +192,7 @@ func (r *probeResource) Read(ctx context.Context, request resource.ReadRequest, output, err := findProbeByTwoPartKey(ctx, conn, data.MonitorName.ValueString(), data.ProbeID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -336,7 +337,7 @@ func statusProbe(ctx context.Context, conn *networkmonitor.Client, monitorName, return func() (any, string, error) { output, err := findProbeByTwoPartKey(ctx, conn, monitorName, probeID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/networkmonitor/probe_test.go b/internal/service/networkmonitor/probe_test.go index eaee9204f61..32f875be03f 100644 --- a/internal/service/networkmonitor/probe_test.go +++ b/internal/service/networkmonitor/probe_test.go @@ -18,9 +18,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfnetworkmonitor "github.com/hashicorp/terraform-provider-aws/internal/service/networkmonitor" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +171,7 @@ func testAccCheckProbeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnetworkmonitor.FindProbeByTwoPartKey(ctx, conn, rs.Primary.Attributes["monitor_name"], rs.Primary.Attributes["probe_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -209,7 +209,7 @@ func testAccCheckProbeDeleteSecurityGroup(ctx context.Context, rName string, vpc description := "Created By Amazon CloudWatch Network Monitor for " + rName v, err := tfec2.FindSecurityGroupByDescriptionAndVPCID(ctx, conn, description, aws.ToString(vpc.VpcId)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Already gone. return nil } From fba94db13faef18cce4df0fb4031328ce579a515 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:08 -0800 Subject: [PATCH 143/227] `notifications` --- internal/service/notifications/channel_association.go | 4 ++-- internal/service/notifications/channel_association_test.go | 4 ++-- internal/service/notifications/event_rule.go | 5 +++-- internal/service/notifications/event_rule_test.go | 4 ++-- internal/service/notifications/notification_configuration.go | 5 +++-- .../service/notifications/notification_configuration_test.go | 4 ++-- internal/service/notifications/notification_hub.go | 5 +++-- internal/service/notifications/notification_hub_test.go | 4 ++-- 8 files changed, 19 insertions(+), 16 deletions(-) diff --git a/internal/service/notifications/channel_association.go b/internal/service/notifications/channel_association.go index 8897b07e400..5584ca0c7ed 100644 --- a/internal/service/notifications/channel_association.go +++ b/internal/service/notifications/channel_association.go @@ -23,7 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func (r *channelAssociationResource) Read(ctx context.Context, request resource. notificationConfigurationARN, arn := fwflex.StringValueFromFramework(ctx, data.NotificationConfigurationARN), fwflex.StringValueFromFramework(ctx, data.ARN) err := findChannelAssociationByTwoPartKey(ctx, conn, notificationConfigurationARN, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/notifications/channel_association_test.go b/internal/service/notifications/channel_association_test.go index 1e739d52cf7..4dc97ec7535 100644 --- a/internal/service/notifications/channel_association_test.go +++ b/internal/service/notifications/channel_association_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnotifications "github.com/hashicorp/terraform-provider-aws/internal/service/notifications" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func testAccCheckChannelAssociationDestroy(ctx context.Context) resource.TestChe err := tfnotifications.FindChannelAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["notification_configuration_arn"], rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/notifications/event_rule.go b/internal/service/notifications/event_rule.go index a9b4ed1fe88..7c2d82b493a 100644 --- a/internal/service/notifications/event_rule.go +++ b/internal/service/notifications/event_rule.go @@ -29,6 +29,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +141,7 @@ func (r *eventRuleResource) Read(ctx context.Context, request resource.ReadReque output, err := findEventRuleByARN(ctx, conn, data.ARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -264,7 +265,7 @@ func statusEventRule(ctx context.Context, conn *notifications.Client, arn string return func() (any, string, error) { output, err := findEventRuleByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/notifications/event_rule_test.go b/internal/service/notifications/event_rule_test.go index 2791f274d85..e6b7e83d086 100644 --- a/internal/service/notifications/event_rule_test.go +++ b/internal/service/notifications/event_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnotifications "github.com/hashicorp/terraform-provider-aws/internal/service/notifications" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func testAccCheckEventRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfnotifications.FindEventRuleByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/notifications/notification_configuration.go b/internal/service/notifications/notification_configuration.go index eae0a7269cc..2b2414b56cb 100644 --- a/internal/service/notifications/notification_configuration.go +++ b/internal/service/notifications/notification_configuration.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func (r *notificationConfigurationResource) Read(ctx context.Context, request re out, err := findNotificationConfigurationByARN(ctx, conn, data.ARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -248,7 +249,7 @@ func statusNotificationConfiguration(ctx context.Context, conn *notifications.Cl return func() (any, string, error) { output, err := findNotificationConfigurationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/notifications/notification_configuration_test.go b/internal/service/notifications/notification_configuration_test.go index 860827f739b..59c82a0e0be 100644 --- a/internal/service/notifications/notification_configuration_test.go +++ b/internal/service/notifications/notification_configuration_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnotifications "github.com/hashicorp/terraform-provider-aws/internal/service/notifications" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -251,7 +251,7 @@ func testAccCheckNotificationConfigurationDestroy(ctx context.Context) resource. _, err := tfnotifications.FindNotificationConfigurationByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/notifications/notification_hub.go b/internal/service/notifications/notification_hub.go index 10dba4d8d46..1a755561090 100644 --- a/internal/service/notifications/notification_hub.go +++ b/internal/service/notifications/notification_hub.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -106,7 +107,7 @@ func (r *notificationHubResource) Read(ctx context.Context, request resource.Rea _, err := findNotificationHubByRegion(ctx, conn, data.NotificationHubRegion.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -221,7 +222,7 @@ func statusNotificationHub(ctx context.Context, conn *notifications.Client, regi return func() (any, string, error) { output, err := findNotificationHubByRegion(ctx, conn, region) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/notifications/notification_hub_test.go b/internal/service/notifications/notification_hub_test.go index e89985991c4..90e9f210619 100644 --- a/internal/service/notifications/notification_hub_test.go +++ b/internal/service/notifications/notification_hub_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfnotifications "github.com/hashicorp/terraform-provider-aws/internal/service/notifications" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +99,7 @@ func testAccCheckNotificationHubDestroy(ctx context.Context) resource.TestCheckF _, err := tfnotifications.FindNotificationHubByRegion(ctx, conn, rs.Primary.Attributes["notification_hub_region"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 6fbfca1e78f72554669c4c7b1aa8d27085212e69 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:09 -0800 Subject: [PATCH 144/227] `oam` --- internal/service/oam/link.go | 3 ++- internal/service/oam/sink.go | 3 ++- internal/service/oam/sink_policy.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/service/oam/link.go b/internal/service/oam/link.go index cef64768238..f619c23dea7 100644 --- a/internal/service/oam/link.go +++ b/internal/service/oam/link.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -160,7 +161,7 @@ func resourceLinkRead(ctx context.Context, d *schema.ResourceData, meta any) dia out, err := findLinkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ObservabilityAccessManager Link (%s) not found, removing from state", d.Id()) d.SetId("") return nil diff --git a/internal/service/oam/sink.go b/internal/service/oam/sink.go index 2aa647be8ea..f230df5c1e8 100644 --- a/internal/service/oam/sink.go +++ b/internal/service/oam/sink.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -94,7 +95,7 @@ func resourceSinkRead(ctx context.Context, d *schema.ResourceData, meta any) dia out, err := findSinkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ObservabilityAccessManager Sink (%s) not found, removing from state", d.Id()) d.SetId("") return nil diff --git a/internal/service/oam/sink_policy.go b/internal/service/oam/sink_policy.go index 6cfd04d5376..d0ee81a6119 100644 --- a/internal/service/oam/sink_policy.go +++ b/internal/service/oam/sink_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -110,7 +111,7 @@ func resourceSinkPolicyRead(ctx context.Context, d *schema.ResourceData, meta an out, err := findSinkPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ObservabilityAccessManager SinkPolicy (%s) not found, removing from state", d.Id()) d.SetId("") return nil From 18892dfdcd66ef298e38364799e8115551bb557e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:10 -0800 Subject: [PATCH 145/227] `observabilityadmin` --- .../centralization_rule_for_organization_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/observabilityadmin/centralization_rule_for_organization_test.go b/internal/service/observabilityadmin/centralization_rule_for_organization_test.go index 41e14eb5e90..9556bfa42ad 100644 --- a/internal/service/observabilityadmin/centralization_rule_for_organization_test.go +++ b/internal/service/observabilityadmin/centralization_rule_for_organization_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfobservabilityadmin "github.com/hashicorp/terraform-provider-aws/internal/service/observabilityadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -318,7 +318,7 @@ func testAccCheckCentralizationRuleForOrganizationDestroy(ctx context.Context) r _, err := tfobservabilityadmin.FindCentralizationRuleForOrganizationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From bd0dc3054548ac15dd7f7c653a75b35c330bd723 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:11 -0800 Subject: [PATCH 146/227] `odb` --- internal/service/odb/cloud_autonomous_vm_cluster.go | 5 +++-- .../odb/cloud_autonomous_vm_cluster_data_source_test.go | 4 ++-- internal/service/odb/cloud_autonomous_vm_cluster_test.go | 3 ++- internal/service/odb/cloud_exadata_infrastructure.go | 5 +++-- .../odb/cloud_exadata_infrastructure_data_source_test.go | 4 ++-- internal/service/odb/cloud_exadata_infrastructure_test.go | 4 ++-- internal/service/odb/cloud_vm_cluster.go | 5 +++-- internal/service/odb/cloud_vm_cluster_data_source_test.go | 4 ++-- internal/service/odb/cloud_vm_cluster_test.go | 4 ++-- internal/service/odb/db_node_data_source_test.go | 3 ++- internal/service/odb/db_nodes_data_source_test.go | 3 ++- internal/service/odb/db_server_data_source_test.go | 3 ++- internal/service/odb/db_servers_data_source_test.go | 3 ++- internal/service/odb/network.go | 5 +++-- internal/service/odb/network_data_source_test.go | 3 ++- internal/service/odb/network_peering_connection.go | 5 +++-- .../odb/network_peering_connection_data_source_test.go | 4 ++-- internal/service/odb/network_peering_connection_test.go | 4 ++-- internal/service/odb/network_test.go | 4 ++-- 19 files changed, 43 insertions(+), 32 deletions(-) diff --git a/internal/service/odb/cloud_autonomous_vm_cluster.go b/internal/service/odb/cloud_autonomous_vm_cluster.go index b128bc2c7a7..99b9652cbef 100644 --- a/internal/service/odb/cloud_autonomous_vm_cluster.go +++ b/internal/service/odb/cloud_autonomous_vm_cluster.go @@ -36,6 +36,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -543,7 +544,7 @@ func (r *resourceCloudAutonomousVmCluster) Read(ctx context.Context, req resourc out, err := findCloudAutonomousVmClusterByID(ctx, conn, state.CloudAutonomousVmClusterId.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -634,7 +635,7 @@ func waitCloudAutonomousVmClusterDeleted(ctx context.Context, conn *odb.Client, func statusCloudAutonomousVmCluster(ctx context.Context, conn *odb.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findCloudAutonomousVmClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/odb/cloud_autonomous_vm_cluster_data_source_test.go b/internal/service/odb/cloud_autonomous_vm_cluster_data_source_test.go index 7e33f69285d..9d5b09fe6a0 100644 --- a/internal/service/odb/cloud_autonomous_vm_cluster_data_source_test.go +++ b/internal/service/odb/cloud_autonomous_vm_cluster_data_source_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -71,7 +71,7 @@ func (autonomousVMClusterDSTest) testAccCheckCloudAutonomousVmClusterDestroy(ctx } _, err := tfodb.FindCloudAutonomousVmClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/cloud_autonomous_vm_cluster_test.go b/internal/service/odb/cloud_autonomous_vm_cluster_test.go index 369724f7bde..9fa04227c46 100644 --- a/internal/service/odb/cloud_autonomous_vm_cluster_test.go +++ b/internal/service/odb/cloud_autonomous_vm_cluster_test.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -207,7 +208,7 @@ func (autonomousVMClusterResourceTest) testAccCheckCloudAutonomousVmClusterDestr } _, err := autonomousVMClusterResourceTestEntity.findAVMC(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/cloud_exadata_infrastructure.go b/internal/service/odb/cloud_exadata_infrastructure.go index f40dd036186..8ab738b643b 100644 --- a/internal/service/odb/cloud_exadata_infrastructure.go +++ b/internal/service/odb/cloud_exadata_infrastructure.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -378,7 +379,7 @@ func (r *resourceCloudExadataInfrastructure) Read(ctx context.Context, req resou } out, err := findExadataInfraResourceByID(ctx, conn, state.CloudExadataInfrastructureId.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -535,7 +536,7 @@ func waitCloudExadataInfrastructureDeleted(ctx context.Context, conn *odb.Client func statusCloudExadataInfrastructure(ctx context.Context, conn *odb.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findExadataInfraResourceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/odb/cloud_exadata_infrastructure_data_source_test.go b/internal/service/odb/cloud_exadata_infrastructure_data_source_test.go index 83df2759c16..709af0a4ef7 100644 --- a/internal/service/odb/cloud_exadata_infrastructure_data_source_test.go +++ b/internal/service/odb/cloud_exadata_infrastructure_data_source_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -72,7 +72,7 @@ func (cloudExaDataInfraDataSourceTest) testAccCheckCloudExadataInfrastructureDes continue } _, err := tfodb.FindExaDataInfraForDataSourceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/cloud_exadata_infrastructure_test.go b/internal/service/odb/cloud_exadata_infrastructure_test.go index 44678001f9b..4f2796cd0fa 100644 --- a/internal/service/odb/cloud_exadata_infrastructure_test.go +++ b/internal/service/odb/cloud_exadata_infrastructure_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -300,7 +300,7 @@ func (cloudExaDataInfraResourceTest) testAccCheckCloudExaDataInfraDestroyed(ctx continue } _, err := tfodb.FindExadataInfraResourceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/cloud_vm_cluster.go b/internal/service/odb/cloud_vm_cluster.go index dce822986cc..9610a5a3a13 100644 --- a/internal/service/odb/cloud_vm_cluster.go +++ b/internal/service/odb/cloud_vm_cluster.go @@ -38,6 +38,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -624,7 +625,7 @@ func (r *resourceCloudVmCluster) Read(ctx context.Context, req resource.ReadRequ return } out, err := findCloudVmClusterForResourceByID(ctx, conn, state.CloudVmClusterId.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -765,7 +766,7 @@ func waitCloudVmClusterDeleted(ctx context.Context, conn *odb.Client, id string, func statusCloudVmCluster(ctx context.Context, conn *odb.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findCloudVmClusterForResourceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/odb/cloud_vm_cluster_data_source_test.go b/internal/service/odb/cloud_vm_cluster_data_source_test.go index 10f9988ca0c..5287ee0ee47 100644 --- a/internal/service/odb/cloud_vm_cluster_data_source_test.go +++ b/internal/service/odb/cloud_vm_cluster_data_source_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -80,7 +80,7 @@ func (cloudVmClusterDSTest) testAccCheckCloudVmClusterDestroy(ctx context.Contex continue } _, err := tfodb.FindCloudVmClusterForResourceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/cloud_vm_cluster_test.go b/internal/service/odb/cloud_vm_cluster_test.go index 5a311c71e8f..80ed6cb32d3 100644 --- a/internal/service/odb/cloud_vm_cluster_test.go +++ b/internal/service/odb/cloud_vm_cluster_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -366,7 +366,7 @@ func (cloudVmClusterResourceTest) testAccCheckCloudVmClusterDestroy(ctx context. continue } _, err := tfodb.FindCloudVmClusterForResourceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/db_node_data_source_test.go b/internal/service/odb/db_node_data_source_test.go index aaea22b0b5e..98eb9dfaec4 100644 --- a/internal/service/odb/db_node_data_source_test.go +++ b/internal/service/odb/db_node_data_source_test.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -99,7 +100,7 @@ func (testDbNodeDataSourceTest) testAccCheckDBNodeDestroyed(ctx context.Context) continue } err := dbNodeDataSourceTestEntity.findVmCluster(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/db_nodes_data_source_test.go b/internal/service/odb/db_nodes_data_source_test.go index 6f39b287aba..604690a00b0 100644 --- a/internal/service/odb/db_nodes_data_source_test.go +++ b/internal/service/odb/db_nodes_data_source_test.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -105,7 +106,7 @@ func (dbNodesListDataSourceTest) testAccCheckDBNodesDestroyed(ctx context.Contex continue } _, err := dbNodesListDataSourceTestEntity.findVmCluster(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/db_server_data_source_test.go b/internal/service/odb/db_server_data_source_test.go index 7db8c985ee6..877337e90a3 100644 --- a/internal/service/odb/db_server_data_source_test.go +++ b/internal/service/odb/db_server_data_source_test.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -87,7 +88,7 @@ func (testDbServerDataSourceTest) testAccCheckDBServersDestroyed(ctx context.Con continue } err := dbServerDataSourceTestEntity.findExaInfra(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/db_servers_data_source_test.go b/internal/service/odb/db_servers_data_source_test.go index 72b0421eb72..1d7cd22be81 100644 --- a/internal/service/odb/db_servers_data_source_test.go +++ b/internal/service/odb/db_servers_data_source_test.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -88,7 +89,7 @@ func (testDbServersListDataSource) testAccCheckDBServersDestroyed(ctx context.Co continue } _, err := dbServersListDataSourceTestEntity.findExaInfra(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/network.go b/internal/service/odb/network.go index ee4b0c1e528..376c2c80e18 100644 --- a/internal/service/odb/network.go +++ b/internal/service/odb/network.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -337,7 +338,7 @@ func (r *resourceNetwork) Read(ctx context.Context, req resource.ReadRequest, re } out, err := FindOracleDBNetworkResourceByID(ctx, conn, state.OdbNetworkId.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -616,7 +617,7 @@ func waitNetworkDeleted(ctx context.Context, conn *odb.Client, id string, timeou func statusNetwork(ctx context.Context, conn *odb.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindOracleDBNetworkResourceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/odb/network_data_source_test.go b/internal/service/odb/network_data_source_test.go index 597975fe64e..002b54dcb71 100644 --- a/internal/service/odb/network_data_source_test.go +++ b/internal/service/odb/network_data_source_test.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -67,7 +68,7 @@ func (oracleDBNetworkDataSourceTest) testAccCheckNetworkDataSourceDestroyed(ctx continue } _, err := oracleDBNetworkDataSourceTestEntity.findNetwork(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/network_peering_connection.go b/internal/service/odb/network_peering_connection.go index af571a01074..f9caa2bb779 100644 --- a/internal/service/odb/network_peering_connection.go +++ b/internal/service/odb/network_peering_connection.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -233,7 +234,7 @@ func (r *resourceNetworkPeeringConnection) Read(ctx context.Context, req resourc } out, err := findNetworkPeeringConnectionByID(ctx, conn, state.OdbPeeringConnectionId.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -343,7 +344,7 @@ func waitNetworkPeeringConnectionDeleted(ctx context.Context, conn *odb.Client, func statusNetworkPeeringConnection(ctx context.Context, conn *odb.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findNetworkPeeringConnectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/odb/network_peering_connection_data_source_test.go b/internal/service/odb/network_peering_connection_data_source_test.go index d16321dc7e2..e125e63b0b7 100644 --- a/internal/service/odb/network_peering_connection_data_source_test.go +++ b/internal/service/odb/network_peering_connection_data_source_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -75,7 +75,7 @@ func (oracleDBNetPeeringDataSourceTest) testAccCheckCloudOracleDBNetworkPeeringD _, err := oracleDBNetPeeringDSTestEntity.findOracleDBNetworkPeering(ctx, conn, rs.Primary.ID) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return create.Error(names.ODB, create.ErrActionCheckingDestroyed, tfodb.DSNameNetworkPeeringConnection, rs.Primary.ID, err) diff --git a/internal/service/odb/network_peering_connection_test.go b/internal/service/odb/network_peering_connection_test.go index 653eb49805c..52f0bfdd61e 100644 --- a/internal/service/odb/network_peering_connection_test.go +++ b/internal/service/odb/network_peering_connection_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func (oracleDBNwkPeeringResourceTest) testAccCheckNetworkPeeringConnectionDestro continue } _, err := oracleDBNwkPeeringTestResource.findOracleDBNetworkPeering(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/odb/network_test.go b/internal/service/odb/network_test.go index 4a3007a7cfd..2f6d14f4a58 100644 --- a/internal/service/odb/network_test.go +++ b/internal/service/odb/network_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfodb "github.com/hashicorp/terraform-provider-aws/internal/service/odb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -362,7 +362,7 @@ func (oracleDBNetworkResourceTest) testAccCheckNetworkDestroy(ctx context.Contex continue } _, err := tfodb.FindOracleDBNetworkResourceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { From 9fd5917745f5bb65e4914c1ff22a0ad8303f7ba9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:11 -0800 Subject: [PATCH 147/227] `opensearch` --- .../service/opensearch/authorize_vpc_endpoint_access.go | 3 ++- .../opensearch/authorize_vpc_endpoint_access_test.go | 4 ++-- internal/service/opensearch/domain.go | 3 ++- internal/service/opensearch/domain_policy.go | 3 ++- internal/service/opensearch/domain_saml_options.go | 3 ++- internal/service/opensearch/domain_saml_options_test.go | 4 ++-- internal/service/opensearch/domain_test.go | 4 ++-- internal/service/opensearch/inbound_connection_accepter.go | 5 +++-- internal/service/opensearch/outbound_connection.go | 5 +++-- internal/service/opensearch/package.go | 5 +++-- internal/service/opensearch/package_association.go | 5 +++-- internal/service/opensearch/package_association_test.go | 4 ++-- internal/service/opensearch/package_test.go | 4 ++-- internal/service/opensearch/vpc_endpoint.go | 5 +++-- internal/service/opensearch/vpc_endpoint_test.go | 6 +++--- internal/service/opensearch/wait.go | 5 +++-- 16 files changed, 39 insertions(+), 29 deletions(-) diff --git a/internal/service/opensearch/authorize_vpc_endpoint_access.go b/internal/service/opensearch/authorize_vpc_endpoint_access.go index f72e4bdeebc..f41c682e5a1 100644 --- a/internal/service/opensearch/authorize_vpc_endpoint_access.go +++ b/internal/service/opensearch/authorize_vpc_endpoint_access.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func (r *authorizeVPCEndpointAccessResource) Read(ctx context.Context, req resou } out, err := findAuthorizeVPCEndpointAccessByTwoPartKey(ctx, conn, state.DomainName.ValueString(), state.Account.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/opensearch/authorize_vpc_endpoint_access_test.go b/internal/service/opensearch/authorize_vpc_endpoint_access_test.go index e5c62d4da66..82a52551568 100644 --- a/internal/service/opensearch/authorize_vpc_endpoint_access_test.go +++ b/internal/service/opensearch/authorize_vpc_endpoint_access_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckAuthorizeVPCEndpointAccessDestroy(ctx context.Context) resource } _, err := tfopensearch.FindAuthorizeVPCEndpointAccessByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrDomainName], rs.Primary.Attributes["account"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearch/domain.go b/internal/service/opensearch/domain.go index 608083aec3a..8604b34514c 100644 --- a/internal/service/opensearch/domain.go +++ b/internal/service/opensearch/domain.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/semver" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" @@ -979,7 +980,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta any) d name := d.Get(names.AttrDomainName).(string) ds, err := findDomainByName(ctx, conn, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Domain (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/opensearch/domain_policy.go b/internal/service/opensearch/domain_policy.go index 0d5f363b596..ca23acc29fc 100644 --- a/internal/service/opensearch/domain_policy.go +++ b/internal/service/opensearch/domain_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -66,7 +67,7 @@ func resourceDomainPolicyRead(ctx context.Context, d *schema.ResourceData, meta domainName := strings.Replace(d.Id(), "esd-policy-", "", 1) ds, err := findDomainByName(ctx, conn, domainName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Domain Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/opensearch/domain_saml_options.go b/internal/service/opensearch/domain_saml_options.go index 07764723dab..5ce84a886ab 100644 --- a/internal/service/opensearch/domain_saml_options.go +++ b/internal/service/opensearch/domain_saml_options.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +125,7 @@ func resourceDomainSAMLOptionsRead(ctx context.Context, d *schema.ResourceData, ds, err := findDomainByName(ctx, conn, d.Get(names.AttrDomainName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Domain SAML Options (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/opensearch/domain_saml_options_test.go b/internal/service/opensearch/domain_saml_options_test.go index 6b79f61b2e3..99d2b02be1e 100644 --- a/internal/service/opensearch/domain_saml_options_test.go +++ b/internal/service/opensearch/domain_saml_options_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -189,7 +189,7 @@ func testAccCheckESDomainSAMLOptionsDestroy(ctx context.Context) resource.TestCh conn := acctest.Provider.Meta().(*conns.AWSClient).OpenSearchClient(ctx) _, err := tfopensearch.FindDomainByName(ctx, conn, rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearch/domain_test.go b/internal/service/opensearch/domain_test.go index 88f9de8bdd9..0098d0e7021 100644 --- a/internal/service/opensearch/domain_test.go +++ b/internal/service/opensearch/domain_test.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2769,7 +2769,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfopensearch.FindDomainByName(ctx, conn, rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearch/inbound_connection_accepter.go b/internal/service/opensearch/inbound_connection_accepter.go index b3727800d64..8558f9fdcb3 100644 --- a/internal/service/opensearch/inbound_connection_accepter.go +++ b/internal/service/opensearch/inbound_connection_accepter.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +88,7 @@ func resourceInboundConnectionRead(ctx context.Context, d *schema.ResourceData, connection, err := findInboundConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Inbound Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -211,7 +212,7 @@ func statusInboundConnection(ctx context.Context, conn *opensearch.Client, id st return func() (any, string, error) { output, err := findInboundConnectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearch/outbound_connection.go b/internal/service/opensearch/outbound_connection.go index b2d3aad30c1..3829afbc641 100644 --- a/internal/service/opensearch/outbound_connection.go +++ b/internal/service/opensearch/outbound_connection.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +178,7 @@ func resourceOutboundConnectionRead(ctx context.Context, d *schema.ResourceData, connection, err := findOutboundConnectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Outbound Connection (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -289,7 +290,7 @@ func statusOutboundConnection(ctx context.Context, conn *opensearch.Client, id s return func() (any, string, error) { output, err := findOutboundConnectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearch/package.go b/internal/service/opensearch/package.go index 4861569fb69..53a22957649 100644 --- a/internal/service/opensearch/package.go +++ b/internal/service/opensearch/package.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +132,7 @@ func resourcePackageRead(ctx context.Context, d *schema.ResourceData, meta any) pkg, err := findPackageByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Package (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -271,7 +272,7 @@ func statusPackageValidation(ctx context.Context, conn *opensearch.Client, id st return func() (any, string, error) { output, err := findPackageByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearch/package_association.go b/internal/service/opensearch/package_association.go index 79b012ff6dc..5fda7b1fc9f 100644 --- a/internal/service/opensearch/package_association.go +++ b/internal/service/opensearch/package_association.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -94,7 +95,7 @@ func resourcePackageAssociationRead(ctx context.Context, d *schema.ResourceData, packageID := d.Get("package_id").(string) pkgAssociation, err := findPackageAssociationByTwoPartKey(ctx, conn, domainName, packageID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch Package Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -191,7 +192,7 @@ func statusPackageAssociation(ctx context.Context, conn *opensearch.Client, doma return func() (any, string, error) { output, err := findPackageAssociationByTwoPartKey(ctx, conn, domainName, packageID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearch/package_association_test.go b/internal/service/opensearch/package_association_test.go index 09b9d834c8c..f57c35bcc10 100644 --- a/internal/service/opensearch/package_association_test.go +++ b/internal/service/opensearch/package_association_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +93,7 @@ func testAccCheckPackageAssociationDestroy(ctx context.Context) resource.TestChe _, err := tfopensearch.FindPackageAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrDomainName], rs.Primary.Attributes["package_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearch/package_test.go b/internal/service/opensearch/package_test.go index f1ad8019f51..d33ca789e55 100644 --- a/internal/service/opensearch/package_test.go +++ b/internal/service/opensearch/package_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckPackageDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfopensearch.FindPackageByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearch/vpc_endpoint.go b/internal/service/opensearch/vpc_endpoint.go index 0665c039c78..a0ed5f98b61 100644 --- a/internal/service/opensearch/vpc_endpoint.go +++ b/internal/service/opensearch/vpc_endpoint.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -117,7 +118,7 @@ func resourceVPCEndpointRead(ctx context.Context, d *schema.ResourceData, meta a endpoint, err := findVPCEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] OpenSearch VPC Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -278,7 +279,7 @@ func statusVPCEndpoint(ctx context.Context, conn *opensearch.Client, id string) return func() (any, string, error) { output, err := findVPCEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearch/vpc_endpoint_test.go b/internal/service/opensearch/vpc_endpoint_test.go index 502da6f71d7..10d95074344 100644 --- a/internal/service/opensearch/vpc_endpoint_test.go +++ b/internal/service/opensearch/vpc_endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +89,7 @@ func TestVPCEndpointErrorsNotFound(t *testing.T) { t.Run(testCase.name, func(t *testing.T) { t.Parallel() - if got, want := tfresource.NotFound(tfopensearch.VPCEndpointsError(testCase.apiObjects)), testCase.notFound; got != want { + if got, want := retry.NotFound(tfopensearch.VPCEndpointsError(testCase.apiObjects)), testCase.notFound; got != want { t.Errorf("NotFound = %v, want %v", got, want) } }) @@ -240,7 +240,7 @@ func testAccCheckVPCEndpointDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfopensearch.FindVPCEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearch/wait.go b/internal/service/opensearch/wait.go index 67683e5f439..8d629455354 100644 --- a/internal/service/opensearch/wait.go +++ b/internal/service/opensearch/wait.go @@ -13,6 +13,7 @@ import ( awstypes "github.com/aws/aws-sdk-go-v2/service/opensearch/types" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -45,7 +46,7 @@ func waitForDomainCreation(ctx context.Context, conn *opensearch.Client, domainN err := tfresource.Retry(ctx, timeout, func(ctx context.Context) *tfresource.RetryError { var err error out, err = findDomainByName(ctx, conn, domainName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return tfresource.RetryableError(err) } if err != nil { @@ -98,7 +99,7 @@ func waitForDomainDelete(ctx context.Context, conn *opensearch.Client, domainNam out, err = findDomainByName(ctx, conn, domainName) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return tfresource.NonRetryableError(err) From 63b6c528217203181408d38bf1008d55eaa9e793 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:13 -0800 Subject: [PATCH 148/227] `opensearchserverless` --- internal/service/opensearchserverless/access_policy.go | 4 ++-- internal/service/opensearchserverless/access_policy_test.go | 4 ++-- internal/service/opensearchserverless/collection.go | 5 +++-- internal/service/opensearchserverless/collection_test.go | 4 ++-- internal/service/opensearchserverless/lifecycle_policy.go | 4 ++-- .../service/opensearchserverless/lifecycle_policy_test.go | 4 ++-- internal/service/opensearchserverless/security_config.go | 4 ++-- .../service/opensearchserverless/security_config_test.go | 4 ++-- internal/service/opensearchserverless/security_policy.go | 4 ++-- .../service/opensearchserverless/security_policy_test.go | 4 ++-- internal/service/opensearchserverless/vpc_endpoint.go | 5 +++-- internal/service/opensearchserverless/vpc_endpoint_test.go | 4 ++-- 12 files changed, 26 insertions(+), 24 deletions(-) diff --git a/internal/service/opensearchserverless/access_policy.go b/internal/service/opensearchserverless/access_policy.go index 2e59b69e9c7..fec8777a404 100644 --- a/internal/service/opensearchserverless/access_policy.go +++ b/internal/service/opensearchserverless/access_policy.go @@ -26,7 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func (r *accessPolicyResource) Read(ctx context.Context, request resource.ReadRe name := fwflex.StringValueFromFramework(ctx, data.ID) output, err := findAccessPolicyByNameAndType(ctx, conn, name, data.Type.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/opensearchserverless/access_policy_test.go b/internal/service/opensearchserverless/access_policy_test.go index d2172a00608..cac80c7ac55 100644 --- a/internal/service/opensearchserverless/access_policy_test.go +++ b/internal/service/opensearchserverless/access_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearchserverless "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckAccessPolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfopensearchserverless.FindAccessPolicyByNameAndType(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrType]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearchserverless/collection.go b/internal/service/opensearchserverless/collection.go index c4b58985590..47b4af1f4de 100644 --- a/internal/service/opensearchserverless/collection.go +++ b/internal/service/opensearchserverless/collection.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -214,7 +215,7 @@ func (r *collectionResource) Read(ctx context.Context, req resource.ReadRequest, } out, err := findCollectionByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -365,7 +366,7 @@ func statusCollection(ctx context.Context, conn *opensearchserverless.Client, id return func() (any, string, error) { output, err := findCollectionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearchserverless/collection_test.go b/internal/service/opensearchserverless/collection_test.go index c9ab40a06fb..6b939e88854 100644 --- a/internal/service/opensearchserverless/collection_test.go +++ b/internal/service/opensearchserverless/collection_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearchserverless "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -215,7 +215,7 @@ func testAccCheckCollectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfopensearchserverless.FindCollectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearchserverless/lifecycle_policy.go b/internal/service/opensearchserverless/lifecycle_policy.go index c445fb6bf85..26f0cdcd71f 100644 --- a/internal/service/opensearchserverless/lifecycle_policy.go +++ b/internal/service/opensearchserverless/lifecycle_policy.go @@ -26,7 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func (r *lifecyclePolicyResource) Read(ctx context.Context, request resource.Rea name := fwflex.StringValueFromFramework(ctx, data.ID) output, err := findLifecyclePolicyByNameAndType(ctx, conn, name, data.Type.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/opensearchserverless/lifecycle_policy_test.go b/internal/service/opensearchserverless/lifecycle_policy_test.go index 8d707eb67cb..d4afeaece8a 100644 --- a/internal/service/opensearchserverless/lifecycle_policy_test.go +++ b/internal/service/opensearchserverless/lifecycle_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearchserverless "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckLifecyclePolicyDestroy(ctx context.Context) resource.TestCheckF _, err := tfopensearchserverless.FindLifecyclePolicyByNameAndType(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrType]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearchserverless/security_config.go b/internal/service/opensearchserverless/security_config.go index 71bf6b37d09..803848a1d1b 100644 --- a/internal/service/opensearchserverless/security_config.go +++ b/internal/service/opensearchserverless/security_config.go @@ -28,7 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func (r *securityConfigResource) Read(ctx context.Context, req resource.ReadRequ } out, err := findSecurityConfigByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/opensearchserverless/security_config_test.go b/internal/service/opensearchserverless/security_config_test.go index b26555f16f2..a13ec0b6873 100644 --- a/internal/service/opensearchserverless/security_config_test.go +++ b/internal/service/opensearchserverless/security_config_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearchserverless "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func testAccCheckSecurityConfigDestroy(ctx context.Context) resource.TestCheckFu _, err := tfopensearchserverless.FindSecurityConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearchserverless/security_policy.go b/internal/service/opensearchserverless/security_policy.go index 9ca2bb13c6e..ac3bbbfad31 100644 --- a/internal/service/opensearchserverless/security_policy.go +++ b/internal/service/opensearchserverless/security_policy.go @@ -26,7 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func (r *securityPolicyResource) Read(ctx context.Context, request resource.Read name := fwflex.StringValueFromFramework(ctx, data.ID) output, err := findSecurityPolicyByNameAndType(ctx, conn, name, data.Type.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/opensearchserverless/security_policy_test.go b/internal/service/opensearchserverless/security_policy_test.go index a6ce5173ca5..55254a31a56 100644 --- a/internal/service/opensearchserverless/security_policy_test.go +++ b/internal/service/opensearchserverless/security_policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearchserverless "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -216,7 +216,7 @@ func testAccCheckSecurityPolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfopensearchserverless.FindSecurityPolicyByNameAndType(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrType]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/opensearchserverless/vpc_endpoint.go b/internal/service/opensearchserverless/vpc_endpoint.go index eaf50a9746c..8463bc05324 100644 --- a/internal/service/opensearchserverless/vpc_endpoint.go +++ b/internal/service/opensearchserverless/vpc_endpoint.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func (r *vpcEndpointResource) Read(ctx context.Context, req resource.ReadRequest output, err := findVPCEndpointByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -399,7 +400,7 @@ func statusVPCEndpoint(ctx context.Context, conn *opensearchserverless.Client, i return func() (any, string, error) { output, err := findVPCEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/opensearchserverless/vpc_endpoint_test.go b/internal/service/opensearchserverless/vpc_endpoint_test.go index c237d721372..f500c571de4 100644 --- a/internal/service/opensearchserverless/vpc_endpoint_test.go +++ b/internal/service/opensearchserverless/vpc_endpoint_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfopensearchserverless "github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -208,7 +208,7 @@ func testAccCheckVPCEndpointDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfopensearchserverless.FindVPCEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a8a470028fa755025e3364c2473639d3f006f7c4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:15 -0800 Subject: [PATCH 149/227] `organizations` --- internal/service/organizations/account.go | 7 ++++--- internal/service/organizations/account_test.go | 4 ++-- internal/service/organizations/delegated_administrator.go | 3 ++- .../service/organizations/delegated_administrator_test.go | 4 ++-- internal/service/organizations/organization.go | 3 ++- internal/service/organizations/organization_test.go | 4 ++-- internal/service/organizations/organizational_unit.go | 3 ++- internal/service/organizations/organizational_unit_test.go | 4 ++-- internal/service/organizations/policy.go | 3 ++- internal/service/organizations/policy_attachment.go | 3 ++- internal/service/organizations/policy_attachment_test.go | 4 ++-- internal/service/organizations/policy_test.go | 4 ++-- internal/service/organizations/resource_policy.go | 3 ++- internal/service/organizations/resource_policy_test.go | 4 ++-- 14 files changed, 30 insertions(+), 23 deletions(-) diff --git a/internal/service/organizations/account.go b/internal/service/organizations/account.go index 5ee3f68f3e4..c7cfd1fb400 100644 --- a/internal/service/organizations/account.go +++ b/internal/service/organizations/account.go @@ -25,6 +25,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -228,7 +229,7 @@ func resourceAccountRead(ctx context.Context, d *schema.ResourceData, meta any) account, err := findAccountByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] AWS Organizations Account does not exist, removing from state: %s", d.Id()) d.SetId("") return diags @@ -471,7 +472,7 @@ func statusCreateAccountState(ctx context.Context, conn *organizations.Client, i return func() (any, string, error) { output, err := findCreateAccountStatusByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -509,7 +510,7 @@ func statusAccountState(ctx context.Context, conn *organizations.Client, id stri return func() (any, string, error) { output, err := findAccountByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/organizations/account_test.go b/internal/service/organizations/account_test.go index bc1f90718e2..b136dc3abf9 100644 --- a/internal/service/organizations/account_test.go +++ b/internal/service/organizations/account_test.go @@ -22,8 +22,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -457,7 +457,7 @@ func testAccCheckAccountDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tforganizations.FindAccountByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/organizations/delegated_administrator.go b/internal/service/organizations/delegated_administrator.go index de6eef098f6..68be7f55e9a 100644 --- a/internal/service/organizations/delegated_administrator.go +++ b/internal/service/organizations/delegated_administrator.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -119,7 +120,7 @@ func resourceDelegatedAdministratorRead(ctx context.Context, d *schema.ResourceD delegatedAccount, err := findDelegatedAdministratorByTwoPartKey(ctx, conn, accountID, servicePrincipal) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Organizations Delegated Administrator %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/organizations/delegated_administrator_test.go b/internal/service/organizations/delegated_administrator_test.go index b497aa9249a..9c7a236db30 100644 --- a/internal/service/organizations/delegated_administrator_test.go +++ b/internal/service/organizations/delegated_administrator_test.go @@ -22,8 +22,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -249,7 +249,7 @@ func testAccCheckDelegatedAdministratorDestroy(ctx context.Context) resource.Tes _, err := tforganizations.FindDelegatedAdministratorByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAccountID], rs.Primary.Attributes["service_principal"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/organizations/organization.go b/internal/service/organizations/organization.go index f8e859ece9e..e809f8b0d30 100644 --- a/internal/service/organizations/organization.go +++ b/internal/service/organizations/organization.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -264,7 +265,7 @@ func resourceOrganizationRead(ctx context.Context, d *schema.ResourceData, meta org, err := findOrganization(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Organizations Organization does not exist, removing from state: %s", d.Id()) d.SetId("") return diags diff --git a/internal/service/organizations/organization_test.go b/internal/service/organizations/organization_test.go index a09ba876981..7a2e36c129f 100644 --- a/internal/service/organizations/organization_test.go +++ b/internal/service/organizations/organization_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -393,7 +393,7 @@ func testAccCheckOrganizationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tforganizations.FindOrganization(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/organizations/organizational_unit.go b/internal/service/organizations/organizational_unit.go index 83400a4aca8..094b17a02f4 100644 --- a/internal/service/organizations/organizational_unit.go +++ b/internal/service/organizations/organizational_unit.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceOrganizationalUnitRead(ctx context.Context, d *schema.ResourceData, ou, err := findOrganizationalUnitByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Organizations Organizational Unit (%s) does not exist, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/organizations/organizational_unit_test.go b/internal/service/organizations/organizational_unit_test.go index b33ec10e509..98578b7dc8f 100644 --- a/internal/service/organizations/organizational_unit_test.go +++ b/internal/service/organizations/organizational_unit_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -131,7 +131,7 @@ func testAccCheckOrganizationalUnitDestroy(ctx context.Context) resource.TestChe _, err := tforganizations.FindOrganizationalUnitByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/organizations/policy.go b/internal/service/organizations/policy.go index 8b3f5a742e7..e656430aa5a 100644 --- a/internal/service/organizations/policy.go +++ b/internal/service/organizations/policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -114,7 +115,7 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta any) d policy, err := findPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Organizations Policy %s not found, removing from state", d.Id()) d.SetId("") return nil diff --git a/internal/service/organizations/policy_attachment.go b/internal/service/organizations/policy_attachment.go index daf46b2720d..0561e6220fe 100644 --- a/internal/service/organizations/policy_attachment.go +++ b/internal/service/organizations/policy_attachment.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourcePolicyAttachmentRead(ctx context.Context, d *schema.ResourceData, m _, err := findPolicyAttachmentByTwoPartKey(ctx, conn, targetID, policyID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Organizations Policy Attachment %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/organizations/policy_attachment_test.go b/internal/service/organizations/policy_attachment_test.go index 6f469e511ca..973d5e8d6c9 100644 --- a/internal/service/organizations/policy_attachment_test.go +++ b/internal/service/organizations/policy_attachment_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -187,7 +187,7 @@ func testAccCheckPolicyAttachmentDestroy(ctx context.Context) resource.TestCheck _, err := tforganizations.FindPolicyAttachmentByTwoPartKey(ctx, conn, rs.Primary.Attributes["target_id"], rs.Primary.Attributes["policy_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/organizations/policy_test.go b/internal/service/organizations/policy_test.go index d73e460cff7..3a4e67cc80a 100644 --- a/internal/service/organizations/policy_test.go +++ b/internal/service/organizations/policy_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -602,7 +602,7 @@ func testAccCheckPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tforganizations.FindPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/organizations/resource_policy.go b/internal/service/organizations/resource_policy.go index 2fb75e67258..368233c67ce 100644 --- a/internal/service/organizations/resource_policy.go +++ b/internal/service/organizations/resource_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -95,7 +96,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met policy, err := findResourcePolicy(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Organizations Resource Policy %s not found, removing from state", d.Id()) d.SetId("") return nil diff --git a/internal/service/organizations/resource_policy_test.go b/internal/service/organizations/resource_policy_test.go index ec31a5dda20..abaccf8a6df 100644 --- a/internal/service/organizations/resource_policy_test.go +++ b/internal/service/organizations/resource_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tforganizations.FindResourcePolicy(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a3bf03d37e3620b36d1440a926c8f5f0b087585f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:16 -0800 Subject: [PATCH 150/227] `osis` --- internal/service/osis/pipeline.go | 5 +++-- internal/service/osis/pipeline_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/osis/pipeline.go b/internal/service/osis/pipeline.go index a50c8fb4c01..faebee81a6b 100644 --- a/internal/service/osis/pipeline.go +++ b/internal/service/osis/pipeline.go @@ -33,6 +33,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -269,7 +270,7 @@ func (r *pipelineResource) Read(ctx context.Context, request resource.ReadReques name := data.PipelineName.ValueString() pipeline, err := findPipelineByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -397,7 +398,7 @@ func statusPipeline(ctx context.Context, conn *osis.Client, name string) sdkretr return func() (any, string, error) { output, err := findPipelineByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/osis/pipeline_test.go b/internal/service/osis/pipeline_test.go index 10af7f60551..cbf88699e0b 100644 --- a/internal/service/osis/pipeline_test.go +++ b/internal/service/osis/pipeline_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfosis "github.com/hashicorp/terraform-provider-aws/internal/service/osis" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -348,7 +348,7 @@ func testAccCheckPipelineDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfosis.FindPipelineByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 67ff9256c2da029ce7e439ddf1dbde6643348942 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:17 -0800 Subject: [PATCH 151/227] `paymentcryptography` --- internal/service/paymentcryptography/key.go | 5 +++-- internal/service/paymentcryptography/key_alias.go | 3 ++- internal/service/paymentcryptography/key_alias_test.go | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/service/paymentcryptography/key.go b/internal/service/paymentcryptography/key.go index 2f708978ef8..639d64bbf06 100644 --- a/internal/service/paymentcryptography/key.go +++ b/internal/service/paymentcryptography/key.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -315,7 +316,7 @@ func (r *keyResource) Read(ctx context.Context, request resource.ReadRequest, re } out, err := findKeyByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } @@ -468,7 +469,7 @@ func waitKeyDeleted(ctx context.Context, conn *paymentcryptography.Client, id st func statusKey(ctx context.Context, conn *paymentcryptography.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findKeyByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/paymentcryptography/key_alias.go b/internal/service/paymentcryptography/key_alias.go index fc6746cecc5..052ec675b5c 100644 --- a/internal/service/paymentcryptography/key_alias.go +++ b/internal/service/paymentcryptography/key_alias.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +115,7 @@ func (r *keyAliasResource) Read(ctx context.Context, request resource.ReadReques output, err := findkeyAliasByName(ctx, conn, data.AliasName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/paymentcryptography/key_alias_test.go b/internal/service/paymentcryptography/key_alias_test.go index 612f511c47d..5d8b00b3511 100644 --- a/internal/service/paymentcryptography/key_alias_test.go +++ b/internal/service/paymentcryptography/key_alias_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfkeyalias "github.com/hashicorp/terraform-provider-aws/internal/service/paymentcryptography" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -170,7 +170,7 @@ func testAccCheckKeyAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfkeyalias.FindKeyAliasByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 48586abc919ad16f619cc95c1e2ee5d025202369 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:18 -0800 Subject: [PATCH 152/227] `pinpoint` --- internal/service/pinpoint/adm_channel.go | 3 ++- internal/service/pinpoint/adm_channel_test.go | 4 ++-- internal/service/pinpoint/apns_channel.go | 3 ++- internal/service/pinpoint/apns_channel_test.go | 4 ++-- internal/service/pinpoint/apns_sandbox_channel.go | 3 ++- internal/service/pinpoint/apns_sandbox_channel_test.go | 4 ++-- internal/service/pinpoint/apns_voip_channel.go | 3 ++- internal/service/pinpoint/apns_voip_channel_test.go | 4 ++-- internal/service/pinpoint/apns_voip_sandbox_channel.go | 3 ++- internal/service/pinpoint/apns_voip_sandbox_channel_test.go | 4 ++-- internal/service/pinpoint/app.go | 3 ++- internal/service/pinpoint/app_test.go | 4 ++-- internal/service/pinpoint/baidu_channel.go | 3 ++- internal/service/pinpoint/baidu_channel_test.go | 4 ++-- internal/service/pinpoint/email_channel.go | 3 ++- internal/service/pinpoint/email_channel_test.go | 4 ++-- internal/service/pinpoint/email_template.go | 3 ++- internal/service/pinpoint/event_stream.go | 3 ++- internal/service/pinpoint/event_stream_test.go | 4 ++-- internal/service/pinpoint/gcm_channel.go | 3 ++- internal/service/pinpoint/gcm_channel_test.go | 4 ++-- internal/service/pinpoint/sms_channel.go | 3 ++- internal/service/pinpoint/sms_channel_test.go | 4 ++-- 23 files changed, 46 insertions(+), 34 deletions(-) diff --git a/internal/service/pinpoint/adm_channel.go b/internal/service/pinpoint/adm_channel.go index f2f2c5b7a22..634e3cb2f82 100644 --- a/internal/service/pinpoint/adm_channel.go +++ b/internal/service/pinpoint/adm_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +92,7 @@ func resourceADMChannelRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findADMChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint ADM Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/adm_channel_test.go b/internal/service/pinpoint/adm_channel_test.go index 1f1f6469025..561a7da38c5 100644 --- a/internal/service/pinpoint/adm_channel_test.go +++ b/internal/service/pinpoint/adm_channel_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckADMChannelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfpinpoint.FindADMChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/apns_channel.go b/internal/service/pinpoint/apns_channel.go index 23eb98db36b..968c7279609 100644 --- a/internal/service/pinpoint/apns_channel.go +++ b/internal/service/pinpoint/apns_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +135,7 @@ func resourceAPNSChannelRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findAPNSChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint APNS Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/apns_channel_test.go b/internal/service/pinpoint/apns_channel_test.go index 2efdf338d55..906219b9c7c 100644 --- a/internal/service/pinpoint/apns_channel_test.go +++ b/internal/service/pinpoint/apns_channel_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckAPNSChannelDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfpinpoint.FindAPNSChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/apns_sandbox_channel.go b/internal/service/pinpoint/apns_sandbox_channel.go index 972bf031fe7..cf519566aa5 100644 --- a/internal/service/pinpoint/apns_sandbox_channel.go +++ b/internal/service/pinpoint/apns_sandbox_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +135,7 @@ func resourceAPNSSandboxChannelRead(ctx context.Context, d *schema.ResourceData, output, err := findAPNSSandboxChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint APNS Sandbox Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/apns_sandbox_channel_test.go b/internal/service/pinpoint/apns_sandbox_channel_test.go index 2dff8e2666e..ff3b80ef1db 100644 --- a/internal/service/pinpoint/apns_sandbox_channel_test.go +++ b/internal/service/pinpoint/apns_sandbox_channel_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckAPNSSandboxChannelDestroy(ctx context.Context) resource.TestChe _, err := tfpinpoint.FindAPNSChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/apns_voip_channel.go b/internal/service/pinpoint/apns_voip_channel.go index 8abe76cb63e..6b7c101fe43 100644 --- a/internal/service/pinpoint/apns_voip_channel.go +++ b/internal/service/pinpoint/apns_voip_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +135,7 @@ func resourceAPNSVoIPChannelRead(ctx context.Context, d *schema.ResourceData, me output, err := findAPNSVoIPChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint APNS VoIP Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/apns_voip_channel_test.go b/internal/service/pinpoint/apns_voip_channel_test.go index 86b7f89af7d..4f47bbf0e03 100644 --- a/internal/service/pinpoint/apns_voip_channel_test.go +++ b/internal/service/pinpoint/apns_voip_channel_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckAPNSVoIPChannelDestroy(ctx context.Context) resource.TestCheckF _, err := tfpinpoint.FindAPNSVoIPChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/apns_voip_sandbox_channel.go b/internal/service/pinpoint/apns_voip_sandbox_channel.go index e4d352b1925..873847bc9e9 100644 --- a/internal/service/pinpoint/apns_voip_sandbox_channel.go +++ b/internal/service/pinpoint/apns_voip_sandbox_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +135,7 @@ func resourceAPNSVoIPSandboxChannelRead(ctx context.Context, d *schema.ResourceD output, err := findAPNSVoIPSandboxChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint APNS VoIP Sandbox Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/apns_voip_sandbox_channel_test.go b/internal/service/pinpoint/apns_voip_sandbox_channel_test.go index 42cee6b462e..e427fdb5921 100644 --- a/internal/service/pinpoint/apns_voip_sandbox_channel_test.go +++ b/internal/service/pinpoint/apns_voip_sandbox_channel_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckAPNSVoIPSandboxChannelDestroy(ctx context.Context) resource.Tes _, err := tfpinpoint.FindAPNSVoIPSandboxChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/app.go b/internal/service/pinpoint/app.go index fc71b8d5f93..610ea8ec9e9 100644 --- a/internal/service/pinpoint/app.go +++ b/internal/service/pinpoint/app.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -171,7 +172,7 @@ func resourceAppRead(ctx context.Context, d *schema.ResourceData, meta any) diag app, err := findAppByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint App (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/app_test.go b/internal/service/pinpoint/app_test.go index c83cfc23c8d..5ea6a8e7ef8 100644 --- a/internal/service/pinpoint/app_test.go +++ b/internal/service/pinpoint/app_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -429,7 +429,7 @@ func testAccCheckAppDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfpinpoint.FindAppByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/baidu_channel.go b/internal/service/pinpoint/baidu_channel.go index 3edf838c3f2..c9ed30ec045 100644 --- a/internal/service/pinpoint/baidu_channel.go +++ b/internal/service/pinpoint/baidu_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +92,7 @@ func resourceBaiduChannelRead(ctx context.Context, d *schema.ResourceData, meta output, err := findBaiduChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint Baidu Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/baidu_channel_test.go b/internal/service/pinpoint/baidu_channel_test.go index 47b0b540d6b..7f3032be6a4 100644 --- a/internal/service/pinpoint/baidu_channel_test.go +++ b/internal/service/pinpoint/baidu_channel_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +97,7 @@ func testAccCheckBaiduChannelDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfpinpoint.FindBaiduChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/email_channel.go b/internal/service/pinpoint/email_channel.go index 6dd2eed6c9a..43d6f40ef7d 100644 --- a/internal/service/pinpoint/email_channel.go +++ b/internal/service/pinpoint/email_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func resourceEmailChannelRead(ctx context.Context, d *schema.ResourceData, meta output, err := findEmailChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint Email Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/email_channel_test.go b/internal/service/pinpoint/email_channel_test.go index 2c82fe09b06..b1340955ab9 100644 --- a/internal/service/pinpoint/email_channel_test.go +++ b/internal/service/pinpoint/email_channel_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -218,7 +218,7 @@ func testAccCheckEmailChannelDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfpinpoint.FindEmailChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/email_template.go b/internal/service/pinpoint/email_template.go index 2109a350c66..48924238549 100644 --- a/internal/service/pinpoint/email_template.go +++ b/internal/service/pinpoint/email_template.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -156,7 +157,7 @@ func (r *emailTemplateResource) Read(ctx context.Context, req resource.ReadReque } out, err := findEmailTemplateByName(ctx, conn, state.TemplateName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/pinpoint/event_stream.go b/internal/service/pinpoint/event_stream.go index f8e2cd1c136..8df3d84a11b 100644 --- a/internal/service/pinpoint/event_stream.go +++ b/internal/service/pinpoint/event_stream.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourceEventStreamRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findEventStreamByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint Event Stream (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/event_stream_test.go b/internal/service/pinpoint/event_stream_test.go index 8b0a424f4a8..3d96a4fc4cf 100644 --- a/internal/service/pinpoint/event_stream_test.go +++ b/internal/service/pinpoint/event_stream_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func testAccCheckEventStreamDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfpinpoint.FindEventStreamByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/gcm_channel.go b/internal/service/pinpoint/gcm_channel.go index 0298dd0863f..eb49a7642b1 100644 --- a/internal/service/pinpoint/gcm_channel.go +++ b/internal/service/pinpoint/gcm_channel.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +118,7 @@ func resourceGCMChannelRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findGCMChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint GCM Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/gcm_channel_test.go b/internal/service/pinpoint/gcm_channel_test.go index d0065edbe31..8648cf4a67b 100644 --- a/internal/service/pinpoint/gcm_channel_test.go +++ b/internal/service/pinpoint/gcm_channel_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -182,7 +182,7 @@ func testAccCheckGCMChannelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfpinpoint.FindGCMChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpoint/sms_channel.go b/internal/service/pinpoint/sms_channel.go index a947fef40a1..982930277c4 100644 --- a/internal/service/pinpoint/sms_channel.go +++ b/internal/service/pinpoint/sms_channel.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +104,7 @@ func resourceSMSChannelRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findSMSChannelByApplicationId(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Pinpoint SMS Channel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/pinpoint/sms_channel_test.go b/internal/service/pinpoint/sms_channel_test.go index c3b9ed698a8..23a7e10f018 100644 --- a/internal/service/pinpoint/sms_channel_test.go +++ b/internal/service/pinpoint/sms_channel_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -174,7 +174,7 @@ func testAccCheckSMSChannelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfpinpoint.FindSMSChannelByApplicationId(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 613c6254259a84199ae64df97f0de760aed72916 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:19 -0800 Subject: [PATCH 153/227] `pinpointsmsvoicev2` --- internal/service/pinpointsmsvoicev2/configuration_set.go | 3 ++- .../service/pinpointsmsvoicev2/configuration_set_test.go | 4 ++-- internal/service/pinpointsmsvoicev2/opt_out_list.go | 3 ++- internal/service/pinpointsmsvoicev2/opt_out_list_test.go | 4 ++-- internal/service/pinpointsmsvoicev2/phone_number.go | 5 +++-- internal/service/pinpointsmsvoicev2/phone_number_test.go | 4 ++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/internal/service/pinpointsmsvoicev2/configuration_set.go b/internal/service/pinpointsmsvoicev2/configuration_set.go index 3614c6f507c..6d5123addfa 100644 --- a/internal/service/pinpointsmsvoicev2/configuration_set.go +++ b/internal/service/pinpointsmsvoicev2/configuration_set.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -124,7 +125,7 @@ func (r *configurationSetResource) Read(ctx context.Context, request resource.Re out, err := findConfigurationSetByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/pinpointsmsvoicev2/configuration_set_test.go b/internal/service/pinpointsmsvoicev2/configuration_set_test.go index 66b4d3ea5c2..3b23cfc7d11 100644 --- a/internal/service/pinpointsmsvoicev2/configuration_set_test.go +++ b/internal/service/pinpointsmsvoicev2/configuration_set_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpointsmsvoicev2 "github.com/hashicorp/terraform-provider-aws/internal/service/pinpointsmsvoicev2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func testAccCheckConfigurationSetDestroy(ctx context.Context) resource.TestCheck _, err := tfpinpointsmsvoicev2.FindConfigurationSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpointsmsvoicev2/opt_out_list.go b/internal/service/pinpointsmsvoicev2/opt_out_list.go index bb9e3e8682f..6b5d564c590 100644 --- a/internal/service/pinpointsmsvoicev2/opt_out_list.go +++ b/internal/service/pinpointsmsvoicev2/opt_out_list.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -110,7 +111,7 @@ func (r *optOutListResource) Read(ctx context.Context, request resource.ReadRequ out, err := findOptOutListByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/pinpointsmsvoicev2/opt_out_list_test.go b/internal/service/pinpointsmsvoicev2/opt_out_list_test.go index 7d543adceba..1a661f814ab 100644 --- a/internal/service/pinpointsmsvoicev2/opt_out_list_test.go +++ b/internal/service/pinpointsmsvoicev2/opt_out_list_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpointsmsvoicev2 "github.com/hashicorp/terraform-provider-aws/internal/service/pinpointsmsvoicev2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func testAccCheckOptOutListDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfpinpointsmsvoicev2.FindOptOutListByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/pinpointsmsvoicev2/phone_number.go b/internal/service/pinpointsmsvoicev2/phone_number.go index 005552e37b0..e8dd3c7bd82 100644 --- a/internal/service/pinpointsmsvoicev2/phone_number.go +++ b/internal/service/pinpointsmsvoicev2/phone_number.go @@ -36,6 +36,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -266,7 +267,7 @@ func (r *phoneNumberResource) Read(ctx context.Context, request resource.ReadReq out, err := findPhoneNumberByID(ctx, conn, data.PhoneNumberID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -458,7 +459,7 @@ func statusPhoneNumber(ctx context.Context, conn *pinpointsmsvoicev2.Client, id return func() (any, string, error) { output, err := findPhoneNumberByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/pinpointsmsvoicev2/phone_number_test.go b/internal/service/pinpointsmsvoicev2/phone_number_test.go index 13f67610d79..911290b0a49 100644 --- a/internal/service/pinpointsmsvoicev2/phone_number_test.go +++ b/internal/service/pinpointsmsvoicev2/phone_number_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpinpointsmsvoicev2 "github.com/hashicorp/terraform-provider-aws/internal/service/pinpointsmsvoicev2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -306,7 +306,7 @@ func testAccCheckPhoneNumberDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfpinpointsmsvoicev2.FindPhoneNumberByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 45bbe29be3e438f9b5f3ffba3a4eda110d2dedef Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:20 -0800 Subject: [PATCH 154/227] `pipes` --- internal/service/pipes/pipe.go | 5 +++-- internal/service/pipes/pipe_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/pipes/pipe.go b/internal/service/pipes/pipe.go index dd7d48f7669..912f429dab1 100644 --- a/internal/service/pipes/pipe.go +++ b/internal/service/pipes/pipe.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -194,7 +195,7 @@ func resourcePipeRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findPipeByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Pipes Pipe (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -362,7 +363,7 @@ func statusPipe(ctx context.Context, conn *pipes.Client, name string) sdkretry.S return func() (any, string, error) { output, err := findPipeByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/pipes/pipe_test.go b/internal/service/pipes/pipe_test.go index f14a689a7bc..658574c5ee4 100644 --- a/internal/service/pipes/pipe_test.go +++ b/internal/service/pipes/pipe_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfpipes "github.com/hashicorp/terraform-provider-aws/internal/service/pipes" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1703,7 +1703,7 @@ func testAccCheckPipeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfpipes.FindPipeByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 79dc715012fcb8dac7ac90bec28000a8f659d30c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:20 -0800 Subject: [PATCH 155/227] `qbusiness` --- internal/service/qbusiness/application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/qbusiness/application.go b/internal/service/qbusiness/application.go index 4ce32101450..f21202c24f9 100644 --- a/internal/service/qbusiness/application.go +++ b/internal/service/qbusiness/application.go @@ -342,7 +342,7 @@ func statusApplication(conn *qbusiness.Client, id string) retry.StateRefreshFunc return func(ctx context.Context) (any, string, error) { output, err := findApplicationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From fe74ae0f35bc50fb59e5815b668ec136a1d7ff43 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:21 -0800 Subject: [PATCH 156/227] `qldb` --- internal/service/qldb/ledger.go | 5 +++-- internal/service/qldb/ledger_test.go | 4 ++-- internal/service/qldb/stream.go | 7 ++++--- internal/service/qldb/stream_test.go | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/qldb/ledger.go b/internal/service/qldb/ledger.go index e7a62b2a1ab..1176d863224 100644 --- a/internal/service/qldb/ledger.go +++ b/internal/service/qldb/ledger.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -122,7 +123,7 @@ func resourceLedgerRead(ctx context.Context, d *schema.ResourceData, meta any) d ledger, err := findLedgerByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QLDB Ledger %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -243,7 +244,7 @@ func statusLedgerState(ctx context.Context, conn *qldb.Client, name string) sdkr return func() (any, string, error) { output, err := findLedgerByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/qldb/ledger_test.go b/internal/service/qldb/ledger_test.go index 22151666f16..b91ae3b9568 100644 --- a/internal/service/qldb/ledger_test.go +++ b/internal/service/qldb/ledger_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfqldb "github.com/hashicorp/terraform-provider-aws/internal/service/qldb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -242,7 +242,7 @@ func testAccCheckLedgerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfqldb.FindLedgerByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/qldb/stream.go b/internal/service/qldb/stream.go index f69dc7db653..b665a837042 100644 --- a/internal/service/qldb/stream.go +++ b/internal/service/qldb/stream.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -156,7 +157,7 @@ func resourceStreamRead(ctx context.Context, d *schema.ResourceData, meta any) d ledgerName := d.Get("ledger_name").(string) stream, err := findStreamByTwoPartKey(ctx, conn, ledgerName, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QLDB Stream %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -279,7 +280,7 @@ func statusStreamCreated(ctx context.Context, conn *qldb.Client, ledgerName, str StreamId: aws.String(streamID), }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -315,7 +316,7 @@ func statusStreamDeleted(ctx context.Context, conn *qldb.Client, ledgerName, str return func() (any, string, error) { output, err := findStreamByTwoPartKey(ctx, conn, ledgerName, streamID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/qldb/stream_test.go b/internal/service/qldb/stream_test.go index 06afaecdd87..fd3f26f5be0 100644 --- a/internal/service/qldb/stream_test.go +++ b/internal/service/qldb/stream_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfqldb "github.com/hashicorp/terraform-provider-aws/internal/service/qldb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func testAccCheckStreamDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfqldb.FindStreamByTwoPartKey(ctx, conn, rs.Primary.Attributes["ledger_name"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From c19da625d5c7caef822f774d2cfb94cea0edd334 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:22 -0800 Subject: [PATCH 157/227] `quicksight` --- internal/service/quicksight/account_settings.go | 3 ++- internal/service/quicksight/account_subscription.go | 5 +++-- internal/service/quicksight/account_subscription_test.go | 4 ++-- internal/service/quicksight/analysis.go | 5 +++-- internal/service/quicksight/analysis_test.go | 4 ++-- internal/service/quicksight/custom_permissions.go | 3 ++- internal/service/quicksight/custom_permissions_test.go | 4 ++-- internal/service/quicksight/dashboard.go | 5 +++-- internal/service/quicksight/dashboard_test.go | 4 ++-- internal/service/quicksight/data_set.go | 5 +++-- internal/service/quicksight/data_set_test.go | 4 ++-- internal/service/quicksight/data_source.go | 5 +++-- internal/service/quicksight/data_source_test.go | 4 ++-- internal/service/quicksight/folder.go | 3 ++- internal/service/quicksight/folder_membership.go | 3 ++- internal/service/quicksight/folder_membership_test.go | 4 ++-- internal/service/quicksight/folder_test.go | 4 ++-- internal/service/quicksight/group.go | 3 ++- internal/service/quicksight/group_membership.go | 3 ++- internal/service/quicksight/group_membership_test.go | 4 ++-- internal/service/quicksight/group_test.go | 4 ++-- internal/service/quicksight/iam_policy_assignment.go | 3 ++- internal/service/quicksight/iam_policy_assignment_test.go | 4 ++-- internal/service/quicksight/ingestion.go | 3 ++- internal/service/quicksight/ingestion_test.go | 4 ++-- internal/service/quicksight/ip_restriction.go | 3 ++- internal/service/quicksight/ip_restriction_test.go | 4 ++-- internal/service/quicksight/key_registration.go | 3 ++- internal/service/quicksight/key_registration_test.go | 4 ++-- internal/service/quicksight/namespace.go | 5 +++-- internal/service/quicksight/namespace_test.go | 4 ++-- internal/service/quicksight/refresh_schedule.go | 3 ++- internal/service/quicksight/refresh_schedule_test.go | 4 ++-- internal/service/quicksight/role_custom_permission.go | 3 ++- internal/service/quicksight/role_custom_permission_test.go | 4 ++-- internal/service/quicksight/role_membership.go | 4 ++-- internal/service/quicksight/role_membership_test.go | 4 ++-- internal/service/quicksight/template.go | 5 +++-- internal/service/quicksight/template_alias.go | 3 ++- internal/service/quicksight/template_alias_test.go | 4 ++-- internal/service/quicksight/template_test.go | 4 ++-- internal/service/quicksight/theme.go | 5 +++-- internal/service/quicksight/theme_test.go | 4 ++-- internal/service/quicksight/user.go | 3 ++- internal/service/quicksight/user_custom_permission.go | 3 ++- internal/service/quicksight/user_custom_permission_test.go | 4 ++-- internal/service/quicksight/user_test.go | 4 ++-- internal/service/quicksight/vpc_connection.go | 5 +++-- internal/service/quicksight/vpc_connection_test.go | 4 ++-- 49 files changed, 107 insertions(+), 83 deletions(-) diff --git a/internal/service/quicksight/account_settings.go b/internal/service/quicksight/account_settings.go index 872338345d2..d43f53a76c1 100644 --- a/internal/service/quicksight/account_settings.go +++ b/internal/service/quicksight/account_settings.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -103,7 +104,7 @@ func (r *accountSettingsResource) Read(ctx context.Context, request resource.Rea output, err := findAccountSettingsByID(ctx, conn, data.AWSAccountID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/account_subscription.go b/internal/service/quicksight/account_subscription.go index 58188c35aa7..cf78412332d 100644 --- a/internal/service/quicksight/account_subscription.go +++ b/internal/service/quicksight/account_subscription.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -251,7 +252,7 @@ func resourceAccountSubscriptionRead(ctx context.Context, d *schema.ResourceData out, err := findAccountSubscriptionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Account Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -341,7 +342,7 @@ func statusAccountSubscription(ctx context.Context, conn *quicksight.Client, id return func() (any, string, error) { output, err := findAccountSubscriptionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/account_subscription_test.go b/internal/service/quicksight/account_subscription_test.go index f58bfe38bf8..83b36db7160 100644 --- a/internal/service/quicksight/account_subscription_test.go +++ b/internal/service/quicksight/account_subscription_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +99,7 @@ func testAccCheckAccountSubscriptionDestroy(ctx context.Context) resource.TestCh _, err := tfquicksight.FindAccountSubscriptionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/analysis.go b/internal/service/quicksight/analysis.go index 46c94e48028..1eedd166f52 100644 --- a/internal/service/quicksight/analysis.go +++ b/internal/service/quicksight/analysis.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -173,7 +174,7 @@ func resourceAnalysisRead(ctx context.Context, d *schema.ResourceData, meta any) analysis, err := findAnalysisByTwoPartKey(ctx, conn, awsAccountID, analysisID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Analysis (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -444,7 +445,7 @@ func statusAnalysis(ctx context.Context, conn *quicksight.Client, awsAccountID, return func() (any, string, error) { output, err := findAnalysisByTwoPartKey(ctx, conn, awsAccountID, analysisID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/analysis_test.go b/internal/service/quicksight/analysis_test.go index 45db8a4377d..a2d3396b88d 100644 --- a/internal/service/quicksight/analysis_test.go +++ b/internal/service/quicksight/analysis_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -339,7 +339,7 @@ func testAccCheckAnalysisDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindAnalysisByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["analysis_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/custom_permissions.go b/internal/service/quicksight/custom_permissions.go index adceac4d1d5..558734291cd 100644 --- a/internal/service/quicksight/custom_permissions.go +++ b/internal/service/quicksight/custom_permissions.go @@ -29,6 +29,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -137,7 +138,7 @@ func (r *customPermissionsResource) Read(ctx context.Context, request resource.R accountID, name := fwflex.StringValueFromFramework(ctx, data.AWSAccountID), fwflex.StringValueFromFramework(ctx, data.CustomPermissionsName) output, err := findCustomPermissionsByTwoPartKey(ctx, conn, accountID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/custom_permissions_test.go b/internal/service/quicksight/custom_permissions_test.go index 34d437f1f22..9569c840b28 100644 --- a/internal/service/quicksight/custom_permissions_test.go +++ b/internal/service/quicksight/custom_permissions_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +238,7 @@ func testAccCheckCustomPermissionsDestroy(ctx context.Context) resource.TestChec _, err := tfquicksight.FindCustomPermissionsByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["custom_permissions_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/dashboard.go b/internal/service/quicksight/dashboard.go index a03fedeb91b..6e94559e3d4 100644 --- a/internal/service/quicksight/dashboard.go +++ b/internal/service/quicksight/dashboard.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -184,7 +185,7 @@ func resourceDashboardRead(ctx context.Context, d *schema.ResourceData, meta any dashboard, err := findDashboardByThreePartKey(ctx, conn, awsAccountID, dashboardID, dashboardLatestVersion) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Dashboard (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -464,7 +465,7 @@ func statusDashboard(ctx context.Context, conn *quicksight.Client, awsAccountID, return func() (any, string, error) { output, err := findDashboardByThreePartKey(ctx, conn, awsAccountID, dashboardID, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/dashboard_test.go b/internal/service/quicksight/dashboard_test.go index 0fb2b9d36c6..56e9ecc690c 100644 --- a/internal/service/quicksight/dashboard_test.go +++ b/internal/service/quicksight/dashboard_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -238,7 +238,7 @@ func testAccCheckDashboardDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindDashboardByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["dashboard_id"], tfquicksight.DashboardLatestVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/data_set.go b/internal/service/quicksight/data_set.go index 8c7b3e65ba1..02f7a55a077 100644 --- a/internal/service/quicksight/data_set.go +++ b/internal/service/quicksight/data_set.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -179,7 +180,7 @@ func resourceDataSetRead(ctx context.Context, d *schema.ResourceData, meta any) dataSet, err := findDataSetByTwoPartKey(ctx, conn, awsAccountID, dataSetID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Data Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -235,7 +236,7 @@ func resourceDataSetRead(ctx context.Context, d *schema.ResourceData, meta any) refreshProperties, err := findDataSetRefreshPropertiesByTwoPartKey(ctx, conn, awsAccountID, dataSetID) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendErrorf(diags, "reading QuickSight Data Set (%s) refresh properties: %s", d.Id(), err) default: diff --git a/internal/service/quicksight/data_set_test.go b/internal/service/quicksight/data_set_test.go index d7477b747b2..b1a92dca96d 100644 --- a/internal/service/quicksight/data_set_test.go +++ b/internal/service/quicksight/data_set_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -553,7 +553,7 @@ func testAccCheckDataSetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindDataSetByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["data_set_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/data_source.go b/internal/service/quicksight/data_source.go index 2fda8fbd94b..2745f8b1704 100644 --- a/internal/service/quicksight/data_source.go +++ b/internal/service/quicksight/data_source.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -168,7 +169,7 @@ func resourceDataSourceRead(ctx context.Context, d *schema.ResourceData, meta an dataSource, err := findDataSourceByTwoPartKey(ctx, conn, awsAccountID, dataSourceID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Data Source (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -403,7 +404,7 @@ func statusDataSource(ctx context.Context, conn *quicksight.Client, awsAccountID return func() (any, string, error) { output, err := findDataSourceByTwoPartKey(ctx, conn, awsAccountID, dataSourceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/data_source_test.go b/internal/service/quicksight/data_source_test.go index 020cbe613f1..1199f4959e2 100644 --- a/internal/service/quicksight/data_source_test.go +++ b/internal/service/quicksight/data_source_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -321,7 +321,7 @@ func testAccCheckDataSourceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindDataSourceByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["data_source_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/folder.go b/internal/service/quicksight/folder.go index e4460beeef5..369d8e0f80b 100644 --- a/internal/service/quicksight/folder.go +++ b/internal/service/quicksight/folder.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -158,7 +159,7 @@ func resourceFolderRead(ctx context.Context, d *schema.ResourceData, meta any) d folder, err := findFolderByTwoPartKey(ctx, conn, awsAccountID, folderID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Folder (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/quicksight/folder_membership.go b/internal/service/quicksight/folder_membership.go index e53b1abdead..8177dab7ac3 100644 --- a/internal/service/quicksight/folder_membership.go +++ b/internal/service/quicksight/folder_membership.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -135,7 +136,7 @@ func (r *folderMembershipResource) Read(ctx context.Context, req resource.ReadRe } out, err := findFolderMembershipByFourPartKey(ctx, conn, awsAccountID, folderID, memberType, memberID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/quicksight/folder_membership_test.go b/internal/service/quicksight/folder_membership_test.go index b899cc3b896..58e758b699d 100644 --- a/internal/service/quicksight/folder_membership_test.go +++ b/internal/service/quicksight/folder_membership_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckFolderMembershipDestroy(ctx context.Context) resource.TestCheck _, err := tfquicksight.FindFolderMembershipByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["folder_id"], rs.Primary.Attributes["member_type"], rs.Primary.Attributes["member_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/folder_test.go b/internal/service/quicksight/folder_test.go index f1c25f82343..b65e5b90e29 100644 --- a/internal/service/quicksight/folder_test.go +++ b/internal/service/quicksight/folder_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -244,7 +244,7 @@ func testAccCheckFolderDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindFolderByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["folder_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/group.go b/internal/service/quicksight/group.go index 6c99e8fe106..d17c039a478 100644 --- a/internal/service/quicksight/group.go +++ b/internal/service/quicksight/group.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -100,7 +101,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di group, err := findGroupByThreePartKey(ctx, conn, awsAccountID, namespace, groupName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/quicksight/group_membership.go b/internal/service/quicksight/group_membership.go index b81d4c317b2..c01ec08d917 100644 --- a/internal/service/quicksight/group_membership.go +++ b/internal/service/quicksight/group_membership.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -99,7 +100,7 @@ func resourceGroupMembershipRead(ctx context.Context, d *schema.ResourceData, me member, err := findGroupMembershipByFourPartKey(ctx, conn, awsAccountID, namespace, groupName, memberName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Group Membership (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/quicksight/group_membership_test.go b/internal/service/quicksight/group_membership_test.go index 26109a5f929..ee3b996ea2c 100644 --- a/internal/service/quicksight/group_membership_test.go +++ b/internal/service/quicksight/group_membership_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func testAccCheckGroupMembershipDestroy(ctx context.Context) resource.TestCheckF _, err := tfquicksight.FindGroupMembershipByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrGroupName], rs.Primary.Attributes["member_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/group_test.go b/internal/service/quicksight/group_test.go index b8ad3d5c00f..a70e4451b8b 100644 --- a/internal/service/quicksight/group_test.go +++ b/internal/service/quicksight/group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func testAccCheckGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindGroupByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrGroupName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/iam_policy_assignment.go b/internal/service/quicksight/iam_policy_assignment.go index f88603d78d0..2299f58baab 100644 --- a/internal/service/quicksight/iam_policy_assignment.go +++ b/internal/service/quicksight/iam_policy_assignment.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -162,7 +163,7 @@ func (r *iamPolicyAssignmentResource) Read(ctx context.Context, request resource output, err := findIAMPolicyAssignmentByThreePartKey(ctx, conn, awsAccountID, namespace, assignmentName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/iam_policy_assignment_test.go b/internal/service/quicksight/iam_policy_assignment_test.go index bbd1d117c45..a18b5f14e61 100644 --- a/internal/service/quicksight/iam_policy_assignment_test.go +++ b/internal/service/quicksight/iam_policy_assignment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +188,7 @@ func testAccCheckIAMPolicyAssignmentDestroy(ctx context.Context) resource.TestCh _, err := tfquicksight.FindIAMPolicyAssignmentByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes["assignment_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/ingestion.go b/internal/service/quicksight/ingestion.go index bb1e3374177..b689a8d828f 100644 --- a/internal/service/quicksight/ingestion.go +++ b/internal/service/quicksight/ingestion.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -142,7 +143,7 @@ func (r *ingestionResource) Read(ctx context.Context, req resource.ReadRequest, } out, err := findIngestionByThreePartKey(ctx, conn, awsAccountID, dataSetID, ingestionID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/quicksight/ingestion_test.go b/internal/service/quicksight/ingestion_test.go index 666e4cb35be..e6004b812b8 100644 --- a/internal/service/quicksight/ingestion_test.go +++ b/internal/service/quicksight/ingestion_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -118,7 +118,7 @@ func testAccCheckIngestionDestroy(ctx context.Context) resource.TestCheckFunc { output, err := tfquicksight.FindIngestionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["data_set_id"], rs.Primary.Attributes["ingestion_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/ip_restriction.go b/internal/service/quicksight/ip_restriction.go index 62498ba46d9..e9047a43c00 100644 --- a/internal/service/quicksight/ip_restriction.go +++ b/internal/service/quicksight/ip_restriction.go @@ -25,6 +25,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -132,7 +133,7 @@ func (r *ipRestrictionResource) Read(ctx context.Context, request resource.ReadR accountID := fwflex.StringValueFromFramework(ctx, data.AWSAccountID) output, err := findIPRestrictionByID(ctx, conn, accountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/ip_restriction_test.go b/internal/service/quicksight/ip_restriction_test.go index 19c45f633e3..722a052531b 100644 --- a/internal/service/quicksight/ip_restriction_test.go +++ b/internal/service/quicksight/ip_restriction_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -176,7 +176,7 @@ func testAccCheckIPRestrictionDestroy(ctx context.Context) resource.TestCheckFun _, err := tfquicksight.FindIPRestrictionByID(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/key_registration.go b/internal/service/quicksight/key_registration.go index 96948516478..6b15003c518 100644 --- a/internal/service/quicksight/key_registration.go +++ b/internal/service/quicksight/key_registration.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -109,7 +110,7 @@ func (r *keyRegistrationResource) Read(ctx context.Context, request resource.Rea accountID := fwflex.StringValueFromFramework(ctx, data.AWSAccountID) output, err := findKeyRegistrationByID(ctx, conn, accountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/key_registration_test.go b/internal/service/quicksight/key_registration_test.go index d3d313bf15e..d5ec8f4ea29 100644 --- a/internal/service/quicksight/key_registration_test.go +++ b/internal/service/quicksight/key_registration_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +135,7 @@ func testAccCheckKeyRegistrationDestroy(ctx context.Context) resource.TestCheckF _, err := tfquicksight.FindKeyRegistrationByID(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/namespace.go b/internal/service/quicksight/namespace.go index 49f6791d3a6..a7220120a7b 100644 --- a/internal/service/quicksight/namespace.go +++ b/internal/service/quicksight/namespace.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -172,7 +173,7 @@ func (r *namespaceResource) Read(ctx context.Context, req resource.ReadRequest, } out, err := findNamespaceByTwoPartKey(ctx, conn, awsAccountID, namespace) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -341,7 +342,7 @@ func statusNamespace(ctx context.Context, conn *quicksight.Client, awsAccountID, return func() (any, string, error) { output, err := findNamespaceByTwoPartKey(ctx, conn, awsAccountID, namespace) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/namespace_test.go b/internal/service/quicksight/namespace_test.go index 270a5a8d7fb..c29c9f850c9 100644 --- a/internal/service/quicksight/namespace_test.go +++ b/internal/service/quicksight/namespace_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func testAccCheckNamespaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindNamespaceByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/refresh_schedule.go b/internal/service/quicksight/refresh_schedule.go index 94ddb037057..2c975027111 100644 --- a/internal/service/quicksight/refresh_schedule.go +++ b/internal/service/quicksight/refresh_schedule.go @@ -33,6 +33,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -280,7 +281,7 @@ func (r *refreshScheduleResource) Read(ctx context.Context, req resource.ReadReq } arn, outFind, err := findRefreshScheduleByThreePartKey(ctx, conn, awsAccountID, dataSetID, scheduleID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/quicksight/refresh_schedule_test.go b/internal/service/quicksight/refresh_schedule_test.go index 24eb810ab4e..fb8d1f4db86 100644 --- a/internal/service/quicksight/refresh_schedule_test.go +++ b/internal/service/quicksight/refresh_schedule_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -458,7 +458,7 @@ func testAccCheckRefreshScheduleDestroy(ctx context.Context) resource.TestCheckF _, _, err := tfquicksight.FindRefreshScheduleByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["data_set_id"], rs.Primary.Attributes["schedule_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/role_custom_permission.go b/internal/service/quicksight/role_custom_permission.go index 9a35d546981..a3b6a42e5c8 100644 --- a/internal/service/quicksight/role_custom_permission.go +++ b/internal/service/quicksight/role_custom_permission.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func (r *roleCustomPermissionResource) Read(ctx context.Context, request resourc output, err := findRoleCustomPermissionByThreePartKey(ctx, conn, data.AWSAccountID.ValueString(), data.Namespace.ValueString(), data.Role.ValueEnum()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/role_custom_permission_test.go b/internal/service/quicksight/role_custom_permission_test.go index 675a51e410f..8cb3273afa0 100644 --- a/internal/service/quicksight/role_custom_permission_test.go +++ b/internal/service/quicksight/role_custom_permission_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +171,7 @@ func testAccCheckRoleCustomPermissionDestroy(ctx context.Context) resource.TestC _, err := tfquicksight.FindRoleCustomPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], awstypes.Role(rs.Primary.Attributes[names.AttrRole])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/role_membership.go b/internal/service/quicksight/role_membership.go index 3874097f1d8..b1d57424d24 100644 --- a/internal/service/quicksight/role_membership.go +++ b/internal/service/quicksight/role_membership.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func (r *roleMembershipResource) Read(ctx context.Context, request resource.Read conn := r.Meta().QuickSightClient(ctx) err := findRoleMembershipByFourPartKey(ctx, conn, data.AWSAccountID.ValueString(), data.Namespace.ValueString(), data.Role.ValueEnum(), data.MemberName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/role_membership_test.go b/internal/service/quicksight/role_membership_test.go index 7ddde49cd40..8e36938eb5b 100644 --- a/internal/service/quicksight/role_membership_test.go +++ b/internal/service/quicksight/role_membership_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func testAccCheckRoleMembershipDestroy(ctx context.Context) resource.TestCheckFu err := tfquicksight.FindRoleMembershipByFourPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], awstypes.Role(rs.Primary.Attributes[names.AttrRole]), rs.Primary.Attributes["member_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/template.go b/internal/service/quicksight/template.go index 3987f2cf7aa..edd0c868882 100644 --- a/internal/service/quicksight/template.go +++ b/internal/service/quicksight/template.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -161,7 +162,7 @@ func resourceTemplateRead(ctx context.Context, d *schema.ResourceData, meta any) template, err := findTemplateByTwoPartKey(ctx, conn, awsAccountID, templateID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Template (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -409,7 +410,7 @@ func statusTemplate(ctx context.Context, conn *quicksight.Client, awsAccountID, return func() (any, string, error) { output, err := findTemplateByTwoPartKey(ctx, conn, awsAccountID, templateID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/template_alias.go b/internal/service/quicksight/template_alias.go index 2c717360a7e..f676d21249e 100644 --- a/internal/service/quicksight/template_alias.go +++ b/internal/service/quicksight/template_alias.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -127,7 +128,7 @@ func (r *templateAliasResource) Read(ctx context.Context, req resource.ReadReque } out, err := findTemplateAliasByThreePartKey(ctx, conn, awsAccountID, templateID, aliasName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/quicksight/template_alias_test.go b/internal/service/quicksight/template_alias_test.go index 99a467a75fd..f6013869256 100644 --- a/internal/service/quicksight/template_alias_test.go +++ b/internal/service/quicksight/template_alias_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func testAccCheckTemplateAliasDestroy(ctx context.Context) resource.TestCheckFun _, err := tfquicksight.FindTemplateAliasByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["template_id"], rs.Primary.Attributes["alias_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/template_test.go b/internal/service/quicksight/template_test.go index e48b83edf8c..474d441a0d6 100644 --- a/internal/service/quicksight/template_test.go +++ b/internal/service/quicksight/template_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -260,7 +260,7 @@ func testAccCheckTemplateDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindTemplateByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["template_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/theme.go b/internal/service/quicksight/theme.go index 022928c9e54..e53cd709bb5 100644 --- a/internal/service/quicksight/theme.go +++ b/internal/service/quicksight/theme.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -157,7 +158,7 @@ func resourceThemeRead(ctx context.Context, d *schema.ResourceData, meta any) di theme, err := findThemeByTwoPartKey(ctx, conn, awsAccountID, themeID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight Theme (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -363,7 +364,7 @@ func statusTheme(ctx context.Context, conn *quicksight.Client, awsAccountID, the return func() (any, string, error) { output, err := findThemeByTwoPartKey(ctx, conn, awsAccountID, themeID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/theme_test.go b/internal/service/quicksight/theme_test.go index 77a6be7b68a..890d1870a87 100644 --- a/internal/service/quicksight/theme_test.go +++ b/internal/service/quicksight/theme_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func testAccCheckThemeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindThemeByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["theme_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/user.go b/internal/service/quicksight/user.go index b0d33ca4c08..76cf8cc2780 100644 --- a/internal/service/quicksight/user.go +++ b/internal/service/quicksight/user.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -141,7 +142,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia user, err := findUserByThreePartKey(ctx, conn, awsAccountID, namespace, userName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] QuickSight User (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/quicksight/user_custom_permission.go b/internal/service/quicksight/user_custom_permission.go index da5330485a8..2d3b34e22ac 100644 --- a/internal/service/quicksight/user_custom_permission.go +++ b/internal/service/quicksight/user_custom_permission.go @@ -21,6 +21,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -95,7 +96,7 @@ func (r *userCustomPermissionResource) Read(ctx context.Context, request resourc output, err := findUserCustomPermissionByThreePartKey(ctx, conn, data.AWSAccountID.ValueString(), data.Namespace.ValueString(), data.UserName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/quicksight/user_custom_permission_test.go b/internal/service/quicksight/user_custom_permission_test.go index 34eecf69ab6..33004cd4890 100644 --- a/internal/service/quicksight/user_custom_permission_test.go +++ b/internal/service/quicksight/user_custom_permission_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -170,7 +170,7 @@ func testAccCheckUserCustomPermissionDestroy(ctx context.Context) resource.TestC _, err := tfquicksight.FindUserCustomPermissionByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrUserName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/user_test.go b/internal/service/quicksight/user_test.go index 7438713979f..beab3a92a95 100644 --- a/internal/service/quicksight/user_test.go +++ b/internal/service/quicksight/user_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +171,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfquicksight.FindUserByThreePartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes[names.AttrNamespace], rs.Primary.Attributes[names.AttrUserName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/quicksight/vpc_connection.go b/internal/service/quicksight/vpc_connection.go index ae4cb2c5e2a..ea3ff4b872f 100644 --- a/internal/service/quicksight/vpc_connection.go +++ b/internal/service/quicksight/vpc_connection.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -229,7 +230,7 @@ func (r *vpcConnectionResource) Read(ctx context.Context, req resource.ReadReque } out, err := findVPCConnectionByTwoPartKey(ctx, conn, awsAccountID, vpcConnectionID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -495,7 +496,7 @@ func statusVPCConnection(ctx context.Context, conn *quicksight.Client, awsAccoun return func() (any, string, error) { output, err := findVPCConnectionByTwoPartKey(ctx, conn, awsAccountID, vpcConnectionID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/quicksight/vpc_connection_test.go b/internal/service/quicksight/vpc_connection_test.go index fd37c84371b..64c60926635 100644 --- a/internal/service/quicksight/vpc_connection_test.go +++ b/internal/service/quicksight/vpc_connection_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func testAccCheckVPCConnectionDestroy(ctx context.Context) resource.TestCheckFun _, err := tfquicksight.FindVPCConnectionByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAWSAccountID], rs.Primary.Attributes["vpc_connection_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 0f6b0790a5600f87a0b98255a53d7fe5cb550bf9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:23 -0800 Subject: [PATCH 158/227] `ram` --- internal/service/ram/principal_association.go | 7 ++++--- internal/service/ram/principal_association_test.go | 6 +++--- internal/service/ram/resource_association.go | 7 ++++--- internal/service/ram/resource_association_test.go | 4 ++-- internal/service/ram/resource_share.go | 5 +++-- internal/service/ram/resource_share_accepter.go | 5 +++-- internal/service/ram/resource_share_accepter_test.go | 4 ++-- internal/service/ram/resource_share_test.go | 4 ++-- internal/service/ram/sharing_with_organization.go | 4 ++-- 9 files changed, 25 insertions(+), 21 deletions(-) diff --git a/internal/service/ram/principal_association.go b/internal/service/ram/principal_association.go index ff6d3087e29..27ed2ee3764 100644 --- a/internal/service/ram/principal_association.go +++ b/internal/service/ram/principal_association.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -82,7 +83,7 @@ func resourcePrincipalAssociationCreate(ctx context.Context, d *schema.ResourceD switch { case err == nil: return sdkdiag.AppendFromErr(diags, fmt.Errorf("RAM Principal Association (%s) already exists", id)) - case tfresource.NotFound(err): + case retry.NotFound(err): break default: return sdkdiag.AppendErrorf(diags, "reading RAM Principal Association: %s", err) @@ -126,7 +127,7 @@ func resourcePrincipalAssociationRead(ctx context.Context, d *schema.ResourceDat principalAssociation, err := findPrincipalAssociationByTwoPartKey(ctx, conn, resourceShareARN, principal) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RAM Principal Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -200,7 +201,7 @@ func statusPrincipalAssociation(ctx context.Context, conn *ram.Client, resourceS return func() (any, string, error) { output, err := findPrincipalAssociationByTwoPartKey(ctx, conn, resourceShareARN, principal) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ram/principal_association_test.go b/internal/service/ram/principal_association_test.go index 440c3d8c87f..73e2b0bc343 100644 --- a/internal/service/ram/principal_association_test.go +++ b/internal/service/ram/principal_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +135,7 @@ func testAccPreCheckSharingWithOrganizationEnabled(ctx context.Context, t *testi t.Skipf("skipping acceptance testing: %s", err) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { t.Skipf("Sharing with AWS Organization not found, skipping acceptance test: %s", err) } @@ -176,7 +176,7 @@ func testAccCheckPrincipalAssociationDestroy(ctx context.Context) resource.TestC _, err := tfram.FindPrincipalAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["resource_share_arn"], rs.Primary.Attributes[names.AttrPrincipal]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ram/resource_association.go b/internal/service/ram/resource_association.go index 6ecd1760afc..c005682814e 100644 --- a/internal/service/ram/resource_association.go +++ b/internal/service/ram/resource_association.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -74,7 +75,7 @@ func resourceResourceAssociationCreate(ctx context.Context, d *schema.ResourceDa switch { case err == nil: return sdkdiag.AppendFromErr(diags, fmt.Errorf("RAM Resource Association (%s) already exists", id)) - case tfresource.NotFound(err): + case retry.NotFound(err): break default: return sdkdiag.AppendErrorf(diags, "reading RAM Resource Association: %s", err) @@ -113,7 +114,7 @@ func resourceResourceAssociationRead(ctx context.Context, d *schema.ResourceData resourceAssociation, err := findResourceAssociationByTwoPartKey(ctx, conn, resourceShareARN, resourceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RAM Resource Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -221,7 +222,7 @@ func statusResourceAssociation(ctx context.Context, conn *ram.Client, resourceSh return func() (any, string, error) { output, err := findResourceAssociationByTwoPartKey(ctx, conn, resourceShareARN, resourceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ram/resource_association_test.go b/internal/service/ram/resource_association_test.go index 6a786b5a755..1498274e7be 100644 --- a/internal/service/ram/resource_association_test.go +++ b/internal/service/ram/resource_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func testAccCheckResourceAssociationDestroy(ctx context.Context) resource.TestCh _, err := tfram.FindResourceAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["resource_share_arn"], rs.Primary.Attributes[names.AttrResourceARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ram/resource_share.go b/internal/service/ram/resource_share.go index 2bf510dde06..3de6863c9e1 100644 --- a/internal/service/ram/resource_share.go +++ b/internal/service/ram/resource_share.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -123,7 +124,7 @@ func resourceResourceShareRead(ctx context.Context, d *schema.ResourceData, meta resourceShare, err := findResourceShareOwnerSelfByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RAM Resource Share (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -267,7 +268,7 @@ func statusResourceShareOwnerSelf(ctx context.Context, conn *ram.Client, arn str return func() (any, string, error) { output, err := findResourceShareOwnerSelfByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ram/resource_share_accepter.go b/internal/service/ram/resource_share_accepter.go index f9b09cc7b49..69918d777d3 100644 --- a/internal/service/ram/resource_share_accepter.go +++ b/internal/service/ram/resource_share_accepter.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/types/option" @@ -164,7 +165,7 @@ func resourceResourceShareAccepterRead(ctx context.Context, d *schema.ResourceDa resourceShare, err := findResourceShareOwnerOtherAccountsByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] No RAM Resource Share %s found, removing from state", d.Id()) d.SetId("") return diags @@ -358,7 +359,7 @@ func statusResourceShareInvitation(ctx context.Context, conn *ram.Client, arn st return func() (any, string, error) { maybeInvitation, err := findMaybeResourceShareInvitationByARN(ctx, conn, arn) - if tfresource.NotFound(err) || maybeInvitation.IsNone() { + if retry.NotFound(err) || maybeInvitation.IsNone() { return nil, "", nil } diff --git a/internal/service/ram/resource_share_accepter_test.go b/internal/service/ram/resource_share_accepter_test.go index 05dcedda503..e2c9c416c8a 100644 --- a/internal/service/ram/resource_share_accepter_test.go +++ b/internal/service/ram/resource_share_accepter_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func testAccCheckResourceShareAccepterDestroy(ctx context.Context) resource.Test _, err := tfram.FindResourceShareOwnerOtherAccountsByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ram/resource_share_test.go b/internal/service/ram/resource_share_test.go index 79e964b20cf..d48092987d8 100644 --- a/internal/service/ram/resource_share_test.go +++ b/internal/service/ram/resource_share_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -257,7 +257,7 @@ func testAccCheckResourceShareDestroy(ctx context.Context) resource.TestCheckFun _, err := tfram.FindResourceShareOwnerSelfByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ram/sharing_with_organization.go b/internal/service/ram/sharing_with_organization.go index 269bf4eb216..ace6fdc483c 100644 --- a/internal/service/ram/sharing_with_organization.go +++ b/internal/service/ram/sharing_with_organization.go @@ -16,9 +16,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) // @SDKResource("aws_ram_sharing_with_organization", name="Sharing With Organization") @@ -66,7 +66,7 @@ func resourceSharingWithOrganizationRead(ctx context.Context, d *schema.Resource err := findSharingWithOrganization(ctx, meta.(*conns.AWSClient)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RAM Sharing With Organization %s not found, removing from state", d.Id()) d.SetId("") return diags From fd859b715de4016624e31ea2f0498043e960cb42 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:25 -0800 Subject: [PATCH 159/227] `rbin` --- internal/service/rbin/rule.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/rbin/rule.go b/internal/service/rbin/rule.go index 3c586c1d5ae..a0877aba0a4 100644 --- a/internal/service/rbin/rule.go +++ b/internal/service/rbin/rule.go @@ -341,7 +341,7 @@ func statusRule(conn *rbin.Client, id string) retry.StateRefreshFunc { return func(ctx context.Context) (any, string, error) { output, err := findRuleByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 38ddf8f12a4222267ebee9f5216f69e9193ff27f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:26 -0800 Subject: [PATCH 160/227] `rds` --- internal/service/rds/certificate.go | 3 ++- internal/service/rds/certificate_test.go | 4 ++-- internal/service/rds/cluster.go | 7 ++++--- internal/service/rds/cluster_activity_stream.go | 6 +++--- internal/service/rds/cluster_activity_stream_test.go | 4 ++-- internal/service/rds/cluster_endpoint.go | 5 +++-- internal/service/rds/cluster_endpoint_test.go | 4 ++-- internal/service/rds/cluster_instance.go | 2 +- internal/service/rds/cluster_instance_test.go | 6 +++--- internal/service/rds/cluster_parameter_group.go | 3 ++- internal/service/rds/cluster_parameter_group_test.go | 4 ++-- internal/service/rds/cluster_role_association.go | 5 +++-- internal/service/rds/cluster_role_association_test.go | 4 ++-- internal/service/rds/cluster_snapshot.go | 7 ++++--- internal/service/rds/cluster_snapshot_copy.go | 6 +++--- internal/service/rds/cluster_snapshot_copy_test.go | 4 ++-- internal/service/rds/cluster_snapshot_test.go | 4 ++-- internal/service/rds/cluster_test.go | 6 +++--- internal/service/rds/custom_db_engine_version.go | 5 +++-- internal/service/rds/custom_db_engine_version_test.go | 4 ++-- internal/service/rds/event_subscription.go | 5 +++-- internal/service/rds/event_subscription_test.go | 4 ++-- internal/service/rds/export_task.go | 5 +++-- internal/service/rds/export_task_test.go | 4 ++-- internal/service/rds/global_cluster.go | 5 +++-- internal/service/rds/global_cluster_test.go | 4 ++-- internal/service/rds/instance.go | 10 +++++----- .../rds/instance_automated_backups_replication.go | 9 +++++---- .../rds/instance_automated_backups_replication_test.go | 4 ++-- internal/service/rds/instance_role_association.go | 5 +++-- internal/service/rds/instance_role_association_test.go | 4 ++-- internal/service/rds/instance_state.go | 4 ++-- internal/service/rds/instance_test.go | 9 +++++---- internal/service/rds/integration.go | 5 +++-- internal/service/rds/integration_test.go | 4 ++-- internal/service/rds/option_group.go | 3 ++- internal/service/rds/option_group_test.go | 4 ++-- internal/service/rds/parameter_group.go | 3 ++- internal/service/rds/parameter_group_test.go | 4 ++-- internal/service/rds/proxy.go | 5 +++-- internal/service/rds/proxy_default_target_group.go | 5 +++-- .../service/rds/proxy_default_target_group_test.go | 4 ++-- internal/service/rds/proxy_endpoint.go | 5 +++-- internal/service/rds/proxy_endpoint_test.go | 4 ++-- internal/service/rds/proxy_target.go | 3 ++- internal/service/rds/proxy_target_test.go | 4 ++-- internal/service/rds/proxy_test.go | 4 ++-- internal/service/rds/reserved_instance.go | 5 +++-- internal/service/rds/shard_group.go | 5 +++-- internal/service/rds/shard_group_test.go | 4 ++-- internal/service/rds/snapshot.go | 7 ++++--- internal/service/rds/snapshot_copy.go | 6 +++--- internal/service/rds/snapshot_copy_test.go | 4 ++-- internal/service/rds/snapshot_test.go | 4 ++-- internal/service/rds/subnet_group.go | 3 ++- internal/service/rds/subnet_group_test.go | 4 ++-- internal/service/rds/sweep.go | 3 ++- 57 files changed, 146 insertions(+), 121 deletions(-) diff --git a/internal/service/rds/certificate.go b/internal/service/rds/certificate.go index e58143b2c2f..a67f394016c 100644 --- a/internal/service/rds/certificate.go +++ b/internal/service/rds/certificate.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -70,7 +71,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findDefaultCertificate(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Default Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/certificate_test.go b/internal/service/rds/certificate_test.go index 7c9f7f9e619..edcb492462b 100644 --- a/internal/service/rds/certificate_test.go +++ b/internal/service/rds/certificate_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -214,7 +214,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfrds.FindDefaultCertificate(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index 1d6c9f6d7f1..7430d7080ba 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -1414,7 +1415,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) dbc, err := findDBClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1535,7 +1536,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) if err == nil { d.Set("global_cluster_identifier", globalCluster.GlobalClusterIdentifier) - } else if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "Access Denied to API Version: APIGlobalDatabases") { //nolint:revive // Keep comments + } else if retry.NotFound(err) || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "Access Denied to API Version: APIGlobalDatabases") { //nolint:revive // Keep comments // Ignore the following API error for regions/partitions that do not support RDS Global Clusters: // InvalidParameterValue: Access Denied to API Version: APIGlobalDatabases } else { @@ -2134,7 +2135,7 @@ func statusDBCluster(ctx context.Context, conn *rds.Client, id string, waitNoPen return func() (any, string, error) { output, err := findDBClusterByID(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/cluster_activity_stream.go b/internal/service/rds/cluster_activity_stream.go index eeb57f00063..501cab5779f 100644 --- a/internal/service/rds/cluster_activity_stream.go +++ b/internal/service/rds/cluster_activity_stream.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func resourceClusterActivityStreamRead(ctx context.Context, d *schema.ResourceDa output, err := findDBClusterWithActivityStream(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Cluster Activity Stream (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -163,7 +163,7 @@ func statusDBClusterActivityStream(ctx context.Context, conn *rds.Client, arn st return func() (any, string, error) { output, err := findDBClusterWithActivityStream(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/cluster_activity_stream_test.go b/internal/service/rds/cluster_activity_stream_test.go index 093756b6500..8c6b1bedba2 100644 --- a/internal/service/rds/cluster_activity_stream_test.go +++ b/internal/service/rds/cluster_activity_stream_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func testAccCheckClusterActivityStreamDestroy(ctx context.Context) resource.Test _, err := tfrds.FindDBClusterWithActivityStream(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_endpoint.go b/internal/service/rds/cluster_endpoint.go index c15791293a3..572b4154626 100644 --- a/internal/service/rds/cluster_endpoint.go +++ b/internal/service/rds/cluster_endpoint.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -129,7 +130,7 @@ func resourceClusterEndpointRead(ctx context.Context, d *schema.ResourceData, me clusterEp, err := findDBClusterEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Cluster Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -260,7 +261,7 @@ func statusClusterEndpoint(ctx context.Context, conn *rds.Client, id string) sdk return func() (any, string, error) { output, err := findDBClusterEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/cluster_endpoint_test.go b/internal/service/rds/cluster_endpoint_test.go index 265d2270e7b..47c2a9bc5e9 100644 --- a/internal/service/rds/cluster_endpoint_test.go +++ b/internal/service/rds/cluster_endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -127,7 +127,7 @@ func testAccCheckClusterEndpointDestroy(ctx context.Context) resource.TestCheckF _, err := tfrds.FindDBClusterEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_instance.go b/internal/service/rds/cluster_instance.go index ae518f1d01d..b037576a619 100644 --- a/internal/service/rds/cluster_instance.go +++ b/internal/service/rds/cluster_instance.go @@ -367,7 +367,7 @@ func resourceClusterInstanceRead(ctx context.Context, d *schema.ResourceData, me db, err := findDBInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Cluster Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/cluster_instance_test.go b/internal/service/rds/cluster_instance_test.go index 5930ab95ef5..0135b49df21 100644 --- a/internal/service/rds/cluster_instance_test.go +++ b/internal/service/rds/cluster_instance_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1035,7 +1035,7 @@ func testAccCheckClusterInstanceDestroyWithProvider(ctx context.Context) acctest _, err := tfrds.FindDBInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1136,7 +1136,7 @@ func testAccCheckClusterInstanceDestroy(ctx context.Context) resource.TestCheckF _, err := tfrds.FindDBInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_parameter_group.go b/internal/service/rds/cluster_parameter_group.go index c56bdf44e1c..af20fe1a652 100644 --- a/internal/service/rds/cluster_parameter_group.go +++ b/internal/service/rds/cluster_parameter_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -134,7 +135,7 @@ func resourceClusterParameterGroupRead(ctx context.Context, d *schema.ResourceDa dbClusterParameterGroup, err := findDBClusterParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Cluster Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/cluster_parameter_group_test.go b/internal/service/rds/cluster_parameter_group_test.go index 061eadbc2c2..cb0608a2c8c 100644 --- a/internal/service/rds/cluster_parameter_group_test.go +++ b/internal/service/rds/cluster_parameter_group_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -567,7 +567,7 @@ func testAccCheckClusterParameterGroupDestroy(ctx context.Context) resource.Test _, err := tfrds.FindDBClusterParameterGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_role_association.go b/internal/service/rds/cluster_role_association.go index 7d822d96432..aeebf4a9152 100644 --- a/internal/service/rds/cluster_role_association.go +++ b/internal/service/rds/cluster_role_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -113,7 +114,7 @@ func resourceClusterRoleAssociationRead(ctx context.Context, d *schema.ResourceD output, err := findDBClusterRoleByTwoPartKey(ctx, conn, dbClusterID, roleARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Cluster (%s) IAM Role (%s) Association not found, removing from state", dbClusterID, roleARN) d.SetId("") return diags @@ -211,7 +212,7 @@ func statusDBClusterRole(ctx context.Context, conn *rds.Client, dbClusterID, rol return func() (any, string, error) { output, err := findDBClusterRoleByTwoPartKey(ctx, conn, dbClusterID, roleARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/cluster_role_association_test.go b/internal/service/rds/cluster_role_association_test.go index cc7958e5099..94b8a494dfb 100644 --- a/internal/service/rds/cluster_role_association_test.go +++ b/internal/service/rds/cluster_role_association_test.go @@ -14,9 +14,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -190,7 +190,7 @@ func testAccCheckClusterRoleAssociationDestroy(ctx context.Context) resource.Tes _, err := tfrds.FindDBClusterRoleByTwoPartKey(ctx, conn, rs.Primary.Attributes["db_cluster_identifier"], rs.Primary.Attributes[names.AttrRoleARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_snapshot.go b/internal/service/rds/cluster_snapshot.go index 54bdb1e7e8b..45f22ac817f 100644 --- a/internal/service/rds/cluster_snapshot.go +++ b/internal/service/rds/cluster_snapshot.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -177,7 +178,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me snapshot, err := findDBClusterSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Cluster Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -207,7 +208,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me switch { case err == nil: d.Set("shared_accounts", attribute.AttributeValues) - case tfresource.NotFound(err): + case retry.NotFound(err): default: return sdkdiag.AppendErrorf(diags, "reading RDS DB Cluster Snapshot (%s) attribute: %s", d.Id(), err) } @@ -324,7 +325,7 @@ func statusDBClusterSnapshot(ctx context.Context, conn *rds.Client, id string) s return func() (any, string, error) { output, err := findDBClusterSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/cluster_snapshot_copy.go b/internal/service/rds/cluster_snapshot_copy.go index 399d5d690a9..d811661f21b 100644 --- a/internal/service/rds/cluster_snapshot_copy.go +++ b/internal/service/rds/cluster_snapshot_copy.go @@ -30,8 +30,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -270,7 +270,7 @@ func (r *clusterSnapshotCopyResource) Read(ctx context.Context, req resource.Rea } out, err := findDBClusterSnapshotByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -291,7 +291,7 @@ func (r *clusterSnapshotCopyResource) Read(ctx context.Context, req resource.Rea } outAttr, err := findDBClusterSnapshotAttributeByTwoPartKey(ctx, conn, data.ID.ValueString(), dbSnapshotAttributeNameRestore) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { resp.Diagnostics.AddError( create.ProblemStandardMessage(names.RDS, create.ErrActionReading, ResNameClusterSnapshotCopy, data.ID.String(), err), err.Error(), diff --git a/internal/service/rds/cluster_snapshot_copy_test.go b/internal/service/rds/cluster_snapshot_copy_test.go index d73d4419940..d55758e5543 100644 --- a/internal/service/rds/cluster_snapshot_copy_test.go +++ b/internal/service/rds/cluster_snapshot_copy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -252,7 +252,7 @@ func testAccCheckClusterSnapshotCopyDestroy(ctx context.Context) resource.TestCh _, err := tfrds.FindDBClusterSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_snapshot_test.go b/internal/service/rds/cluster_snapshot_test.go index 0393fde4b3e..7646fe39cb3 100644 --- a/internal/service/rds/cluster_snapshot_test.go +++ b/internal/service/rds/cluster_snapshot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +134,7 @@ func testAccCheckClusterSnapshotDestroy(ctx context.Context) resource.TestCheckF _, err := tfrds.FindDBClusterSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/cluster_test.go b/internal/service/rds/cluster_test.go index 39a810c77d4..a30e9a3c500 100644 --- a/internal/service/rds/cluster_test.go +++ b/internal/service/rds/cluster_test.go @@ -30,8 +30,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -4006,7 +4006,7 @@ func testAccCheckClusterDestroyWithProvider(ctx context.Context) acctest.TestChe _, err := tfrds.FindDBClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -4046,7 +4046,7 @@ func testAccCheckClusterDestroyWithFinalSnapshot(ctx context.Context) resource.T _, err = tfrds.FindDBClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/custom_db_engine_version.go b/internal/service/rds/custom_db_engine_version.go index 29324b7d816..8931ca97b0f 100644 --- a/internal/service/rds/custom_db_engine_version.go +++ b/internal/service/rds/custom_db_engine_version.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -257,7 +258,7 @@ func resourceCustomDBEngineVersionRead(ctx context.Context, d *schema.ResourceDa out, err := findCustomDBEngineVersionByTwoPartKey(ctx, conn, engine, engineVersion) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Custom DB Engine Version (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -435,7 +436,7 @@ func statusDBEngineVersion(ctx context.Context, conn *rds.Client, engine, engine return func() (any, string, error) { output, err := findCustomDBEngineVersionByTwoPartKey(ctx, conn, engine, engineVersion) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/custom_db_engine_version_test.go b/internal/service/rds/custom_db_engine_version_test.go index f424e6ebd38..bd09870cf27 100644 --- a/internal/service/rds/custom_db_engine_version_test.go +++ b/internal/service/rds/custom_db_engine_version_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -298,7 +298,7 @@ func testAccCheckCustomDBEngineVersionDestroy(ctx context.Context) resource.Test _, err := tfrds.FindCustomDBEngineVersionByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrEngine], rs.Primary.Attributes[names.AttrEngineVersion]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/event_subscription.go b/internal/service/rds/event_subscription.go index eb21bc2eafb..6670affe1ad 100644 --- a/internal/service/rds/event_subscription.go +++ b/internal/service/rds/event_subscription.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -148,7 +149,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, sub, err := findEventSubscriptionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Event Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -327,7 +328,7 @@ func statusEventSubscription(ctx context.Context, conn *rds.Client, id string) s return func() (any, string, error) { output, err := findEventSubscriptionByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/event_subscription_test.go b/internal/service/rds/event_subscription_test.go index ff124cbac79..30b62b674f1 100644 --- a/internal/service/rds/event_subscription_test.go +++ b/internal/service/rds/event_subscription_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -333,7 +333,7 @@ func testAccCheckEventSubscriptionDestroy(ctx context.Context) resource.TestChec _, err := tfrds.FindEventSubscriptionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/export_task.go b/internal/service/rds/export_task.go index f32e53924bd..84e99f49668 100644 --- a/internal/service/rds/export_task.go +++ b/internal/service/rds/export_task.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -202,7 +203,7 @@ func (r *exportTaskResource) Read(ctx context.Context, request resource.ReadRequ output, err := findExportTaskByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -301,7 +302,7 @@ func statusExportTask(ctx context.Context, conn *rds.Client, id string) sdkretry return func() (any, string, error) { out, err := findExportTaskByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/export_task_test.go b/internal/service/rds/export_task_test.go index 63bc1a1de06..56c8ac4a1b6 100644 --- a/internal/service/rds/export_task_test.go +++ b/internal/service/rds/export_task_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckExportTaskDestroy(ctx context.Context) resource.TestCheckFunc { output, err := tfrds.FindExportTaskByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/global_cluster.go b/internal/service/rds/global_cluster.go index 1552ce30d1c..de0b222d613 100644 --- a/internal/service/rds/global_cluster.go +++ b/internal/service/rds/global_cluster.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -211,7 +212,7 @@ func resourceGlobalClusterRead(ctx context.Context, d *schema.ResourceData, meta globalCluster, err := findGlobalClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Global Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -465,7 +466,7 @@ func statusGlobalCluster(ctx context.Context, conn *rds.Client, id string) sdkre return func() (any, string, error) { output, err := findGlobalClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/global_cluster_test.go b/internal/service/rds/global_cluster_test.go index 0490b260b92..a42116d57ab 100644 --- a/internal/service/rds/global_cluster_test.go +++ b/internal/service/rds/global_cluster_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -704,7 +704,7 @@ func testAccCheckGlobalClusterDestroy(ctx context.Context) resource.TestCheckFun _, err := tfrds.FindGlobalClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 8c7e3d77c07..cc40b1b2149 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -1940,10 +1940,10 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta any) v, err = findDBInstanceByID(ctx, conn, d.Id()) } else { v, err = findDBInstanceByID(ctx, conn, d.Id()) - if tfresource.NotFound(err) { // nosemgrep:ci.semgrep.errors.notfound-without-err-checks + if retry.NotFound(err) { // nosemgrep:ci.semgrep.errors.notfound-without-err-checks // Retry with `identifier` v, err = findDBInstanceByID(ctx, conn, d.Get(names.AttrIdentifier).(string)) - if tfresource.NotFound(err) { // nosemgrep:ci.semgrep.errors.notfound-without-err-checks + if retry.NotFound(err) { // nosemgrep:ci.semgrep.errors.notfound-without-err-checks log.Printf("[WARN] RDS DB Instance (%s) not found, removing from state", d.Get(names.AttrIdentifier).(string)) d.SetId("") return diags @@ -2819,7 +2819,7 @@ func findDBInstanceByID(ctx context.Context, conn *rds.Client, id string, optFns output, err := findDBInstance(ctx, conn, input, tfslices.PredicateTrue[*types.DBInstance](), optFns...) // in case a DB has an *identifier* starting with "db-"" - if idLooksLikeDbiResourceID && tfresource.NotFound(err) { + if idLooksLikeDbiResourceID && retry.NotFound(err) { input = &rds.DescribeDBInstancesInput{ DBInstanceIdentifier: aws.String(id), } @@ -2876,7 +2876,7 @@ func statusDBInstance(conn *rds.Client, id string, optFns ...func(*rds.Options)) return func(ctx context.Context) (any, string, error) { output, err := findDBInstanceByID(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -3074,7 +3074,7 @@ func statusBlueGreenDeployment(conn *rds.Client, id string) retry.StateRefreshFu return func(ctx context.Context) (any, string, error) { output, err := findBlueGreenDeploymentByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } if err != nil { diff --git a/internal/service/rds/instance_automated_backups_replication.go b/internal/service/rds/instance_automated_backups_replication.go index 5beaa1c7600..cc51dee1479 100644 --- a/internal/service/rds/instance_automated_backups_replication.go +++ b/internal/service/rds/instance_automated_backups_replication.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -117,7 +118,7 @@ func resourceInstanceAutomatedBackupsReplicationRead(ctx context.Context, d *sch backup, err := findDBInstanceAutomatedBackupByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Instance Automated Backup %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -141,7 +142,7 @@ func resourceInstanceAutomatedBackupsReplicationDelete(ctx context.Context, d *s backup, err := findDBInstanceAutomatedBackupByARN(ctx, conn, d.Id()) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): return diags case err != nil: return sdkdiag.AppendErrorf(diags, "reading RDS DB Instance Automated Backup (%s): %s", d.Id(), err) @@ -254,7 +255,7 @@ func statusDBInstanceAutomatedBackup(ctx context.Context, conn *rds.Client, arn return func() (any, string, error) { output, err := findDBInstanceAutomatedBackupByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -290,7 +291,7 @@ func waitDBInstanceAutomatedBackupDeleted(ctx context.Context, conn *rds.Client, _, err := tfresource.RetryUntilEqual(ctx, timeout, false, func(ctx context.Context) (bool, error) { dbInstance, err := findDBInstanceByID(ctx, conn, dbInstanceID, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } diff --git a/internal/service/rds/instance_automated_backups_replication_test.go b/internal/service/rds/instance_automated_backups_replication_test.go index 495b7905ed8..6b364144336 100644 --- a/internal/service/rds/instance_automated_backups_replication_test.go +++ b/internal/service/rds/instance_automated_backups_replication_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -189,7 +189,7 @@ func testAccCheckInstanceAutomatedBackupsReplicationDestroy(ctx context.Context) _, err := tfrds.FindDBInstanceAutomatedBackupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/instance_role_association.go b/internal/service/rds/instance_role_association.go index 9bcc47ec758..11020022ba9 100644 --- a/internal/service/rds/instance_role_association.go +++ b/internal/service/rds/instance_role_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -116,7 +117,7 @@ func resourceInstanceRoleAssociationRead(ctx context.Context, d *schema.Resource dbInstanceRole, err := findDBInstanceRoleByTwoPartKey(ctx, conn, dbInstanceIdentifier, roleARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Instance (%s) IAM Role (%s) Association not found, removing from state", dbInstanceIdentifier, roleARN) d.SetId("") return diags @@ -202,7 +203,7 @@ func statusDBInstanceRoleAssociation(ctx context.Context, conn *rds.Client, dbIn return func() (any, string, error) { output, err := findDBInstanceRoleByTwoPartKey(ctx, conn, dbInstanceIdentifier, roleARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/instance_role_association_test.go b/internal/service/rds/instance_role_association_test.go index 2253b59aeb4..c689f3bb83d 100644 --- a/internal/service/rds/instance_role_association_test.go +++ b/internal/service/rds/instance_role_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func testAccCheckInstanceRoleAssociationDestroy(ctx context.Context) resource.Te _, err := tfrds.FindDBInstanceRoleByTwoPartKey(ctx, conn, rs.Primary.Attributes["db_instance_identifier"], rs.Primary.Attributes[names.AttrRoleARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/instance_state.go b/internal/service/rds/instance_state.go index ac5d6365a93..d06fba5b56a 100644 --- a/internal/service/rds/instance_state.go +++ b/internal/service/rds/instance_state.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func (r *instanceStateResource) Read(ctx context.Context, req resource.ReadReque } out, err := findDBInstanceByID(ctx, conn, state.Identifier.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index f19fe17b4cc..89dd6279294 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -7920,7 +7921,7 @@ func testAccCheckDBInstanceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfrds.FindDBInstanceByID(ctx, conn, rs.Primary.Attributes[names.AttrIdentifier]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -8063,7 +8064,7 @@ func testAccCheckInstanceDestroyWithFinalSnapshot(ctx context.Context) resource. _, err = tfrds.FindDBInstanceByID(ctx, conn, rs.Primary.Attributes[names.AttrIdentifier]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -8094,7 +8095,7 @@ func testAccCheckInstanceDestroyWithoutFinalSnapshot(ctx context.Context) resour _, err := tfrds.FindDBSnapshotByID(ctx, conn, finalSnapshotID) if err != nil { - if !tfresource.NotFound(err) { + if !retry.NotFound(err) { return err } } else { @@ -8103,7 +8104,7 @@ func testAccCheckInstanceDestroyWithoutFinalSnapshot(ctx context.Context) resour _, err = tfrds.FindDBInstanceByID(ctx, conn, rs.Primary.Attributes[names.AttrIdentifier]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/integration.go b/internal/service/rds/integration.go index 8c00d51594b..750ad64dc0e 100644 --- a/internal/service/rds/integration.go +++ b/internal/service/rds/integration.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -188,7 +189,7 @@ func (r *integrationResource) Read(ctx context.Context, request resource.ReadReq output, err := findIntegrationByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -299,7 +300,7 @@ func statusIntegration(ctx context.Context, conn *rds.Client, arn string) sdkret return func() (any, string, error) { output, err := findIntegrationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/integration_test.go b/internal/service/rds/integration_test.go index b28788e0299..e9ea4e64204 100644 --- a/internal/service/rds/integration_test.go +++ b/internal/service/rds/integration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +134,7 @@ func testAccCheckIntegrationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfrds.FindIntegrationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/option_group.go b/internal/service/rds/option_group.go index 085a4c13019..e42e9130bc5 100644 --- a/internal/service/rds/option_group.go +++ b/internal/service/rds/option_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -169,7 +170,7 @@ func resourceOptionGroupRead(ctx context.Context, d *schema.ResourceData, meta a option, err := findOptionGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Option Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/option_group_test.go b/internal/service/rds/option_group_test.go index 98cddf692e6..218585af3d5 100644 --- a/internal/service/rds/option_group_test.go +++ b/internal/service/rds/option_group_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -716,7 +716,7 @@ func testAccCheckOptionGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfrds.FindOptionGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/parameter_group.go b/internal/service/rds/parameter_group.go index 754a291fc5a..c1a564427ee 100644 --- a/internal/service/rds/parameter_group.go +++ b/internal/service/rds/parameter_group.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfiter "github.com/hashicorp/terraform-provider-aws/internal/iter" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -142,7 +143,7 @@ func resourceParameterGroupRead(ctx context.Context, d *schema.ResourceData, met dbParameterGroup, err := findDBParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/parameter_group_test.go b/internal/service/rds/parameter_group_test.go index 6df0b41139b..5d1eef9af94 100644 --- a/internal/service/rds/parameter_group_test.go +++ b/internal/service/rds/parameter_group_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1162,7 +1162,7 @@ func testAccCheckParameterGroupDestroy(ctx context.Context) resource.TestCheckFu _, err := tfrds.FindDBParameterGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/proxy.go b/internal/service/rds/proxy.go index b51acf5f133..53d0382a7ea 100644 --- a/internal/service/rds/proxy.go +++ b/internal/service/rds/proxy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -207,7 +208,7 @@ func resourceProxyRead(ctx context.Context, d *schema.ResourceData, meta any) di dbProxy, err := findDBProxyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Proxy %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -369,7 +370,7 @@ func statusDBProxy(ctx context.Context, conn *rds.Client, name string) sdkretry. return func() (any, string, error) { output, err := findDBProxyByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/proxy_default_target_group.go b/internal/service/rds/proxy_default_target_group.go index 2d8a5a72a20..dd09eeea103 100644 --- a/internal/service/rds/proxy_default_target_group.go +++ b/internal/service/rds/proxy_default_target_group.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -144,7 +145,7 @@ func resourceProxyDefaultTargetGroupRead(ctx context.Context, d *schema.Resource tg, err := findDefaultDBProxyTargetGroupByDBProxyName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Proxy Default Target Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -220,7 +221,7 @@ func statusDefaultDBProxyTargetGroup(ctx context.Context, conn *rds.Client, dbPr return func() (any, string, error) { output, err := findDefaultDBProxyTargetGroupByDBProxyName(ctx, conn, dbProxyName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/proxy_default_target_group_test.go b/internal/service/rds/proxy_default_target_group_test.go index f165632fd66..80bd2eeecb5 100644 --- a/internal/service/rds/proxy_default_target_group_test.go +++ b/internal/service/rds/proxy_default_target_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -338,7 +338,7 @@ func testAccCheckProxyTargetGroupDestroy(ctx context.Context) resource.TestCheck _, err := tfrds.FindDefaultDBProxyTargetGroupByDBProxyName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/proxy_endpoint.go b/internal/service/rds/proxy_endpoint.go index e354a390fd4..bd6877dbc4c 100644 --- a/internal/service/rds/proxy_endpoint.go +++ b/internal/service/rds/proxy_endpoint.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -145,7 +146,7 @@ func resourceProxyEndpointRead(ctx context.Context, d *schema.ResourceData, meta dbProxyEndpoint, err := findDBProxyEndpointByTwoPartKey(ctx, conn, dbProxyName, dbProxyEndpointName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Proxy Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -308,7 +309,7 @@ func statusDBProxyEndpoint(ctx context.Context, conn *rds.Client, dbProxyName, d return func() (any, string, error) { output, err := findDBProxyEndpointByTwoPartKey(ctx, conn, dbProxyName, dbProxyEndpointName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/proxy_endpoint_test.go b/internal/service/rds/proxy_endpoint_test.go index 88b25c42ebf..2bd66ea9964 100644 --- a/internal/service/rds/proxy_endpoint_test.go +++ b/internal/service/rds/proxy_endpoint_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -270,7 +270,7 @@ func testAccCheckProxyEndpointDestroy(ctx context.Context) resource.TestCheckFun _, err := tfrds.FindDBProxyEndpointByTwoPartKey(ctx, conn, rs.Primary.Attributes["db_proxy_name"], rs.Primary.Attributes["db_proxy_endpoint_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/proxy_target.go b/internal/service/rds/proxy_target.go index e90b842f395..81b46260c4a 100644 --- a/internal/service/rds/proxy_target.go +++ b/internal/service/rds/proxy_target.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -145,7 +146,7 @@ func resourceProxyTargetRead(ctx context.Context, d *schema.ResourceData, meta a dbProxyTarget, err := findDBProxyTargetByFourPartKey(ctx, conn, dbProxyName, targetGroupName, targetType, rdsResourceID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Proxy Target (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/proxy_target_test.go b/internal/service/rds/proxy_target_test.go index 763c036d98f..4c438a81725 100644 --- a/internal/service/rds/proxy_target_test.go +++ b/internal/service/rds/proxy_target_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func testAccCheckProxyTargetDestroy(ctx context.Context) resource.TestCheckFunc _, err = tfrds.FindDBProxyTargetByFourPartKey(ctx, conn, dbProxyName, targetGroupName, targetType, rdsResourceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/proxy_test.go b/internal/service/rds/proxy_test.go index 81262141b61..ad913a7087a 100644 --- a/internal/service/rds/proxy_test.go +++ b/internal/service/rds/proxy_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -642,7 +642,7 @@ func testAccCheckProxyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfrds.FindDBProxyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/reserved_instance.go b/internal/service/rds/reserved_instance.go index df2399316b3..37c530fe412 100644 --- a/internal/service/rds/reserved_instance.go +++ b/internal/service/rds/reserved_instance.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -168,7 +169,7 @@ func resourceReservedInstanceRead(ctx context.Context, d *schema.ResourceData, m reservation, err := findReservedDBInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS Reserved Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -265,7 +266,7 @@ func statusReservedInstance(ctx context.Context, conn *rds.Client, id string) sd return func() (any, string, error) { output, err := findReservedDBInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/shard_group.go b/internal/service/rds/shard_group.go index cf11fd83227..000b5b695f9 100644 --- a/internal/service/rds/shard_group.go +++ b/internal/service/rds/shard_group.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -187,7 +188,7 @@ func (r *shardGroupResource) Read(ctx context.Context, request resource.ReadRequ output, err := findDBShardGroupByID(ctx, conn, data.DBShardGroupIdentifier.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -350,7 +351,7 @@ func statusShardGroup(ctx context.Context, conn *rds.Client, id string) sdkretry return func() (any, string, error) { output, err := findDBShardGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/shard_group_test.go b/internal/service/rds/shard_group_test.go index 97b99d61994..65b9ea2b8b8 100644 --- a/internal/service/rds/shard_group_test.go +++ b/internal/service/rds/shard_group_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -244,7 +244,7 @@ func testAccCheckShardGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfrds.FindDBShardGroupByID(ctx, conn, rs.Primary.Attributes["db_shard_group_identifier"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/snapshot.go b/internal/service/rds/snapshot.go index f3dd6901fd3..448fea0bd3e 100644 --- a/internal/service/rds/snapshot.go +++ b/internal/service/rds/snapshot.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -179,7 +180,7 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta any) snapshot, err := findDBSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -213,7 +214,7 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta any) switch { case err == nil: d.Set("shared_accounts", attribute.AttributeValues) - case tfresource.NotFound(err): + case retry.NotFound(err): default: return sdkdiag.AppendErrorf(diags, "reading RDS DB Snapshot (%s) attribute: %s", d.Id(), err) } @@ -330,7 +331,7 @@ func statusDBSnapshot(ctx context.Context, conn *rds.Client, id string) sdkretry return func() (any, string, error) { output, err := findDBSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rds/snapshot_copy.go b/internal/service/rds/snapshot_copy.go index 6c5c58d7376..9846dc2797a 100644 --- a/internal/service/rds/snapshot_copy.go +++ b/internal/service/rds/snapshot_copy.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -225,7 +225,7 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta snapshot, err := findDBSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -258,7 +258,7 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta switch { case err == nil: d.Set("shared_accounts", attribute.AttributeValues) - case tfresource.NotFound(err): + case retry.NotFound(err): default: return sdkdiag.AppendErrorf(diags, "reading RDS DB Snapshot (%s) attribute: %s", d.Id(), err) } diff --git a/internal/service/rds/snapshot_copy_test.go b/internal/service/rds/snapshot_copy_test.go index a8382759042..162b7761690 100644 --- a/internal/service/rds/snapshot_copy_test.go +++ b/internal/service/rds/snapshot_copy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -227,7 +227,7 @@ func testAccCheckSnapshotCopyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index cc7d8e7a8ad..ddb57255536 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -183,7 +183,7 @@ func testAccCheckDBSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/subnet_group.go b/internal/service/rds/subnet_group.go index 2089fb4d55b..9e715f608bc 100644 --- a/internal/service/rds/subnet_group.go +++ b/internal/service/rds/subnet_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -114,7 +115,7 @@ func resourceSubnetGroupRead(ctx context.Context, d *schema.ResourceData, meta a v, err := findDBSubnetGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RDS DB Subnet Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rds/subnet_group_test.go b/internal/service/rds/subnet_group_test.go index e1b574435a2..30054f10d45 100644 --- a/internal/service/rds/subnet_group_test.go +++ b/internal/service/rds/subnet_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -295,7 +295,7 @@ func testAccCheckSubnetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfrds.FindDBSubnetGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rds/sweep.go b/internal/service/rds/sweep.go index 58df1a80829..69459a5efbd 100644 --- a/internal/service/rds/sweep.go +++ b/internal/service/rds/sweep.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" "github.com/hashicorp/terraform-provider-aws/internal/sweep/framework" @@ -133,7 +134,7 @@ func sweepClusters(ctx context.Context, client *conns.AWSClient) ([]sweep.Sweepa if engineMode := aws.ToString(v.EngineMode); engineMode == engineModeGlobal || engineMode == engineModeProvisioned { globalCluster, err := findGlobalClusterByDBClusterARN(ctx, conn, arn) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { log.Printf("[WARN] Reading RDS Global Cluster information for DB Cluster (%s): %s", id, err) continue } From 62fbc9c6fb97eba86c251ea0c0fe922226c2a509 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:27 -0800 Subject: [PATCH 161/227] `redshift` --- .../service/redshift/authentication_profile.go | 4 ++-- .../redshift/authentication_profile_test.go | 4 ++-- internal/service/redshift/cluster.go | 5 +++-- internal/service/redshift/cluster_iam_roles.go | 4 ++-- internal/service/redshift/cluster_snapshot.go | 4 ++-- .../service/redshift/cluster_snapshot_test.go | 4 ++-- internal/service/redshift/cluster_test.go | 6 +++--- .../service/redshift/data_share_authorization.go | 3 ++- .../redshift/data_share_consumer_association.go | 3 ++- internal/service/redshift/endpoint_access.go | 4 ++-- .../service/redshift/endpoint_access_test.go | 4 ++-- .../service/redshift/endpoint_authorization.go | 4 ++-- .../redshift/endpoint_authorization_test.go | 4 ++-- internal/service/redshift/event_subscription.go | 4 ++-- .../service/redshift/event_subscription_test.go | 4 ++-- .../service/redshift/hsm_client_certificate.go | 4 ++-- .../redshift/hsm_client_certificate_test.go | 4 ++-- internal/service/redshift/hsm_configuration.go | 4 ++-- .../service/redshift/hsm_configuration_test.go | 4 ++-- internal/service/redshift/integration.go | 4 ++-- internal/service/redshift/integration_test.go | 4 ++-- internal/service/redshift/logging.go | 3 ++- internal/service/redshift/parameter_group.go | 3 ++- .../service/redshift/parameter_group_test.go | 4 ++-- internal/service/redshift/partner.go | 4 ++-- internal/service/redshift/partner_test.go | 4 ++-- internal/service/redshift/resource_policy.go | 4 ++-- .../service/redshift/resource_policy_test.go | 4 ++-- internal/service/redshift/scheduled_action.go | 3 ++- .../service/redshift/scheduled_action_test.go | 4 ++-- internal/service/redshift/snapshot_copy.go | 3 ++- internal/service/redshift/snapshot_copy_grant.go | 3 ++- .../service/redshift/snapshot_copy_grant_test.go | 4 ++-- internal/service/redshift/snapshot_schedule.go | 3 ++- .../redshift/snapshot_schedule_association.go | 5 +++-- .../snapshot_schedule_association_test.go | 4 ++-- .../service/redshift/snapshot_schedule_test.go | 4 ++-- internal/service/redshift/status.go | 16 ++++++++-------- internal/service/redshift/subnet_group.go | 4 ++-- internal/service/redshift/subnet_group_test.go | 4 ++-- internal/service/redshift/usage_limit.go | 4 ++-- internal/service/redshift/usage_limit_test.go | 4 ++-- 42 files changed, 93 insertions(+), 83 deletions(-) diff --git a/internal/service/redshift/authentication_profile.go b/internal/service/redshift/authentication_profile.go index ba22dec238b..9e769c98893 100644 --- a/internal/service/redshift/authentication_profile.go +++ b/internal/service/redshift/authentication_profile.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -81,7 +81,7 @@ func resourceAuthenticationProfileRead(ctx context.Context, d *schema.ResourceDa out, err := findAuthenticationProfileByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Authentication Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/authentication_profile_test.go b/internal/service/redshift/authentication_profile_test.go index 17ddf9b3ea2..365139be1f6 100644 --- a/internal/service/redshift/authentication_profile_test.go +++ b/internal/service/redshift/authentication_profile_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +87,7 @@ func testAccCheckAuthenticationProfileDestroy(ctx context.Context) resource.Test _, err := tfredshift.FindAuthenticationProfileByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/cluster.go b/internal/service/redshift/cluster.go index 727a24fdcd8..b7784651683 100644 --- a/internal/service/redshift/cluster.go +++ b/internal/service/redshift/cluster.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -611,7 +612,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) rsc, err := findClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -1065,7 +1066,7 @@ func statusClusterRestoration(ctx context.Context, conn *redshift.Client, id str return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshift/cluster_iam_roles.go b/internal/service/redshift/cluster_iam_roles.go index dcb92ae677e..641c2a88eb2 100644 --- a/internal/service/redshift/cluster_iam_roles.go +++ b/internal/service/redshift/cluster_iam_roles.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +104,7 @@ func resourceClusterIAMRolesRead(ctx context.Context, d *schema.ResourceData, me rsc, err := findClusterByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Cluster IAM Roles (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/cluster_snapshot.go b/internal/service/redshift/cluster_snapshot.go index 0f1a9b07f01..a9ac7b4f956 100644 --- a/internal/service/redshift/cluster_snapshot.go +++ b/internal/service/redshift/cluster_snapshot.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +103,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me snapshot, err := findClusterSnapshotByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Cluster Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/cluster_snapshot_test.go b/internal/service/redshift/cluster_snapshot_test.go index eb4259de912..e9cbb367d9a 100644 --- a/internal/service/redshift/cluster_snapshot_test.go +++ b/internal/service/redshift/cluster_snapshot_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -124,7 +124,7 @@ func testAccCheckClusterSnapshotDestroy(ctx context.Context) resource.TestCheckF _, err := tfredshift.FindClusterSnapshotByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/cluster_test.go b/internal/service/redshift/cluster_test.go index fb3b8f5f529..7ab3f395c42 100644 --- a/internal/service/redshift/cluster_test.go +++ b/internal/service/redshift/cluster_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1296,7 +1296,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfredshift.FindClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1331,7 +1331,7 @@ func testAccCheckClusterTestSnapshotDestroy(ctx context.Context, rName string) r _, err = tfredshift.FindClusterByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/redshift/data_share_authorization.go b/internal/service/redshift/data_share_authorization.go index ad8822e6046..8db83dd8618 100644 --- a/internal/service/redshift/data_share_authorization.go +++ b/internal/service/redshift/data_share_authorization.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +163,7 @@ func (r *dataShareAuthorizationResource) Read(ctx context.Context, req resource. state.ConsumerIdentifier = types.StringValue(parts[1]) out, err := findDataShareAuthorizationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/redshift/data_share_consumer_association.go b/internal/service/redshift/data_share_consumer_association.go index c0006d4d57f..bb47819dd2c 100644 --- a/internal/service/redshift/data_share_consumer_association.go +++ b/internal/service/redshift/data_share_consumer_association.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +202,7 @@ func (r *dataShareConsumerAssociationResource) Read(ctx context.Context, req res } out, err := findDataShareConsumerAssociationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/redshift/endpoint_access.go b/internal/service/redshift/endpoint_access.go index 8d501053ab7..c12e6f7df13 100644 --- a/internal/service/redshift/endpoint_access.go +++ b/internal/service/redshift/endpoint_access.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func resourceEndpointAccessRead(ctx context.Context, d *schema.ResourceData, met endpoint, err := findEndpointAccessByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift endpoint access (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/endpoint_access_test.go b/internal/service/redshift/endpoint_access_test.go index 441639e06c4..dca43ee7ef5 100644 --- a/internal/service/redshift/endpoint_access_test.go +++ b/internal/service/redshift/endpoint_access_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func testAccCheckEndpointAccessDestroy(ctx context.Context) resource.TestCheckFu _, err := tfredshift.FindEndpointAccessByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/endpoint_authorization.go b/internal/service/redshift/endpoint_authorization.go index 5e568773819..9ea64e83934 100644 --- a/internal/service/redshift/endpoint_authorization.go +++ b/internal/service/redshift/endpoint_authorization.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func resourceEndpointAuthorizationRead(ctx context.Context, d *schema.ResourceDa endpoint, err := findEndpointAuthorizationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Endpoint Authorization (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/endpoint_authorization_test.go b/internal/service/redshift/endpoint_authorization_test.go index 896694827d5..0ee68c0e856 100644 --- a/internal/service/redshift/endpoint_authorization_test.go +++ b/internal/service/redshift/endpoint_authorization_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func testAccCheckEndpointAuthorizationDestroy(ctx context.Context) resource.Test _, err := tfredshift.FindEndpointAuthorizationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/event_subscription.go b/internal/service/redshift/event_subscription.go index b5d8bcb3ec2..23ed4f5f886 100644 --- a/internal/service/redshift/event_subscription.go +++ b/internal/service/redshift/event_subscription.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +159,7 @@ func resourceEventSubscriptionRead(ctx context.Context, d *schema.ResourceData, sub, err := findEventSubscriptionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Event Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/event_subscription_test.go b/internal/service/redshift/event_subscription_test.go index b03d23441d3..adc681468b1 100644 --- a/internal/service/redshift/event_subscription_test.go +++ b/internal/service/redshift/event_subscription_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -208,7 +208,7 @@ func testAccCheckEventSubscriptionDestroy(ctx context.Context) resource.TestChec _, err := tfredshift.FindEventSubscriptionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/hsm_client_certificate.go b/internal/service/redshift/hsm_client_certificate.go index 49cda8887bd..eeb0307814d 100644 --- a/internal/service/redshift/hsm_client_certificate.go +++ b/internal/service/redshift/hsm_client_certificate.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -82,7 +82,7 @@ func resourceHSMClientCertificateRead(ctx context.Context, d *schema.ResourceDat out, err := findHSMClientCertificateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift HSM Client Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/hsm_client_certificate_test.go b/internal/service/redshift/hsm_client_certificate_test.go index b2663de8e5e..5a7013b0532 100644 --- a/internal/service/redshift/hsm_client_certificate_test.go +++ b/internal/service/redshift/hsm_client_certificate_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func testAccCheckHSMClientCertificateDestroy(ctx context.Context) resource.TestC _, err := tfredshift.FindHSMClientCertificateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/hsm_configuration.go b/internal/service/redshift/hsm_configuration.go index bf21414c003..af6a380448c 100644 --- a/internal/service/redshift/hsm_configuration.go +++ b/internal/service/redshift/hsm_configuration.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func resourceHSMConfigurationRead(ctx context.Context, d *schema.ResourceData, m hsmConfiguration, err := findHSMConfigurationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift HSM Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/hsm_configuration_test.go b/internal/service/redshift/hsm_configuration_test.go index ca52a5fc513..ad101b9bd7a 100644 --- a/internal/service/redshift/hsm_configuration_test.go +++ b/internal/service/redshift/hsm_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func testAccCheckHSMConfigurationDestroy(ctx context.Context) resource.TestCheck _, err := tfredshift.FindHSMConfigurationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/integration.go b/internal/service/redshift/integration.go index e73f28960ff..c103fa29464 100644 --- a/internal/service/redshift/integration.go +++ b/internal/service/redshift/integration.go @@ -23,8 +23,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -156,7 +156,7 @@ func (r *integrationResource) Read(ctx context.Context, request resource.ReadReq output, err := findIntegrationByARN(ctx, conn, data.IntegrationARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/redshift/integration_test.go b/internal/service/redshift/integration_test.go index 8fc8e98b113..2e307ea541a 100644 --- a/internal/service/redshift/integration_test.go +++ b/internal/service/redshift/integration_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -233,7 +233,7 @@ func testAccCheckIntegrationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfredshift.FindIntegrationByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/logging.go b/internal/service/redshift/logging.go index adf36558234..6d9c3a427d8 100644 --- a/internal/service/redshift/logging.go +++ b/internal/service/redshift/logging.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -128,7 +129,7 @@ func (r *loggingResource) Read(ctx context.Context, req resource.ReadRequest, re } out, err := findLoggingByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/redshift/parameter_group.go b/internal/service/redshift/parameter_group.go index 1dfd2d9e8bf..2837d1ee947 100644 --- a/internal/service/redshift/parameter_group.go +++ b/internal/service/redshift/parameter_group.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -135,7 +136,7 @@ func resourceParameterGroupRead(ctx context.Context, d *schema.ResourceData, met parameterGroup, err := findParameterGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Parameter Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/parameter_group_test.go b/internal/service/redshift/parameter_group_test.go index 69b79dbc65e..443dc96f73a 100644 --- a/internal/service/redshift/parameter_group_test.go +++ b/internal/service/redshift/parameter_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -156,7 +156,7 @@ func testAccCheckParameterGroupDestroy(ctx context.Context) resource.TestCheckFu _, err := tfredshift.FindParameterGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/partner.go b/internal/service/redshift/partner.go index e858dbd7306..d102ad2e2bd 100644 --- a/internal/service/redshift/partner.go +++ b/internal/service/redshift/partner.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +97,7 @@ func resourcePartnerRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := findPartnerByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Partner (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/partner_test.go b/internal/service/redshift/partner_test.go index 0710dd0f595..24117cff5a9 100644 --- a/internal/service/redshift/partner_test.go +++ b/internal/service/redshift/partner_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func testAccCheckPartnerDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfredshift.FindPartnerByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/resource_policy.go b/internal/service/redshift/resource_policy.go index 6ddd4f706df..89d21f8bbd2 100644 --- a/internal/service/redshift/resource_policy.go +++ b/internal/service/redshift/resource_policy.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met out, err := findResourcePolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Resource Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/resource_policy_test.go b/internal/service/redshift/resource_policy_test.go index c7c84dd65dc..f38c8c36f53 100644 --- a/internal/service/redshift/resource_policy_test.go +++ b/internal/service/redshift/resource_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +84,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu } _, err := tfredshift.FindResourcePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/scheduled_action.go b/internal/service/redshift/scheduled_action.go index 1577a2f2c20..8258981f9d2 100644 --- a/internal/service/redshift/scheduled_action.go +++ b/internal/service/redshift/scheduled_action.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -211,7 +212,7 @@ func resourceScheduledActionRead(ctx context.Context, d *schema.ResourceData, me scheduledAction, err := findScheduledActionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Scheduled Action (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/scheduled_action_test.go b/internal/service/redshift/scheduled_action_test.go index 156c955d3d9..0d484ba29ff 100644 --- a/internal/service/redshift/scheduled_action_test.go +++ b/internal/service/redshift/scheduled_action_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -304,7 +304,7 @@ func testAccCheckScheduledActionDestroy(ctx context.Context) resource.TestCheckF _, err := tfredshift.FindScheduledActionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/snapshot_copy.go b/internal/service/redshift/snapshot_copy.go index 0f3b823aaae..48fc2e3a6d0 100644 --- a/internal/service/redshift/snapshot_copy.go +++ b/internal/service/redshift/snapshot_copy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +127,7 @@ func (r *snapshotCopyResource) Read(ctx context.Context, req resource.ReadReques } out, err := findSnapshotCopyByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/redshift/snapshot_copy_grant.go b/internal/service/redshift/snapshot_copy_grant.go index da2c8a84f62..e506603e79d 100644 --- a/internal/service/redshift/snapshot_copy_grant.go +++ b/internal/service/redshift/snapshot_copy_grant.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func resourceSnapshotCopyGrantRead(ctx context.Context, d *schema.ResourceData, grant, err := findSnapshotCopyGrantByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Snapshot Copy Grant (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/snapshot_copy_grant_test.go b/internal/service/redshift/snapshot_copy_grant_test.go index 4c45e7e4770..6882081b740 100644 --- a/internal/service/redshift/snapshot_copy_grant_test.go +++ b/internal/service/redshift/snapshot_copy_grant_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -81,7 +81,7 @@ func testAccCheckSnapshotCopyGrantDestroy(ctx context.Context) resource.TestChec _, err := tfredshift.FindSnapshotCopyGrantByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/snapshot_schedule.go b/internal/service/redshift/snapshot_schedule.go index 5a6f329c9b9..30c9f9b0759 100644 --- a/internal/service/redshift/snapshot_schedule.go +++ b/internal/service/redshift/snapshot_schedule.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -111,7 +112,7 @@ func resourceSnapshotScheduleRead(ctx context.Context, d *schema.ResourceData, m snapshotSchedule, err := findSnapshotScheduleByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Snapshot Schedule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/snapshot_schedule_association.go b/internal/service/redshift/snapshot_schedule_association.go index d74c712b470..9d18c910adc 100644 --- a/internal/service/redshift/snapshot_schedule_association.go +++ b/internal/service/redshift/snapshot_schedule_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +90,7 @@ func resourceSnapshotScheduleAssociationRead(ctx context.Context, d *schema.Reso association, err := findSnapshotScheduleAssociationByTwoPartKey(ctx, conn, clusterIdentifier, scheduleIdentifier) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Snapshot Schedule Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -189,7 +190,7 @@ func statusSnapshotScheduleAssociation(ctx context.Context, conn *redshift.Clien return func() (any, string, error) { output, err := findSnapshotScheduleAssociationByTwoPartKey(ctx, conn, clusterIdentifier, scheduleIdentifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshift/snapshot_schedule_association_test.go b/internal/service/redshift/snapshot_schedule_association_test.go index 7189940c101..37c1c91cc93 100644 --- a/internal/service/redshift/snapshot_schedule_association_test.go +++ b/internal/service/redshift/snapshot_schedule_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +111,7 @@ func testAccCheckSnapshotScheduleAssociationDestroy(ctx context.Context) resourc _, err = tfredshift.FindSnapshotScheduleAssociationByTwoPartKey(ctx, conn, clusterIdentifier, scheduleIdentifier) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/snapshot_schedule_test.go b/internal/service/redshift/snapshot_schedule_test.go index 1edcd110454..341ffb10662 100644 --- a/internal/service/redshift/snapshot_schedule_test.go +++ b/internal/service/redshift/snapshot_schedule_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -271,7 +271,7 @@ func testAccCheckSnapshotScheduleDestroy(ctx context.Context) resource.TestCheck _, err := tfredshift.FindSnapshotScheduleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/status.go b/internal/service/redshift/status.go index d989ee1699d..7dc224c364c 100644 --- a/internal/service/redshift/status.go +++ b/internal/service/redshift/status.go @@ -9,14 +9,14 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/redshift" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusClusterAvailability(ctx context.Context, conn *redshift.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -32,7 +32,7 @@ func statusClusterAvailabilityZoneRelocation(ctx context.Context, conn *redshift return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -48,7 +48,7 @@ func statusCluster(ctx context.Context, conn *redshift.Client, id string) sdkret return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -64,7 +64,7 @@ func statusClusterAqua(ctx context.Context, conn *redshift.Client, id string) sd return func() (any, string, error) { output, err := findClusterByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -80,7 +80,7 @@ func statusEndpointAccess(ctx context.Context, conn *redshift.Client, name strin return func() (any, string, error) { output, err := findEndpointAccessByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -96,7 +96,7 @@ func statusClusterSnapshot(ctx context.Context, conn *redshift.Client, id string return func() (any, string, error) { output, err := findClusterSnapshotByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -112,7 +112,7 @@ func statusIntegration(ctx context.Context, conn *redshift.Client, arn string) s return func() (any, string, error) { output, err := findIntegrationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshift/subnet_group.go b/internal/service/redshift/subnet_group.go index dc2a5c2ab59..6cd49a8ab63 100644 --- a/internal/service/redshift/subnet_group.go +++ b/internal/service/redshift/subnet_group.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func resourceSubnetGroupRead(ctx context.Context, d *schema.ResourceData, meta a subnetgroup, err := findSubnetGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Subnet Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/subnet_group_test.go b/internal/service/redshift/subnet_group_test.go index 4220058491a..a13c6540d57 100644 --- a/internal/service/redshift/subnet_group_test.go +++ b/internal/service/redshift/subnet_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -153,7 +153,7 @@ func testAccCheckSubnetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfredshift.FindSubnetGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshift/usage_limit.go b/internal/service/redshift/usage_limit.go index ac1c6638a2c..37681294a92 100644 --- a/internal/service/redshift/usage_limit.go +++ b/internal/service/redshift/usage_limit.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func resourceUsageLimitRead(ctx context.Context, d *schema.ResourceData, meta an out, err := findUsageLimitByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Usage Limit (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshift/usage_limit_test.go b/internal/service/redshift/usage_limit_test.go index c830941b238..4df2c60833e 100644 --- a/internal/service/redshift/usage_limit_test.go +++ b/internal/service/redshift/usage_limit_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +97,7 @@ func testAccCheckUsageLimitDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfredshift.FindUsageLimitByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 288abbe83ac8020523651e6672d27328adcec69c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:28 -0800 Subject: [PATCH 162/227] `redshiftdata` --- internal/service/redshiftdata/statement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/redshiftdata/statement.go b/internal/service/redshiftdata/statement.go index a59de67eef5..d80bbd201f4 100644 --- a/internal/service/redshiftdata/statement.go +++ b/internal/service/redshiftdata/statement.go @@ -220,7 +220,7 @@ func statusStatement(conn *redshiftdata.Client, id string) retry.StateRefreshFun return func(ctx context.Context) (any, string, error) { output, err := FindStatementByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 66a10ce5b117138d57e2a7b09880c7bd44795c37 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:29 -0800 Subject: [PATCH 163/227] `redshiftserverless` --- .../service/redshiftserverless/custom_domain_association.go | 3 ++- .../redshiftserverless/custom_domain_association_test.go | 4 ++-- internal/service/redshiftserverless/endpoint_access.go | 5 +++-- internal/service/redshiftserverless/endpoint_access_test.go | 4 ++-- internal/service/redshiftserverless/namespace.go | 5 +++-- internal/service/redshiftserverless/namespace_test.go | 4 ++-- internal/service/redshiftserverless/resource_policy.go | 3 ++- internal/service/redshiftserverless/resource_policy_test.go | 4 ++-- internal/service/redshiftserverless/snapshot.go | 5 +++-- internal/service/redshiftserverless/snapshot_test.go | 4 ++-- internal/service/redshiftserverless/usage_limit.go | 3 ++- internal/service/redshiftserverless/usage_limit_test.go | 4 ++-- internal/service/redshiftserverless/workgroup.go | 5 +++-- internal/service/redshiftserverless/workgroup_test.go | 4 ++-- 14 files changed, 32 insertions(+), 25 deletions(-) diff --git a/internal/service/redshiftserverless/custom_domain_association.go b/internal/service/redshiftserverless/custom_domain_association.go index 78efd2ce77c..4b2a02cd81c 100644 --- a/internal/service/redshiftserverless/custom_domain_association.go +++ b/internal/service/redshiftserverless/custom_domain_association.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +131,7 @@ func (r *customDomainAssociationResource) Read(ctx context.Context, request reso output, err := findCustomDomainAssociationByTwoPartKey(ctx, conn, data.WorkgroupName.ValueString(), data.CustomDomainName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/redshiftserverless/custom_domain_association_test.go b/internal/service/redshiftserverless/custom_domain_association_test.go index 57052650105..e45ba9e071f 100644 --- a/internal/service/redshiftserverless/custom_domain_association_test.go +++ b/internal/service/redshiftserverless/custom_domain_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckCustomDomainAssociationDestroy(ctx context.Context) resource.Te _, err := tfredshiftserverless.FindCustomDomainAssociationByTwoPartKey(ctx, conn, rs.Primary.Attributes["workgroup_name"], rs.Primary.Attributes["custom_domain_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshiftserverless/endpoint_access.go b/internal/service/redshiftserverless/endpoint_access.go index 569b9b9b9c2..bd429b676a5 100644 --- a/internal/service/redshiftserverless/endpoint_access.go +++ b/internal/service/redshiftserverless/endpoint_access.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -170,7 +171,7 @@ func resourceEndpointAccessRead(ctx context.Context, d *schema.ResourceData, met endpointAccess, err := findEndpointAccessByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Serverless Endpoint Access (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -275,7 +276,7 @@ func statusEndpointAccess(ctx context.Context, conn *redshiftserverless.Client, return func() (any, string, error) { output, err := findEndpointAccessByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshiftserverless/endpoint_access_test.go b/internal/service/redshiftserverless/endpoint_access_test.go index 660298b4595..f8d59d67792 100644 --- a/internal/service/redshiftserverless/endpoint_access_test.go +++ b/internal/service/redshiftserverless/endpoint_access_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func testAccCheckEndpointAccessDestroy(ctx context.Context) resource.TestCheckFu } _, err := tfredshiftserverless.FindEndpointAccessByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshiftserverless/namespace.go b/internal/service/redshiftserverless/namespace.go index 0a64a0b8291..9eb8f4708c0 100644 --- a/internal/service/redshiftserverless/namespace.go +++ b/internal/service/redshiftserverless/namespace.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -208,7 +209,7 @@ func resourceNamespaceRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findNamespaceByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Serverless Namespace (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -361,7 +362,7 @@ func statusNamespace(ctx context.Context, conn *redshiftserverless.Client, name return func() (any, string, error) { output, err := findNamespaceByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshiftserverless/namespace_test.go b/internal/service/redshiftserverless/namespace_test.go index eaded0fd10a..0f7b1703c18 100644 --- a/internal/service/redshiftserverless/namespace_test.go +++ b/internal/service/redshiftserverless/namespace_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -281,7 +281,7 @@ func testAccCheckNamespaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfredshiftserverless.FindNamespaceByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshiftserverless/resource_policy.go b/internal/service/redshiftserverless/resource_policy.go index 1ab82743973..9187273669c 100644 --- a/internal/service/redshiftserverless/resource_policy.go +++ b/internal/service/redshiftserverless/resource_policy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -90,7 +91,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met conn := meta.(*conns.AWSClient).RedshiftServerlessClient(ctx) out, err := findResourcePolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Serverless Resource Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshiftserverless/resource_policy_test.go b/internal/service/redshiftserverless/resource_policy_test.go index 1df1ab8be80..191257ecb2d 100644 --- a/internal/service/redshiftserverless/resource_policy_test.go +++ b/internal/service/redshiftserverless/resource_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +84,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu } _, err := tfredshiftserverless.FindResourcePolicyByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshiftserverless/snapshot.go b/internal/service/redshiftserverless/snapshot.go index 5777d6de455..92b566b09b8 100644 --- a/internal/service/redshiftserverless/snapshot.go +++ b/internal/service/redshiftserverless/snapshot.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +123,7 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta any) conn := meta.(*conns.AWSClient).RedshiftServerlessClient(ctx) out, err := findSnapshotByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Serverless Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -216,7 +217,7 @@ func statusSnapshot(ctx context.Context, conn *redshiftserverless.Client, name s return func() (any, string, error) { output, err := findSnapshotByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshiftserverless/snapshot_test.go b/internal/service/redshiftserverless/snapshot_test.go index cb199e36c85..cc4dd2abc5b 100644 --- a/internal/service/redshiftserverless/snapshot_test.go +++ b/internal/service/redshiftserverless/snapshot_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfredshiftserverless.FindSnapshotByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshiftserverless/usage_limit.go b/internal/service/redshiftserverless/usage_limit.go index c2068aeb862..6f11bd28c7d 100644 --- a/internal/service/redshiftserverless/usage_limit.go +++ b/internal/service/redshiftserverless/usage_limit.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -105,7 +106,7 @@ func resourceUsageLimitRead(ctx context.Context, d *schema.ResourceData, meta an conn := meta.(*conns.AWSClient).RedshiftServerlessClient(ctx) out, err := findUsageLimitByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Serverless UsageLimit (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/redshiftserverless/usage_limit_test.go b/internal/service/redshiftserverless/usage_limit_test.go index 1fb53552c1f..9894eb6ff68 100644 --- a/internal/service/redshiftserverless/usage_limit_test.go +++ b/internal/service/redshiftserverless/usage_limit_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -90,7 +90,7 @@ func testAccCheckUsageLimitDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfredshiftserverless.FindUsageLimitByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/redshiftserverless/workgroup.go b/internal/service/redshiftserverless/workgroup.go index 63f72eebea3..ea7005e4df2 100644 --- a/internal/service/redshiftserverless/workgroup.go +++ b/internal/service/redshiftserverless/workgroup.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -309,7 +310,7 @@ func resourceWorkgroupRead(ctx context.Context, d *schema.ResourceData, meta any out, err := findWorkgroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Redshift Serverless Workgroup (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -600,7 +601,7 @@ func statusWorkgroup(ctx context.Context, conn *redshiftserverless.Client, name return func() (any, string, error) { output, err := findWorkgroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/redshiftserverless/workgroup_test.go b/internal/service/redshiftserverless/workgroup_test.go index 87c56f51618..80d192e9325 100644 --- a/internal/service/redshiftserverless/workgroup_test.go +++ b/internal/service/redshiftserverless/workgroup_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -396,7 +396,7 @@ func testAccCheckWorkgroupDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfredshiftserverless.FindWorkgroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From bd227a1859bb455f87b6dc359425b92cbefbeb81 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:30 -0800 Subject: [PATCH 164/227] `rekognition` --- internal/service/rekognition/collection.go | 3 ++- internal/service/rekognition/collection_test.go | 4 ++-- internal/service/rekognition/project.go | 5 +++-- internal/service/rekognition/project_test.go | 4 ++-- internal/service/rekognition/stream_processor.go | 5 +++-- internal/service/rekognition/stream_processor_test.go | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/service/rekognition/collection.go b/internal/service/rekognition/collection.go index 8f3d604dbaa..c91d8d5fcfe 100644 --- a/internal/service/rekognition/collection.go +++ b/internal/service/rekognition/collection.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -146,7 +147,7 @@ func (r *collectionResource) Read(ctx context.Context, req resource.ReadRequest, out, err := findCollectionByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/rekognition/collection_test.go b/internal/service/rekognition/collection_test.go index 78b0d88fe88..37bd155cf9a 100644 --- a/internal/service/rekognition/collection_test.go +++ b/internal/service/rekognition/collection_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrekognition "github.com/hashicorp/terraform-provider-aws/internal/service/rekognition" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckCollectionDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tfrekognition.FindCollectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rekognition/project.go b/internal/service/rekognition/project.go index a7bf9d1531d..e0ab3b2665f 100644 --- a/internal/service/rekognition/project.go +++ b/internal/service/rekognition/project.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -163,7 +164,7 @@ func (r *projectResource) Read(ctx context.Context, req resource.ReadRequest, re out, err := findProjectByName(ctx, conn, state.ID.ValueString(), awstypes.CustomizationFeature(state.Feature.ValueString())) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -324,7 +325,7 @@ func findProjectByName(ctx context.Context, conn *rekognition.Client, name strin func statusProject(ctx context.Context, conn *rekognition.Client, name string, feature awstypes.CustomizationFeature) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findProjectByName(ctx, conn, name, feature) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rekognition/project_test.go b/internal/service/rekognition/project_test.go index f271a748949..97ce03badfd 100644 --- a/internal/service/rekognition/project_test.go +++ b/internal/service/rekognition/project_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrekognition "github.com/hashicorp/terraform-provider-aws/internal/service/rekognition" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -267,7 +267,7 @@ func testAccCheckProjectDestroy(ctx context.Context, feature string, name string } _, err := tfrekognition.FindProjectByName(ctx, conn, name, awstypes.CustomizationFeature(feature)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rekognition/stream_processor.go b/internal/service/rekognition/stream_processor.go index 9f92f3d191e..630bf7bd61c 100644 --- a/internal/service/rekognition/stream_processor.go +++ b/internal/service/rekognition/stream_processor.go @@ -36,6 +36,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -521,7 +522,7 @@ func (r *streamProcessorResource) Read(ctx context.Context, req resource.ReadReq } out, err := findStreamProcessorByName(ctx, conn, state.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return @@ -781,7 +782,7 @@ func waitStreamProcessorDeleted(ctx context.Context, conn *rekognition.Client, n func statusStreamProcessor(ctx context.Context, conn *rekognition.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findStreamProcessorByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/rekognition/stream_processor_test.go b/internal/service/rekognition/stream_processor_test.go index 88a61571452..7f799f500c0 100644 --- a/internal/service/rekognition/stream_processor_test.go +++ b/internal/service/rekognition/stream_processor_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrekognition "github.com/hashicorp/terraform-provider-aws/internal/service/rekognition" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -436,7 +436,7 @@ func testAccCheckStreamProcessorDestroy(ctx context.Context) resource.TestCheckF streamName := rs.Primary.Attributes[names.AttrName] _, err := tfrekognition.FindStreamProcessorByName(ctx, conn, streamName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a70154d4043a95e2f19745cc5df4c9845797ce9c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:30 -0800 Subject: [PATCH 165/227] `resiliencehub` --- internal/service/resiliencehub/resiliency_policy.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/service/resiliencehub/resiliency_policy.go b/internal/service/resiliencehub/resiliency_policy.go index 7689a60464d..db018c565ad 100644 --- a/internal/service/resiliencehub/resiliency_policy.go +++ b/internal/service/resiliencehub/resiliency_policy.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -278,7 +279,7 @@ func (r *resiliencyPolicyResource) Read(ctx context.Context, req resource.ReadRe } out, err := findResiliencyPolicyByARN(ctx, conn, state.PolicyARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -487,7 +488,7 @@ func waitResiliencyPolicyDeleted(ctx context.Context, conn *resiliencehub.Client func statusResiliencyPolicy(ctx context.Context, conn *resiliencehub.Client, arn string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findResiliencyPolicyByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From ce1127df3cf91437b5023a2473c98fcde345aa2f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:31 -0800 Subject: [PATCH 166/227] `resourceexplorer2` --- internal/service/resourceexplorer2/index.go | 5 +++-- internal/service/resourceexplorer2/index_test.go | 4 ++-- internal/service/resourceexplorer2/view.go | 3 ++- internal/service/resourceexplorer2/view_test.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/service/resourceexplorer2/index.go b/internal/service/resourceexplorer2/index.go index c5fc160e4c1..dae07723c9c 100644 --- a/internal/service/resourceexplorer2/index.go +++ b/internal/service/resourceexplorer2/index.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -144,7 +145,7 @@ func (r *indexResource) Read(ctx context.Context, request resource.ReadRequest, output, err := findIndex(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -283,7 +284,7 @@ func statusIndex(ctx context.Context, conn *resourceexplorer2.Client) sdkretry.S return func() (any, string, error) { output, err := findIndex(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/resourceexplorer2/index_test.go b/internal/service/resourceexplorer2/index_test.go index ae48c21ccfe..bf4ffd2e2d9 100644 --- a/internal/service/resourceexplorer2/index_test.go +++ b/internal/service/resourceexplorer2/index_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfresourceexplorer2 "github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckIndexDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfresourceexplorer2.FindIndex(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/resourceexplorer2/view.go b/internal/service/resourceexplorer2/view.go index 9ac20606736..c9d5ad9987e 100644 --- a/internal/service/resourceexplorer2/view.go +++ b/internal/service/resourceexplorer2/view.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func (r *viewResource) Read(ctx context.Context, request resource.ReadRequest, r output, err := findViewByARN(ctx, conn, data.ViewARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/resourceexplorer2/view_test.go b/internal/service/resourceexplorer2/view_test.go index b6ed4eb40f3..9db014d7688 100644 --- a/internal/service/resourceexplorer2/view_test.go +++ b/internal/service/resourceexplorer2/view_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfresourceexplorer2 "github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -273,7 +273,7 @@ func testAccCheckViewDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfresourceexplorer2.FindViewByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From d2f4aeeffeae40643d4997dd6382e54ece193c21 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:32 -0800 Subject: [PATCH 167/227] `resourcegroups` --- internal/service/resourcegroups/group.go | 5 +++-- internal/service/resourcegroups/group_test.go | 4 ++-- internal/service/resourcegroups/resource.go | 5 +++-- internal/service/resourcegroups/resource_test.go | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/service/resourcegroups/group.go b/internal/service/resourcegroups/group.go index e0152545603..26fccad4f5d 100644 --- a/internal/service/resourcegroups/group.go +++ b/internal/service/resourcegroups/group.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -160,7 +161,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di group, err := findGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Resource Groups Group %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -347,7 +348,7 @@ func statusGroupConfiguration(ctx context.Context, conn *resourcegroups.Client, return func() (any, string, error) { output, err := findGroupConfigurationByGroupName(ctx, conn, groupName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/resourcegroups/group_test.go b/internal/service/resourcegroups/group_test.go index 8478a03c03c..1c5ee2b03a1 100644 --- a/internal/service/resourcegroups/group_test.go +++ b/internal/service/resourcegroups/group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfresourcegroups "github.com/hashicorp/terraform-provider-aws/internal/service/resourcegroups" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -318,7 +318,7 @@ func testAccCheckResourceGroupDestroy(ctx context.Context) resource.TestCheckFun _, err := tfresourcegroups.FindGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/resourcegroups/resource.go b/internal/service/resourcegroups/resource.go index c233127968c..6343c603295 100644 --- a/internal/service/resourcegroups/resource.go +++ b/internal/service/resourcegroups/resource.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func resourceResourceRead(ctx context.Context, d *schema.ResourceData, meta any) resourceARN := parts[1] output, err := findResourceByTwoPartKey(ctx, conn, groupARN, resourceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] ResourceGroups Resource (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -201,7 +202,7 @@ func statusResource(ctx context.Context, conn *resourcegroups.Client, groupARN, return func() (any, string, error) { output, err := findResourceByTwoPartKey(ctx, conn, groupARN, resourceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/resourcegroups/resource_test.go b/internal/service/resourcegroups/resource_test.go index 5d20d01b504..50e1cfae157 100644 --- a/internal/service/resourcegroups/resource_test.go +++ b/internal/service/resourcegroups/resource_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfresourcegroups "github.com/hashicorp/terraform-provider-aws/internal/service/resourcegroups" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -101,7 +101,7 @@ func testAccCheckResourceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfresourcegroups.FindResourceByTwoPartKey(ctx, conn, rs.Primary.Attributes["group_arn"], rs.Primary.Attributes[names.AttrResourceARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8a7f1cc6be4d4e507a349af8944dd29b393eab75 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:33 -0800 Subject: [PATCH 168/227] `rolesanywhere` --- internal/service/rolesanywhere/profile.go | 3 ++- internal/service/rolesanywhere/profile_test.go | 4 ++-- internal/service/rolesanywhere/trust_anchor.go | 3 ++- internal/service/rolesanywhere/trust_anchor_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/rolesanywhere/profile.go b/internal/service/rolesanywhere/profile.go index 2e836d02b1d..276976dd73e 100644 --- a/internal/service/rolesanywhere/profile.go +++ b/internal/service/rolesanywhere/profile.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -129,7 +130,7 @@ func resourceProfileRead(ctx context.Context, d *schema.ResourceData, meta any) profile, err := findProfileByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RolesAnywhere Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rolesanywhere/profile_test.go b/internal/service/rolesanywhere/profile_test.go index 28a568fc7a0..5be6de2945f 100644 --- a/internal/service/rolesanywhere/profile_test.go +++ b/internal/service/rolesanywhere/profile_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrolesanywhere "github.com/hashicorp/terraform-provider-aws/internal/service/rolesanywhere" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -211,7 +211,7 @@ func testAccCheckProfileDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfrolesanywhere.FindProfileByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rolesanywhere/trust_anchor.go b/internal/service/rolesanywhere/trust_anchor.go index 19a51088506..4929fc4f243 100644 --- a/internal/service/rolesanywhere/trust_anchor.go +++ b/internal/service/rolesanywhere/trust_anchor.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -209,7 +210,7 @@ func resourceTrustAnchorRead(ctx context.Context, d *schema.ResourceData, meta a trustAnchor, err := findTrustAnchorByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] RolesAnywhere Trust Anchor (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rolesanywhere/trust_anchor_test.go b/internal/service/rolesanywhere/trust_anchor_test.go index 054bed9abfc..f3a6fed7987 100644 --- a/internal/service/rolesanywhere/trust_anchor_test.go +++ b/internal/service/rolesanywhere/trust_anchor_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfrolesanywhere "github.com/hashicorp/terraform-provider-aws/internal/service/rolesanywhere" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -251,7 +251,7 @@ func testAccCheckTrustAnchorDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfrolesanywhere.FindTrustAnchorByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 55d82a4a32e09f1f006c773749f2c01b27eabfca Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:34 -0800 Subject: [PATCH 169/227] `route53` --- internal/service/route53/change_info.go | 3 ++- internal/service/route53/cidr_collection.go | 3 ++- internal/service/route53/cidr_collection_test.go | 4 ++-- internal/service/route53/cidr_location.go | 3 ++- internal/service/route53/cidr_location_test.go | 4 ++-- internal/service/route53/delegation_set.go | 3 ++- internal/service/route53/delegation_set_test.go | 4 ++-- internal/service/route53/health_check.go | 3 ++- internal/service/route53/health_check_test.go | 4 ++-- internal/service/route53/hosted_zone_dnssec.go | 5 +++-- internal/service/route53/hosted_zone_dnssec_test.go | 4 ++-- internal/service/route53/key_signing_key.go | 5 +++-- internal/service/route53/key_signing_key_test.go | 4 ++-- internal/service/route53/query_log.go | 3 ++- internal/service/route53/query_log_test.go | 4 ++-- internal/service/route53/record.go | 5 +++-- internal/service/route53/record_test.go | 6 +++--- internal/service/route53/records_exclusive.go | 4 ++-- internal/service/route53/traffic_policy.go | 5 +++-- internal/service/route53/traffic_policy_instance.go | 5 +++-- internal/service/route53/traffic_policy_instance_test.go | 4 ++-- internal/service/route53/traffic_policy_test.go | 4 ++-- internal/service/route53/vpc_association_authorization.go | 3 ++- .../service/route53/vpc_association_authorization_test.go | 4 ++-- internal/service/route53/zone.go | 7 ++++--- internal/service/route53/zone_association.go | 3 ++- internal/service/route53/zone_association_test.go | 4 ++-- internal/service/route53/zone_test.go | 4 ++-- 28 files changed, 64 insertions(+), 50 deletions(-) diff --git a/internal/service/route53/change_info.go b/internal/service/route53/change_info.go index 1646bfa3fcb..3beb9f96e1b 100644 --- a/internal/service/route53/change_info.go +++ b/internal/service/route53/change_info.go @@ -13,6 +13,7 @@ import ( sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -45,7 +46,7 @@ func statusChange(ctx context.Context, conn *route53.Client, id string) sdkretry return func() (any, string, error) { output, err := findChangeByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53/cidr_collection.go b/internal/service/route53/cidr_collection.go index 97dc90b5d00..c75d01196a3 100644 --- a/internal/service/route53/cidr_collection.go +++ b/internal/service/route53/cidr_collection.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func (r *cidrCollectionResource) Read(ctx context.Context, request resource.Read output, err := findCIDRCollectionByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/route53/cidr_collection_test.go b/internal/service/route53/cidr_collection_test.go index ad5d70516f2..8764c8ce9af 100644 --- a/internal/service/route53/cidr_collection_test.go +++ b/internal/service/route53/cidr_collection_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +84,7 @@ func testAccCheckCIDRCollectionDestroy(ctx context.Context) resource.TestCheckFu _, err := tfroute53.FindCIDRCollectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/cidr_location.go b/internal/service/route53/cidr_location.go index cc47de892c2..981de3188e3 100644 --- a/internal/service/route53/cidr_location.go +++ b/internal/service/route53/cidr_location.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -137,7 +138,7 @@ func (r *cidrLocationResource) Read(ctx context.Context, request resource.ReadRe cidrBlocks, err := findCIDRLocationByTwoPartKey(ctx, conn, data.CIDRCollectionID.ValueString(), data.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/route53/cidr_location_test.go b/internal/service/route53/cidr_location_test.go index 63f75315097..0da5485530b 100644 --- a/internal/service/route53/cidr_location_test.go +++ b/internal/service/route53/cidr_location_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func testAccCheckCIDRLocationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfroute53.FindCIDRLocationByTwoPartKey(ctx, conn, rs.Primary.Attributes["cidr_collection_id"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/delegation_set.go b/internal/service/route53/delegation_set.go index 9052140d6f5..b00444e49af 100644 --- a/internal/service/route53/delegation_set.go +++ b/internal/service/route53/delegation_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +86,7 @@ func resourceDelegationSetRead(ctx context.Context, d *schema.ResourceData, meta set, err := findDelegationSetByID(ctx, conn, cleanDelegationSetID(d.Id())) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Reusable Delegation Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53/delegation_set_test.go b/internal/service/route53/delegation_set_test.go index a613258957f..a5bea9e4414 100644 --- a/internal/service/route53/delegation_set_test.go +++ b/internal/service/route53/delegation_set_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckDelegationSetDestroy(ctx context.Context) resource.TestCheckFun _, err := tfroute53.FindDelegationSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/health_check.go b/internal/service/route53/health_check.go index cc32d2fbc82..275289ea5b8 100644 --- a/internal/service/route53/health_check.go +++ b/internal/service/route53/health_check.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -306,7 +307,7 @@ func resourceHealthCheckRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findHealthCheckByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Health Check (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53/health_check_test.go b/internal/service/route53/health_check_test.go index cf5635b16c6..1da7bdc8492 100644 --- a/internal/service/route53/health_check_test.go +++ b/internal/service/route53/health_check_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -531,7 +531,7 @@ func testAccCheckHealthCheckDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfroute53.FindHealthCheckByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/hosted_zone_dnssec.go b/internal/service/route53/hosted_zone_dnssec.go index 6e94f21ec0d..c91f9f2133a 100644 --- a/internal/service/route53/hosted_zone_dnssec.go +++ b/internal/service/route53/hosted_zone_dnssec.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -102,7 +103,7 @@ func resourceHostedZoneDNSSECRead(ctx context.Context, d *schema.ResourceData, m hostedZoneDNSSEC, err := findHostedZoneDNSSECByZoneID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route 53 Hosted Zone DNSSEC (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -244,7 +245,7 @@ func statusHostedZoneDNSSEC(ctx context.Context, conn *route53.Client, hostedZon return func() (any, string, error) { output, err := findHostedZoneDNSSECByZoneID(ctx, conn, hostedZoneID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53/hosted_zone_dnssec_test.go b/internal/service/route53/hosted_zone_dnssec_test.go index bd13d797370..4fbdd77a535 100644 --- a/internal/service/route53/hosted_zone_dnssec_test.go +++ b/internal/service/route53/hosted_zone_dnssec_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func testAccCheckHostedZoneDNSSECDestroy(ctx context.Context) resource.TestCheck _, err := tfroute53.FindHostedZoneDNSSECByZoneID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/key_signing_key.go b/internal/service/route53/key_signing_key.go index 4633dc5af0b..2684bbf3e6c 100644 --- a/internal/service/route53/key_signing_key.go +++ b/internal/service/route53/key_signing_key.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -185,7 +186,7 @@ func resourceKeySigningKeyRead(ctx context.Context, d *schema.ResourceData, meta hostedZoneID, name := parts[0], parts[1] keySigningKey, err := findKeySigningKeyByTwoPartKey(ctx, conn, hostedZoneID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route 53 Key Signing Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -362,7 +363,7 @@ func statusKeySigningKey(ctx context.Context, conn *route53.Client, hostedZoneID return func() (any, string, error) { output, err := findKeySigningKeyByTwoPartKey(ctx, conn, hostedZoneID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53/key_signing_key_test.go b/internal/service/route53/key_signing_key_test.go index 499f8406397..1baaa7c471e 100644 --- a/internal/service/route53/key_signing_key_test.go +++ b/internal/service/route53/key_signing_key_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func testAccCheckKeySigningKeyDestroy(ctx context.Context) resource.TestCheckFun _, err := tfroute53.FindKeySigningKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrHostedZoneID], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/query_log.go b/internal/service/route53/query_log.go index 4a77c0db830..3f9159689d3 100644 --- a/internal/service/route53/query_log.go +++ b/internal/service/route53/query_log.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -78,7 +79,7 @@ func resourceQueryLogRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findQueryLoggingConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Query Logging Config %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53/query_log_test.go b/internal/service/route53/query_log_test.go index 4fb25de18ae..0199e58c3ac 100644 --- a/internal/service/route53/query_log_test.go +++ b/internal/service/route53/query_log_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -143,7 +143,7 @@ func testAccCheckQueryLogDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53.FindQueryLoggingConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/record.go b/internal/service/route53/record.go index eddc7d0bd12..e88b00b1747 100644 --- a/internal/service/route53/record.go +++ b/internal/service/route53/record.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -394,7 +395,7 @@ func resourceRecordRead(ctx context.Context, d *schema.ResourceData, meta any) d record, fqdn, err := findResourceRecordSetByFourPartKey(ctx, conn, cleanZoneID(d.Get("zone_id").(string)), d.Get(names.AttrName).(string), d.Get(names.AttrType).(string), d.Get("set_identifier").(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route 53 Record (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -704,7 +705,7 @@ func resourceRecordDelete(ctx context.Context, d *schema.ResourceData, meta any) } rec, _, err := findResourceRecordSetByFourPartKey(ctx, conn, zoneID, name, d.Get(names.AttrType).(string), d.Get("set_identifier").(string)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/route53/record_test.go b/internal/service/route53/record_test.go index dd2918ce7bc..0c2f7c61654 100644 --- a/internal/service/route53/record_test.go +++ b/internal/service/route53/record_test.go @@ -24,8 +24,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1935,7 +1935,7 @@ func testAccCheckRecordDestroy(ctx context.Context) resource.TestCheckFunc { rs.Primary.Attributes["set_identifier"], ) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1990,7 +1990,7 @@ func testAccCheckRecordDoesNotExist(ctx context.Context, zoneResourceName, recor _, _, err := tfroute53.FindResourceRecordSetByFourPartKey(ctx, conn, zone, recordName, recordType, "") - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/route53/records_exclusive.go b/internal/service/route53/records_exclusive.go index 3a65b68f272..8a24d195174 100644 --- a/internal/service/route53/records_exclusive.go +++ b/internal/service/route53/records_exclusive.go @@ -29,8 +29,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -369,7 +369,7 @@ func (r *recordsExclusiveResource) Read(ctx context.Context, req resource.ReadRe conn := r.Meta().Route53Client(ctx) output, err := findResourceRecordSetsForHostedZone(ctx, conn, state.ZoneID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/route53/traffic_policy.go b/internal/service/route53/traffic_policy.go index af505d350e6..f94b4afced8 100644 --- a/internal/service/route53/traffic_policy.go +++ b/internal/service/route53/traffic_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func resourceTrafficPolicyRead(ctx context.Context, d *schema.ResourceData, meta trafficPolicy, err := findTrafficPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Traffic Policy %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -172,7 +173,7 @@ func resourceTrafficPolicyDelete(ctx context.Context, d *schema.ResourceData, me } output, err := findTrafficPolicyVersions(ctx, conn, input) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } diff --git a/internal/service/route53/traffic_policy_instance.go b/internal/service/route53/traffic_policy_instance.go index 781782da55d..8ddd16d596a 100644 --- a/internal/service/route53/traffic_policy_instance.go +++ b/internal/service/route53/traffic_policy_instance.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +113,7 @@ func resourceTrafficPolicyInstanceRead(ctx context.Context, d *schema.ResourceDa trafficPolicyInstance, err := findTrafficPolicyInstanceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Traffic Policy Instance %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -209,7 +210,7 @@ func statusTrafficPolicyInstanceState(ctx context.Context, conn *route53.Client, return func() (any, string, error) { output, err := findTrafficPolicyInstanceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53/traffic_policy_instance_test.go b/internal/service/route53/traffic_policy_instance_test.go index 004175d2851..49da788915e 100644 --- a/internal/service/route53/traffic_policy_instance_test.go +++ b/internal/service/route53/traffic_policy_instance_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -149,7 +149,7 @@ func testAccCheckTrafficPolicyInstanceDestroy(ctx context.Context) resource.Test _, err := tfroute53.FindTrafficPolicyInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/traffic_policy_test.go b/internal/service/route53/traffic_policy_test.go index 01a7f727ddb..9f480372c70 100644 --- a/internal/service/route53/traffic_policy_test.go +++ b/internal/service/route53/traffic_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckTrafficPolicyDestroy(ctx context.Context) resource.TestCheckFun _, err := tfroute53.FindTrafficPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/vpc_association_authorization.go b/internal/service/route53/vpc_association_authorization.go index cbc21a868d8..e2f03fdd912 100644 --- a/internal/service/route53/vpc_association_authorization.go +++ b/internal/service/route53/vpc_association_authorization.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -110,7 +111,7 @@ func resourceVPCAssociationAuthorizationRead(ctx context.Context, d *schema.Reso return findVPCAssociationAuthorizationByTwoPartKey(ctx, conn, zoneID, vpcID) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 VPC Association Authorization %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53/vpc_association_authorization_test.go b/internal/service/route53/vpc_association_authorization_test.go index 4b56babf89f..18448efb053 100644 --- a/internal/service/route53/vpc_association_authorization_test.go +++ b/internal/service/route53/vpc_association_authorization_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckVPCAssociationAuthorizationDestroy(ctx context.Context) resourc _, err := tfroute53.FindVPCAssociationAuthorizationByTwoPartKey(ctx, conn, rs.Primary.Attributes["zone_id"], rs.Primary.Attributes[names.AttrVPCID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/zone.go b/internal/service/route53/zone.go index 49b2c4b7d63..f89495667cd 100644 --- a/internal/service/route53/zone.go +++ b/internal/service/route53/zone.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -184,7 +185,7 @@ func resourceZoneRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findHostedZoneByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Hosted Zone %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -328,7 +329,7 @@ func deleteHostedZone(ctx context.Context, conn *route53.Client, hostedZoneID, h hostedZoneDNSSEC, err := findHostedZoneDNSSECByZoneID(ctx, conn, hostedZoneID) switch { - case tfresource.NotFound(err), + case retry.NotFound(err), errs.IsAErrorMessageContains[*awstypes.InvalidArgument](err, "Operation is unsupported for private"), tfawserr.ErrMessageContains(err, errCodeAccessDenied, "The operation GetDNSSEC is not available for the current AWS account"): case err != nil: @@ -379,7 +380,7 @@ func deleteAllResourceRecordsFromHostedZone(ctx context.Context, conn *route53.C return true }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/route53/zone_association.go b/internal/service/route53/zone_association.go index 3964ce76301..f33f3097908 100644 --- a/internal/service/route53/zone_association.go +++ b/internal/service/route53/zone_association.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -127,7 +128,7 @@ func resourceZoneAssociationRead(ctx context.Context, d *schema.ResourceData, me hostedZoneSummary, err := findZoneAssociationByThreePartKey(ctx, conn, zoneID, vpcID, vpcRegion) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route 53 Zone Association %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53/zone_association_test.go b/internal/service/route53/zone_association_test.go index 7af26267d45..916752434be 100644 --- a/internal/service/route53/zone_association_test.go +++ b/internal/service/route53/zone_association_test.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -223,7 +223,7 @@ func testAccCheckZoneAssociationDestroy(ctx context.Context) resource.TestCheckF _, err := tfroute53.FindZoneAssociationByThreePartKey(ctx, conn, rs.Primary.Attributes["zone_id"], rs.Primary.Attributes[names.AttrVPCID], rs.Primary.Attributes["vpc_region"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53/zone_test.go b/internal/service/route53/zone_test.go index c0425bc5c76..10c55682750 100644 --- a/internal/service/route53/zone_test.go +++ b/internal/service/route53/zone_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -553,7 +553,7 @@ func testAccCheckZoneDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53.FindHostedZoneByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From dde27aa70f539cc0ef870546b072d6b610e0acec Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:34 -0800 Subject: [PATCH 170/227] `route53domains` --- .../service/route53domains/delegation_signer_record.go | 3 ++- .../route53domains/delegation_signer_record_test.go | 4 ++-- internal/service/route53domains/domain.go | 8 ++++---- internal/service/route53domains/domain_test.go | 4 ++-- internal/service/route53domains/operation.go | 3 ++- internal/service/route53domains/registered_domain.go | 3 ++- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/service/route53domains/delegation_signer_record.go b/internal/service/route53domains/delegation_signer_record.go index 8c48b6403a3..3aa185a5695 100644 --- a/internal/service/route53domains/delegation_signer_record.go +++ b/internal/service/route53domains/delegation_signer_record.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -174,7 +175,7 @@ func (r *delegationSignerRecordResource) Read(ctx context.Context, request resou dnssecKey, err := findDNSSECKeyByTwoPartKey(ctx, conn, data.DomainName.ValueString(), data.DNSSECKeyID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/route53domains/delegation_signer_record_test.go b/internal/service/route53domains/delegation_signer_record_test.go index 4b71b232b09..6881124ac09 100644 --- a/internal/service/route53domains/delegation_signer_record_test.go +++ b/internal/service/route53domains/delegation_signer_record_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53domains "github.com/hashicorp/terraform-provider-aws/internal/service/route53domains" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -81,7 +81,7 @@ func testAccCheckDelegationSignerAssociationDestroy(ctx context.Context) resourc _, err := tfroute53domains.FindDNSSECKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrDomainName], rs.Primary.Attributes["dnssec_key_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53domains/domain.go b/internal/service/route53domains/domain.go index edd8cfd03a4..80467139874 100644 --- a/internal/service/route53domains/domain.go +++ b/internal/service/route53domains/domain.go @@ -32,9 +32,9 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwplanmodifiers "github.com/hashicorp/terraform-provider-aws/internal/framework/planmodifiers" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -375,7 +375,7 @@ func (r *domainResource) Create(ctx context.Context, request resource.CreateRequ hostedZoneID, err := tfroute53.FindPublicHostedZoneIDByDomainName(ctx, r.Meta().Route53Client(ctx), domainName) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): data.HostedZoneID = types.StringNull() case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading Route 53 Hosted Zone (%s)", domainName), err.Error()) @@ -400,7 +400,7 @@ func (r *domainResource) Read(ctx context.Context, request resource.ReadRequest, domainName := fwflex.StringValueFromFramework(ctx, data.DomainName) domainDetail, err := findDomainDetailByName(ctx, conn, domainName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -424,7 +424,7 @@ func (r *domainResource) Read(ctx context.Context, request resource.ReadRequest, hostedZoneID, err := tfroute53.FindPublicHostedZoneIDByDomainName(ctx, r.Meta().Route53Client(ctx), domainName) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): data.HostedZoneID = types.StringNull() case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading Route 53 Hosted Zone (%s)", domainName), err.Error()) diff --git a/internal/service/route53domains/domain_test.go b/internal/service/route53domains/domain_test.go index 108776dbe58..6d4c2f5b946 100644 --- a/internal/service/route53domains/domain_test.go +++ b/internal/service/route53domains/domain_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53domains "github.com/hashicorp/terraform-provider-aws/internal/service/route53domains" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -174,7 +174,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53domains.FindDomainDetailByName(ctx, conn, rs.Primary.Attributes[names.AttrDomainName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53domains/operation.go b/internal/service/route53domains/operation.go index b07f1015c94..2e57773e115 100644 --- a/internal/service/route53domains/operation.go +++ b/internal/service/route53domains/operation.go @@ -14,6 +14,7 @@ import ( sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -40,7 +41,7 @@ func statusOperation(ctx context.Context, conn *route53domains.Client, id string return func() (any, string, error) { output, err := findOperationDetailByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53domains/registered_domain.go b/internal/service/route53domains/registered_domain.go index a083b346f61..5556e590ee0 100644 --- a/internal/service/route53domains/registered_domain.go +++ b/internal/service/route53domains/registered_domain.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -357,7 +358,7 @@ func resourceRegisteredDomainRead(ctx context.Context, d *schema.ResourceData, m domainDetail, err := findDomainDetailByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route 53 Domains Domain %s not found, removing from state", d.Id()) d.SetId("") return diags From 9134b4bdd7b8c366d28bb17a623978480c84e8d1 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:35 -0800 Subject: [PATCH 171/227] `route53profiles` --- internal/service/route53profiles/association.go | 5 +++-- internal/service/route53profiles/profile.go | 5 +++-- internal/service/route53profiles/resource_association.go | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/service/route53profiles/association.go b/internal/service/route53profiles/association.go index 952b9703c05..fe037d117fe 100644 --- a/internal/service/route53profiles/association.go +++ b/internal/service/route53profiles/association.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func (r *associationResource) Read(ctx context.Context, req resource.ReadRequest } out, err := findAssociationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -279,7 +280,7 @@ func waitAssociationDeleted(ctx context.Context, conn *route53profiles.Client, i func statusAssociation(ctx context.Context, conn *route53profiles.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53profiles/profile.go b/internal/service/route53profiles/profile.go index 3c6af48371a..1098071a03a 100644 --- a/internal/service/route53profiles/profile.go +++ b/internal/service/route53profiles/profile.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -162,7 +163,7 @@ func (r *profileResource) Read(ctx context.Context, req resource.ReadRequest, re } out, err := findProfileByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -255,7 +256,7 @@ func waitProfileDeleted(ctx context.Context, conn *route53profiles.Client, id st func statusProfile(ctx context.Context, conn *route53profiles.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findProfileByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53profiles/resource_association.go b/internal/service/route53profiles/resource_association.go index 92f622ba458..25941217be0 100644 --- a/internal/service/route53profiles/resource_association.go +++ b/internal/service/route53profiles/resource_association.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +163,7 @@ func (r *resourceAssociationResource) Read(ctx context.Context, req resource.Rea } out, err := findResourceAssociationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -256,7 +257,7 @@ func waitResourceAssociationDeleted(ctx context.Context, conn *route53profiles.C func statusResourceAssociation(ctx context.Context, conn *route53profiles.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findResourceAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 95535a74703618e634db6778adc45e3454f76fcf Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:36 -0800 Subject: [PATCH 172/227] `route53recoverycontrolconfig` --- .../service/route53recoverycontrolconfig/cluster.go | 3 ++- .../route53recoverycontrolconfig/cluster_test.go | 4 ++-- .../route53recoverycontrolconfig/control_panel.go | 3 ++- .../route53recoverycontrolconfig/control_panel_test.go | 4 ++-- .../route53recoverycontrolconfig/routing_control.go | 3 ++- .../routing_control_test.go | 4 ++-- .../route53recoverycontrolconfig/safety_rule.go | 3 ++- .../route53recoverycontrolconfig/safety_rule_test.go | 4 ++-- .../service/route53recoverycontrolconfig/status.go | 10 +++++----- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/internal/service/route53recoverycontrolconfig/cluster.go b/internal/service/route53recoverycontrolconfig/cluster.go index b59ec74eb7e..792487f1262 100644 --- a/internal/service/route53recoverycontrolconfig/cluster.go +++ b/internal/service/route53recoverycontrolconfig/cluster.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -120,7 +121,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findClusterByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Control Config Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53recoverycontrolconfig/cluster_test.go b/internal/service/route53recoverycontrolconfig/cluster_test.go index ff5d597bb4d..4896918d9f6 100644 --- a/internal/service/route53recoverycontrolconfig/cluster_test.go +++ b/internal/service/route53recoverycontrolconfig/cluster_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -212,7 +212,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53recoverycontrolconfig.FindClusterByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoverycontrolconfig/control_panel.go b/internal/service/route53recoverycontrolconfig/control_panel.go index 76829e24c98..575bb53d160 100644 --- a/internal/service/route53recoverycontrolconfig/control_panel.go +++ b/internal/service/route53recoverycontrolconfig/control_panel.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -105,7 +106,7 @@ func resourceControlPanelRead(ctx context.Context, d *schema.ResourceData, meta output, err := findControlPanelByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Control Config Control Panel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53recoverycontrolconfig/control_panel_test.go b/internal/service/route53recoverycontrolconfig/control_panel_test.go index b0b383be6b6..18582de316c 100644 --- a/internal/service/route53recoverycontrolconfig/control_panel_test.go +++ b/internal/service/route53recoverycontrolconfig/control_panel_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -149,7 +149,7 @@ func testAccCheckControlPanelDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfroute53recoverycontrolconfig.FindControlPanelByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoverycontrolconfig/routing_control.go b/internal/service/route53recoverycontrolconfig/routing_control.go index c5e163e1dc2..fd3d728f304 100644 --- a/internal/service/route53recoverycontrolconfig/routing_control.go +++ b/internal/service/route53recoverycontrolconfig/routing_control.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +99,7 @@ func resourceRoutingControlRead(ctx context.Context, d *schema.ResourceData, met output, err := findRoutingControlByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Control Config Routing Control (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53recoverycontrolconfig/routing_control_test.go b/internal/service/route53recoverycontrolconfig/routing_control_test.go index 2f94e5be936..8cb1216a0ce 100644 --- a/internal/service/route53recoverycontrolconfig/routing_control_test.go +++ b/internal/service/route53recoverycontrolconfig/routing_control_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -130,7 +130,7 @@ func testAccCheckRoutingControlDestroy(ctx context.Context) resource.TestCheckFu _, err := tfroute53recoverycontrolconfig.FindRoutingControlByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoverycontrolconfig/safety_rule.go b/internal/service/route53recoverycontrolconfig/safety_rule.go index f8afde1b37e..2bf8a95a7c2 100644 --- a/internal/service/route53recoverycontrolconfig/safety_rule.go +++ b/internal/service/route53recoverycontrolconfig/safety_rule.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -141,7 +142,7 @@ func resourceSafetyRuleRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findSafetyRuleByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Control Config Safety Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53recoverycontrolconfig/safety_rule_test.go b/internal/service/route53recoverycontrolconfig/safety_rule_test.go index 2c7ad180fa9..4d4772ec1fd 100644 --- a/internal/service/route53recoverycontrolconfig/safety_rule_test.go +++ b/internal/service/route53recoverycontrolconfig/safety_rule_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func testAccCheckSafetyRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53recoverycontrolconfig.FindSafetyRuleByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoverycontrolconfig/status.go b/internal/service/route53recoverycontrolconfig/status.go index d8883a4aa29..c51a0cd6ea2 100644 --- a/internal/service/route53recoverycontrolconfig/status.go +++ b/internal/service/route53recoverycontrolconfig/status.go @@ -8,14 +8,14 @@ import ( r53rcc "github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusCluster(ctx context.Context, conn *r53rcc.Client, clusterArn string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := findClusterByARN(ctx, conn, clusterArn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -31,7 +31,7 @@ func statusRoutingControl(ctx context.Context, conn *r53rcc.Client, routingContr return func() (any, string, error) { output, err := findRoutingControlByARN(ctx, conn, routingControlArn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -47,7 +47,7 @@ func statusControlPanel(ctx context.Context, conn *r53rcc.Client, controlPanelAr return func() (any, string, error) { output, err := findControlPanelByARN(ctx, conn, controlPanelArn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -63,7 +63,7 @@ func statusSafetyRule(ctx context.Context, conn *r53rcc.Client, safetyRuleArn st return func() (any, string, error) { output, err := findSafetyRuleByARN(ctx, conn, safetyRuleArn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From b4e4ec6d59bdc17aa291a8d58798afb8cecd9d1b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:39 -0800 Subject: [PATCH 173/227] `route53recoveryreadiness` --- internal/service/route53recoveryreadiness/cell.go | 5 +++-- internal/service/route53recoveryreadiness/cell_test.go | 4 ++-- internal/service/route53recoveryreadiness/readiness_check.go | 5 +++-- .../service/route53recoveryreadiness/readiness_check_test.go | 4 ++-- internal/service/route53recoveryreadiness/recovery_group.go | 5 +++-- .../service/route53recoveryreadiness/recovery_group_test.go | 4 ++-- internal/service/route53recoveryreadiness/resource_set.go | 5 +++-- .../service/route53recoveryreadiness/resource_set_test.go | 4 ++-- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/internal/service/route53recoveryreadiness/cell.go b/internal/service/route53recoveryreadiness/cell.go index b3f46abae15..a1f4dce6b93 100644 --- a/internal/service/route53recoveryreadiness/cell.go +++ b/internal/service/route53recoveryreadiness/cell.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -102,7 +103,7 @@ func resourceCellRead(ctx context.Context, d *schema.ResourceData, meta any) dia output, err := findCellByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Readiness Cell (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -160,7 +161,7 @@ func resourceCellDelete(ctx context.Context, d *schema.ResourceData, meta any) d err = tfresource.Retry(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) *tfresource.RetryError { _, err := findCellByName(ctx, conn, d.Id()) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return tfresource.NonRetryableError(err) diff --git a/internal/service/route53recoveryreadiness/cell_test.go b/internal/service/route53recoveryreadiness/cell_test.go index 250151c3c96..997f8f92aab 100644 --- a/internal/service/route53recoveryreadiness/cell_test.go +++ b/internal/service/route53recoveryreadiness/cell_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -211,7 +211,7 @@ func testAccCheckCellDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53recoveryreadiness.FindCellByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoveryreadiness/readiness_check.go b/internal/service/route53recoveryreadiness/readiness_check.go index ea110ebd9ca..5ceefc13bfc 100644 --- a/internal/service/route53recoveryreadiness/readiness_check.go +++ b/internal/service/route53recoveryreadiness/readiness_check.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -90,7 +91,7 @@ func resourceReadinessCheckRead(ctx context.Context, d *schema.ResourceData, met output, err := findReadinessCheckByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Readiness Readiness Check (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -147,7 +148,7 @@ func resourceReadinessCheckDelete(ctx context.Context, d *schema.ResourceData, m err = tfresource.Retry(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) *tfresource.RetryError { _, err = findReadinessCheckByName(ctx, conn, d.Id()) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return tfresource.NonRetryableError(err) diff --git a/internal/service/route53recoveryreadiness/readiness_check_test.go b/internal/service/route53recoveryreadiness/readiness_check_test.go index 1938470d11d..9c11ea3aaf8 100644 --- a/internal/service/route53recoveryreadiness/readiness_check_test.go +++ b/internal/service/route53recoveryreadiness/readiness_check_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -187,7 +187,7 @@ func testAccCheckReadinessCheckDestroy(ctx context.Context) resource.TestCheckFu _, err := tfroute53recoveryreadiness.FindReadinessCheckByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoveryreadiness/recovery_group.go b/internal/service/route53recoveryreadiness/recovery_group.go index b809634d9c7..1dcd39d7a6b 100644 --- a/internal/service/route53recoveryreadiness/recovery_group.go +++ b/internal/service/route53recoveryreadiness/recovery_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -94,7 +95,7 @@ func resourceRecoveryGroupRead(ctx context.Context, d *schema.ResourceData, meta output, err := findRecoveryGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Readiness Recovery Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -151,7 +152,7 @@ func resourceRecoveryGroupDelete(ctx context.Context, d *schema.ResourceData, me err = tfresource.Retry(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) *tfresource.RetryError { _, err := findRecoveryGroupByName(ctx, conn, d.Id()) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return tfresource.NonRetryableError(err) diff --git a/internal/service/route53recoveryreadiness/recovery_group_test.go b/internal/service/route53recoveryreadiness/recovery_group_test.go index 90a543f3505..7cf62805e86 100644 --- a/internal/service/route53recoveryreadiness/recovery_group_test.go +++ b/internal/service/route53recoveryreadiness/recovery_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -182,7 +182,7 @@ func testAccCheckRecoveryGroupDestroy(ctx context.Context) resource.TestCheckFun _, err := tfroute53recoveryreadiness.FindRecoveryGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53recoveryreadiness/resource_set.go b/internal/service/route53recoveryreadiness/resource_set.go index 9a82e3f623b..a0f9caf50cb 100644 --- a/internal/service/route53recoveryreadiness/resource_set.go +++ b/internal/service/route53recoveryreadiness/resource_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -180,7 +181,7 @@ func resourceResourceSetRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findResourceSetByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Recovery Readiness Resource Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -241,7 +242,7 @@ func resourceResourceSetDelete(ctx context.Context, d *schema.ResourceData, meta err = tfresource.Retry(ctx, d.Timeout(schema.TimeoutDelete), func(ctx context.Context) *tfresource.RetryError { _, err := findResourceSetByName(ctx, conn, d.Id()) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return tfresource.NonRetryableError(err) diff --git a/internal/service/route53recoveryreadiness/resource_set_test.go b/internal/service/route53recoveryreadiness/resource_set_test.go index 2b3475f3f8f..2cc19363c1d 100644 --- a/internal/service/route53recoveryreadiness/resource_set_test.go +++ b/internal/service/route53recoveryreadiness/resource_set_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -345,7 +345,7 @@ func testAccCheckResourceSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfroute53recoveryreadiness.FindResourceSetByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 3eae8ff8466ec27f068267ce1b63b6a8e829f707 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:40 -0800 Subject: [PATCH 174/227] `route53resolver` --- internal/service/route53resolver/config.go | 5 +++-- internal/service/route53resolver/dnssec_config.go | 5 +++-- internal/service/route53resolver/dnssec_config_test.go | 4 ++-- internal/service/route53resolver/endpoint.go | 5 +++-- internal/service/route53resolver/endpoint_test.go | 4 ++-- internal/service/route53resolver/firewall_config.go | 3 ++- internal/service/route53resolver/firewall_config_test.go | 4 ++-- internal/service/route53resolver/firewall_domain_list.go | 5 +++-- .../service/route53resolver/firewall_domain_list_test.go | 4 ++-- internal/service/route53resolver/firewall_rule.go | 3 ++- internal/service/route53resolver/firewall_rule_group.go | 3 ++- .../route53resolver/firewall_rule_group_association.go | 5 +++-- .../route53resolver/firewall_rule_group_association_test.go | 4 ++-- internal/service/route53resolver/firewall_rule_group_test.go | 4 ++-- internal/service/route53resolver/firewall_rule_test.go | 4 ++-- internal/service/route53resolver/query_log_config.go | 5 +++-- .../service/route53resolver/query_log_config_association.go | 5 +++-- .../route53resolver/query_log_config_association_test.go | 4 ++-- internal/service/route53resolver/query_log_config_test.go | 4 ++-- internal/service/route53resolver/rule.go | 5 +++-- internal/service/route53resolver/rule_association.go | 5 +++-- internal/service/route53resolver/rule_association_test.go | 4 ++-- internal/service/route53resolver/rule_test.go | 4 ++-- 23 files changed, 55 insertions(+), 43 deletions(-) diff --git a/internal/service/route53resolver/config.go b/internal/service/route53resolver/config.go index 089ececc825..f820e72d60e 100644 --- a/internal/service/route53resolver/config.go +++ b/internal/service/route53resolver/config.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +85,7 @@ func resourceConfigRead(ctx context.Context, d *schema.ResourceData, meta any) d resolverConfig, err := findResolverConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -163,7 +164,7 @@ func statusAutodefinedReverse(ctx context.Context, conn *route53resolver.Client, return func() (any, string, error) { output, err := findResolverConfigByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/dnssec_config.go b/internal/service/route53resolver/dnssec_config.go index e4fb0cc8a5e..66cba0921fa 100644 --- a/internal/service/route53resolver/dnssec_config.go +++ b/internal/service/route53resolver/dnssec_config.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +88,7 @@ func resourceDNSSECConfigRead(ctx context.Context, d *schema.ResourceData, meta dnssecConfig, err := findResolverDNSSECConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver DNSSEC Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -179,7 +180,7 @@ func statusDNSSECConfig(ctx context.Context, conn *route53resolver.Client, id st return func() (any, string, error) { output, err := findResolverDNSSECConfigByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/dnssec_config_test.go b/internal/service/route53resolver/dnssec_config_test.go index 1b1a8faf1da..9cd73fdd594 100644 --- a/internal/service/route53resolver/dnssec_config_test.go +++ b/internal/service/route53resolver/dnssec_config_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +85,7 @@ func testAccCheckDNSSECConfigDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfroute53resolver.FindResolverDNSSECConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/endpoint.go b/internal/service/route53resolver/endpoint.go index c2383b7f77b..8ffe85f3a83 100644 --- a/internal/service/route53resolver/endpoint.go +++ b/internal/service/route53resolver/endpoint.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -176,7 +177,7 @@ func resourceEndpointRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findResolverEndpointByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -358,7 +359,7 @@ func statusEndpoint(ctx context.Context, conn *route53resolver.Client, id string return func() (any, string, error) { output, err := findResolverEndpointByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/endpoint_test.go b/internal/service/route53resolver/endpoint_test.go index 3222b19a404..b3a01426ce7 100644 --- a/internal/service/route53resolver/endpoint_test.go +++ b/internal/service/route53resolver/endpoint_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -275,7 +275,7 @@ func testAccCheckEndpointDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53resolver.FindResolverEndpointByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/firewall_config.go b/internal/service/route53resolver/firewall_config.go index ea4b8947b39..3386be9a7ca 100644 --- a/internal/service/route53resolver/firewall_config.go +++ b/internal/service/route53resolver/firewall_config.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -80,7 +81,7 @@ func resourceFirewallConfigRead(ctx context.Context, d *schema.ResourceData, met firewallConfig, err := findFirewallConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Firewall Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53resolver/firewall_config_test.go b/internal/service/route53resolver/firewall_config_test.go index 036d8faa05e..be042e41920 100644 --- a/internal/service/route53resolver/firewall_config_test.go +++ b/internal/service/route53resolver/firewall_config_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func testAccCheckFirewallConfigDestroy(ctx context.Context) resource.TestCheckFu config, err := tfroute53resolver.FindFirewallConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/firewall_domain_list.go b/internal/service/route53resolver/firewall_domain_list.go index cb35080a075..7a4cb5bc34a 100644 --- a/internal/service/route53resolver/firewall_domain_list.go +++ b/internal/service/route53resolver/firewall_domain_list.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -105,7 +106,7 @@ func resourceFirewallDomainListRead(ctx context.Context, d *schema.ResourceData, firewallDomainList, err := findFirewallDomainListByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Firewall Domain List (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -233,7 +234,7 @@ func statusFirewallDomainList(ctx context.Context, conn *route53resolver.Client, return func() (any, string, error) { output, err := findFirewallDomainListByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/firewall_domain_list_test.go b/internal/service/route53resolver/firewall_domain_list_test.go index 5e3124c6e74..64869609fcd 100644 --- a/internal/service/route53resolver/firewall_domain_list_test.go +++ b/internal/service/route53resolver/firewall_domain_list_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -184,7 +184,7 @@ func testAccCheckFirewallDomainListDestroy(ctx context.Context) resource.TestChe _, err := tfroute53resolver.FindFirewallDomainListByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/firewall_rule.go b/internal/service/route53resolver/firewall_rule.go index 8b23cecb3f0..8c597c88d4d 100644 --- a/internal/service/route53resolver/firewall_rule.go +++ b/internal/service/route53resolver/firewall_rule.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -159,7 +160,7 @@ func resourceFirewallRuleRead(ctx context.Context, d *schema.ResourceData, meta firewallRule, err := findFirewallRuleByTwoPartKey(ctx, conn, firewallRuleGroupID, firewallDomainListID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Firewall Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53resolver/firewall_rule_group.go b/internal/service/route53resolver/firewall_rule_group.go index 8183de3ccf8..dd6a553217c 100644 --- a/internal/service/route53resolver/firewall_rule_group.go +++ b/internal/service/route53resolver/firewall_rule_group.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -88,7 +89,7 @@ func resourceFirewallRuleGroupRead(ctx context.Context, d *schema.ResourceData, ruleGroup, err := findFirewallRuleGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Firewall Rule Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/route53resolver/firewall_rule_group_association.go b/internal/service/route53resolver/firewall_rule_group_association.go index 43ca6a2e88c..b0f51f07f47 100644 --- a/internal/service/route53resolver/firewall_rule_group_association.go +++ b/internal/service/route53resolver/firewall_rule_group_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceFirewallRuleGroupAssociationRead(ctx context.Context, d *schema.Res ruleGroupAssociation, err := findFirewallRuleGroupAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Firewall Rule Group Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -215,7 +216,7 @@ func statusFirewallRuleGroupAssociation(ctx context.Context, conn *route53resolv return func() (any, string, error) { output, err := findFirewallRuleGroupAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/firewall_rule_group_association_test.go b/internal/service/route53resolver/firewall_rule_group_association_test.go index c6d9cb1f024..f60a40e3ec7 100644 --- a/internal/service/route53resolver/firewall_rule_group_association_test.go +++ b/internal/service/route53resolver/firewall_rule_group_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -239,7 +239,7 @@ func testAccCheckFirewallRuleGroupAssociationDestroy(ctx context.Context) resour _, err := tfroute53resolver.FindFirewallRuleGroupAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/firewall_rule_group_test.go b/internal/service/route53resolver/firewall_rule_group_test.go index ae8740d6ae8..680fbae02b4 100644 --- a/internal/service/route53resolver/firewall_rule_group_test.go +++ b/internal/service/route53resolver/firewall_rule_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +144,7 @@ func testAccCheckFirewallRuleGroupDestroy(ctx context.Context) resource.TestChec _, err := tfroute53resolver.FindFirewallRuleGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/firewall_rule_test.go b/internal/service/route53resolver/firewall_rule_test.go index 8885b199a42..f7d226bb335 100644 --- a/internal/service/route53resolver/firewall_rule_test.go +++ b/internal/service/route53resolver/firewall_rule_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -226,7 +226,7 @@ func testAccCheckFirewallRuleDestroy(ctx context.Context) resource.TestCheckFunc _, err = tfroute53resolver.FindFirewallRuleByTwoPartKey(ctx, conn, firewallRuleGroupID, firewallDomainListID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/query_log_config.go b/internal/service/route53resolver/query_log_config.go index 264c4dedcba..1d3b362b595 100644 --- a/internal/service/route53resolver/query_log_config.go +++ b/internal/service/route53resolver/query_log_config.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -102,7 +103,7 @@ func resourceQueryLogConfigRead(ctx context.Context, d *schema.ResourceData, met queryLogConfig, err := findResolverQueryLogConfigByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Query Log Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -179,7 +180,7 @@ func statusQueryLogConfig(ctx context.Context, conn *route53resolver.Client, id return func() (any, string, error) { output, err := findResolverQueryLogConfigByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/query_log_config_association.go b/internal/service/route53resolver/query_log_config_association.go index 2c5b94fcc76..e21eb97ba68 100644 --- a/internal/service/route53resolver/query_log_config_association.go +++ b/internal/service/route53resolver/query_log_config_association.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -79,7 +80,7 @@ func resourceQueryLogConfigAssociationRead(ctx context.Context, d *schema.Resour queryLogConfigAssociation, err := findResolverQueryLogConfigAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Query Log Config Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -149,7 +150,7 @@ func statusQueryLogConfigAssociation(ctx context.Context, conn *route53resolver. return func() (any, string, error) { output, err := findResolverQueryLogConfigAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/query_log_config_association_test.go b/internal/service/route53resolver/query_log_config_association_test.go index 6642c6cad0c..2b19fa6b44c 100644 --- a/internal/service/route53resolver/query_log_config_association_test.go +++ b/internal/service/route53resolver/query_log_config_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -85,7 +85,7 @@ func testAccCheckQueryLogConfigAssociationDestroy(ctx context.Context) resource. _, err := tfroute53resolver.FindResolverQueryLogConfigAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/query_log_config_test.go b/internal/service/route53resolver/query_log_config_test.go index aea6e9fffc3..599299b4cb9 100644 --- a/internal/service/route53resolver/query_log_config_test.go +++ b/internal/service/route53resolver/query_log_config_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckQueryLogConfigDestroy(ctx context.Context) resource.TestCheckFu _, err := tfroute53resolver.FindResolverQueryLogConfigByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/rule.go b/internal/service/route53resolver/rule.go index c394f454b3d..90902d8cb8a 100644 --- a/internal/service/route53resolver/rule.go +++ b/internal/service/route53resolver/rule.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -163,7 +164,7 @@ func resourceRuleRead(ctx context.Context, d *schema.ResourceData, meta any) dia rule, err := findResolverRuleByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -292,7 +293,7 @@ func statusRule(ctx context.Context, conn *route53resolver.Client, id string) sd return func() (any, string, error) { output, err := findResolverRuleByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/rule_association.go b/internal/service/route53resolver/rule_association.go index 2084d930ea9..f91fcd33fa9 100644 --- a/internal/service/route53resolver/rule_association.go +++ b/internal/service/route53resolver/rule_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +98,7 @@ func resourceRuleAssociationRead(ctx context.Context, d *schema.ResourceData, me ruleAssociation, err := findResolverRuleAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Route53 Resolver Rule Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -168,7 +169,7 @@ func statusRuleAssociation(ctx context.Context, conn *route53resolver.Client, id return func() (any, string, error) { output, err := findResolverRuleAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/route53resolver/rule_association_test.go b/internal/service/route53resolver/rule_association_test.go index e059d820ed0..7fdba3c6a30 100644 --- a/internal/service/route53resolver/rule_association_test.go +++ b/internal/service/route53resolver/rule_association_test.go @@ -14,9 +14,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +115,7 @@ func testAccCheckRuleAssociationDestroy(ctx context.Context) resource.TestCheckF _, err := tfroute53resolver.FindResolverRuleAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/route53resolver/rule_test.go b/internal/service/route53resolver/rule_test.go index 074f5f8f449..c6f1ccd7b97 100644 --- a/internal/service/route53resolver/rule_test.go +++ b/internal/service/route53resolver/rule_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -585,7 +585,7 @@ func testAccCheckRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfroute53resolver.FindResolverRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5852bab3c9f896597328644601aa8cc464339e65 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:41 -0800 Subject: [PATCH 175/227] `rum` --- internal/service/rum/app_monitor.go | 3 ++- internal/service/rum/app_monitor_test.go | 4 ++-- internal/service/rum/metrics_destination.go | 3 ++- internal/service/rum/metrics_destination_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/rum/app_monitor.go b/internal/service/rum/app_monitor.go index c32a7f84901..7dd228aff48 100644 --- a/internal/service/rum/app_monitor.go +++ b/internal/service/rum/app_monitor.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -204,7 +205,7 @@ func resourceAppMonitorRead(ctx context.Context, d *schema.ResourceData, meta an appMon, err := findAppMonitorByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudWatch RUM App Monitor %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rum/app_monitor_test.go b/internal/service/rum/app_monitor_test.go index 99fc9ec5ea8..206e9be4bed 100644 --- a/internal/service/rum/app_monitor_test.go +++ b/internal/service/rum/app_monitor_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatchrum "github.com/hashicorp/terraform-provider-aws/internal/service/rum" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -271,7 +271,7 @@ func testAccCheckAppMonitorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfcloudwatchrum.FindAppMonitorByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/rum/metrics_destination.go b/internal/service/rum/metrics_destination.go index 900f1b510c7..302338ba7e0 100644 --- a/internal/service/rum/metrics_destination.go +++ b/internal/service/rum/metrics_destination.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -95,7 +96,7 @@ func resourceMetricsDestinationRead(ctx context.Context, d *schema.ResourceData, dest, err := findMetricsDestinationByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] CloudWatch RUM Metrics Destination %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/rum/metrics_destination_test.go b/internal/service/rum/metrics_destination_test.go index 19b057a4412..77a75b80296 100644 --- a/internal/service/rum/metrics_destination_test.go +++ b/internal/service/rum/metrics_destination_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudwatchrum "github.com/hashicorp/terraform-provider-aws/internal/service/rum" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckMetricsDestinationDestroy(ctx context.Context) resource.TestChe _, err := tfcloudwatchrum.FindMetricsDestinationByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 4375248191f6a4b185553256364dd774ba478614 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:42 -0800 Subject: [PATCH 176/227] `s3` --- internal/service/s3/bucket.go | 29 ++++++++++--------- internal/service/s3/bucket_abac.go | 3 +- internal/service/s3/bucket_abac_test.go | 4 +-- .../s3/bucket_accelerate_configuration.go | 3 +- .../bucket_accelerate_configuration_test.go | 4 +-- internal/service/s3/bucket_acl.go | 3 +- .../s3/bucket_analytics_configuration.go | 3 +- .../s3/bucket_analytics_configuration_test.go | 4 +-- .../service/s3/bucket_cors_configuration.go | 3 +- .../s3/bucket_cors_configuration_test.go | 4 +-- internal/service/s3/bucket_data_source.go | 4 +-- ...ucket_intelligent_tiering_configuration.go | 3 +- ..._intelligent_tiering_configuration_test.go | 4 +-- internal/service/s3/bucket_inventory.go | 3 +- internal/service/s3/bucket_inventory_test.go | 4 +-- .../s3/bucket_lifecycle_configuration.go | 5 ++-- .../s3/bucket_lifecycle_configuration_test.go | 5 ++-- internal/service/s3/bucket_logging.go | 3 +- internal/service/s3/bucket_logging_test.go | 4 +-- .../s3/bucket_metadata_configuration.go | 6 ++-- .../s3/bucket_metadata_configuration_test.go | 4 +-- internal/service/s3/bucket_metric.go | 3 +- internal/service/s3/bucket_metric_test.go | 4 +-- internal/service/s3/bucket_notification.go | 3 +- .../service/s3/bucket_notification_test.go | 4 +-- internal/service/s3/bucket_object.go | 4 +-- .../s3/bucket_object_lock_configuration.go | 3 +- .../bucket_object_lock_configuration_test.go | 4 +-- internal/service/s3/bucket_object_test.go | 4 +-- .../service/s3/bucket_ownership_controls.go | 3 +- .../s3/bucket_ownership_controls_test.go | 4 +-- internal/service/s3/bucket_policy.go | 3 +- internal/service/s3/bucket_policy_test.go | 4 +-- .../service/s3/bucket_public_access_block.go | 3 +- .../s3/bucket_public_access_block_test.go | 4 +-- .../s3/bucket_replication_configuration.go | 3 +- .../bucket_replication_configuration_test.go | 8 ++--- .../bucket_request_payment_configuration.go | 3 +- ...cket_request_payment_configuration_test.go | 4 +-- ...et_server_side_encryption_configuration.go | 3 +- internal/service/s3/bucket_versioning.go | 5 ++-- internal/service/s3/bucket_versioning_test.go | 4 +-- .../s3/bucket_website_configuration.go | 3 +- .../s3/bucket_website_configuration_test.go | 4 +-- internal/service/s3/directory_bucket.go | 4 +-- internal/service/s3/directory_bucket_test.go | 4 +-- internal/service/s3/object.go | 3 +- internal/service/s3/object_copy.go | 4 +-- internal/service/s3/object_copy_test.go | 4 +-- internal/service/s3/object_test.go | 4 +-- internal/service/s3/sweep.go | 3 +- 51 files changed, 121 insertions(+), 97 deletions(-) diff --git a/internal/service/s3/bucket.go b/internal/service/s3/bucket.go index a6fa2cf0eb5..82968a4da9f 100644 --- a/internal/service/s3/bucket.go +++ b/internal/service/s3/bucket.go @@ -36,6 +36,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -822,7 +823,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d _, err := findBucket(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -862,7 +863,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d } d.Set(names.AttrPolicy, policyToSet) - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set(names.AttrPolicy, nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) policy: %s", d.Id(), err) @@ -886,7 +887,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("grant", flattenBucketGrants(bucketACL)); err != nil { return sdkdiag.AppendErrorf(diags, "setting grant: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("grant", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) ACL: %s", d.Id(), err) @@ -910,7 +911,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("cors_rule", flattenBucketCORSRules(corsRules)); err != nil { return sdkdiag.AppendErrorf(diags, "setting cors_rule: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeNoSuchCORSConfiguration, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeNoSuchCORSConfiguration, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("cors_rule", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) CORS configuration: %s", d.Id(), err) @@ -938,7 +939,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("website", website); err != nil { return sdkdiag.AppendErrorf(diags, "setting website: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("website", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) website configuration: %s", d.Id(), err) @@ -962,7 +963,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("versioning", flattenBucketVersioning(bucketVersioning)); err != nil { return sdkdiag.AppendErrorf(diags, "setting versioning: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("versioning", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) versioning: %s", d.Id(), err) @@ -984,7 +985,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d switch { case err == nil: d.Set("acceleration_status", bucketAccelerate.Status) - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented, errCodeUnsupportedArgument, errCodeUnsupportedOperation): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented, errCodeUnsupportedArgument, errCodeUnsupportedOperation): d.Set("acceleration_status", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) accelerate configuration: %s", d.Id(), err) @@ -1006,7 +1007,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d switch { case err == nil: d.Set("request_payer", bucketRequestPayment.Payer) - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("request_payer", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) request payment configuration: %s", d.Id(), err) @@ -1030,7 +1031,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("logging", flattenBucketLoggingEnabled(loggingEnabled)); err != nil { return sdkdiag.AppendErrorf(diags, "setting logging: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("logging", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) logging: %s", d.Id(), err) @@ -1060,7 +1061,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("lifecycle_rule", flattenBucketLifecycleRules(ctx, lifecycleRules)); err != nil { return sdkdiag.AppendErrorf(diags, "setting lifecycle_rule: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("lifecycle_rule", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) lifecycle configuration: %s", d.Id(), err) @@ -1084,7 +1085,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("replication_configuration", flattenBucketReplicationConfiguration(ctx, replicationConfiguration)); err != nil { return sdkdiag.AppendErrorf(diags, "setting replication_configuration: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("replication_configuration", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) replication configuration: %s", d.Id(), err) @@ -1108,7 +1109,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d if err := d.Set("server_side_encryption_configuration", flattenBucketServerSideEncryptionConfiguration(encryptionConfiguration)); err != nil { return sdkdiag.AppendErrorf(diags, "setting server_side_encryption_configuration: %s", err) } - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented, errCodeUnsupportedOperation): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented, errCodeUnsupportedOperation): d.Set("server_side_encryption_configuration", nil) default: return sdkdiag.AppendErrorf(diags, "reading S3 Bucket (%s) server-side encryption configuration: %s", d.Id(), err) @@ -1133,7 +1134,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d return sdkdiag.AppendErrorf(diags, "setting object_lock_configuration: %s", err) } d.Set("object_lock_enabled", objLockConfig.ObjectLockEnabled == types.ObjectLockEnabledEnabled) - case tfresource.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): + case retry.NotFound(err), tfawserr.ErrCodeEquals(err, errCodeMethodNotAllowed, errCodeNotImplemented, errCodeXNotImplemented): d.Set("object_lock_configuration", nil) d.Set("object_lock_enabled", nil) default: @@ -1150,7 +1151,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d // region, err := findBucketRegion(ctx, c, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_abac.go b/internal/service/s3/bucket_abac.go index d3accebc606..4cb0c08ae84 100644 --- a/internal/service/s3/bucket_abac.go +++ b/internal/service/s3/bucket_abac.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/smerr" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func (r *resourceBucketABAC) Read(ctx context.Context, req resource.ReadRequest, } out, err := findBucketABAC(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) resp.State.RemoveResource(ctx) return diff --git a/internal/service/s3/bucket_abac_test.go b/internal/service/s3/bucket_abac_test.go index f128149b0f1..53006eada53 100644 --- a/internal/service/s3/bucket_abac_test.go +++ b/internal/service/s3/bucket_abac_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -209,7 +209,7 @@ func testAccCheckBucketABACDestroy(ctx context.Context) resource.TestCheckFunc { expectedBucketOwner := rs.Primary.Attributes[names.AttrExpectedBucketOwner] _, err := tfs3.FindBucketABAC(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/s3/bucket_accelerate_configuration.go b/internal/service/s3/bucket_accelerate_configuration.go index 818181906f5..52be7733182 100644 --- a/internal/service/s3/bucket_accelerate_configuration.go +++ b/internal/service/s3/bucket_accelerate_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -116,7 +117,7 @@ func resourceBucketAccelerateConfigurationRead(ctx context.Context, d *schema.Re output, err := findBucketAccelerateConfiguration(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Accelerate Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_accelerate_configuration_test.go b/internal/service/s3/bucket_accelerate_configuration_test.go index 627c3509564..b62479bc70b 100644 --- a/internal/service/s3/bucket_accelerate_configuration_test.go +++ b/internal/service/s3/bucket_accelerate_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func testAccCheckBucketAccelerateConfigurationDestroy(ctx context.Context) resou _, err = tfs3.FindBucketAccelerateConfiguration(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_acl.go b/internal/service/s3/bucket_acl.go index 1360d08ab25..efb730c8846 100644 --- a/internal/service/s3/bucket_acl.go +++ b/internal/service/s3/bucket_acl.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -220,7 +221,7 @@ func resourceBucketACLRead(ctx context.Context, d *schema.ResourceData, meta any bucketACL, err := findBucketACL(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket ACL (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_analytics_configuration.go b/internal/service/s3/bucket_analytics_configuration.go index 656d8ceb19e..f2ab000d276 100644 --- a/internal/service/s3/bucket_analytics_configuration.go +++ b/internal/service/s3/bucket_analytics_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -200,7 +201,7 @@ func resourceBucketAnalyticsConfigurationRead(ctx context.Context, d *schema.Res ac, err := findAnalyticsConfiguration(ctx, conn, bucket, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Analytics Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_analytics_configuration_test.go b/internal/service/s3/bucket_analytics_configuration_test.go index efa57e755ff..ad83f88f1c2 100644 --- a/internal/service/s3/bucket_analytics_configuration_test.go +++ b/internal/service/s3/bucket_analytics_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -501,7 +501,7 @@ func testAccCheckBucketAnalyticsConfigurationDestroy(ctx context.Context) resour _, err = tfs3.FindAnalyticsConfiguration(ctx, conn, bucket, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_cors_configuration.go b/internal/service/s3/bucket_cors_configuration.go index 7c039663b48..ba236c3680b 100644 --- a/internal/service/s3/bucket_cors_configuration.go +++ b/internal/service/s3/bucket_cors_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -151,7 +152,7 @@ func resourceBucketCorsConfigurationRead(ctx context.Context, d *schema.Resource corsRules, err := findCORSRules(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket CORS Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_cors_configuration_test.go b/internal/service/s3/bucket_cors_configuration_test.go index d7d1f156b70..7c7b1f119f2 100644 --- a/internal/service/s3/bucket_cors_configuration_test.go +++ b/internal/service/s3/bucket_cors_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -369,7 +369,7 @@ func testAccCheckBucketCORSConfigurationDestroy(ctx context.Context) resource.Te _, err = tfs3.FindCORSRules(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_data_source.go b/internal/service/s3/bucket_data_source.go index e1b78fd7be2..0d8862ec7c9 100644 --- a/internal/service/s3/bucket_data_source.go +++ b/internal/service/s3/bucket_data_source.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +103,7 @@ func dataSourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) endpoint, domain := bucketWebsiteEndpointAndDomain(bucket, region) d.Set("website_domain", domain) d.Set("website_endpoint", endpoint) - } else if !tfresource.NotFound(err) { + } else if !retry.NotFound(err) { log.Printf("[WARN] Reading S3 Bucket (%s) Website: %s", bucket, err) } diff --git a/internal/service/s3/bucket_intelligent_tiering_configuration.go b/internal/service/s3/bucket_intelligent_tiering_configuration.go index 0a6f3ad1708..4576da7167f 100644 --- a/internal/service/s3/bucket_intelligent_tiering_configuration.go +++ b/internal/service/s3/bucket_intelligent_tiering_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -165,7 +166,7 @@ func resourceBucketIntelligentTieringConfigurationRead(ctx context.Context, d *s output, err := findIntelligentTieringConfiguration(ctx, conn, bucket, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Intelligent-Tiering Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_intelligent_tiering_configuration_test.go b/internal/service/s3/bucket_intelligent_tiering_configuration_test.go index d8b28a83c93..9a9b3b2bc2b 100644 --- a/internal/service/s3/bucket_intelligent_tiering_configuration_test.go +++ b/internal/service/s3/bucket_intelligent_tiering_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -263,7 +263,7 @@ func testAccCheckBucketIntelligentTieringConfigurationDestroy(ctx context.Contex _, err = tfs3.FindIntelligentTieringConfiguration(ctx, conn, bucket, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_inventory.go b/internal/service/s3/bucket_inventory.go index 50d6378e3e3..2d96b859d5b 100644 --- a/internal/service/s3/bucket_inventory.go +++ b/internal/service/s3/bucket_inventory.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -261,7 +262,7 @@ func resourceBucketInventoryRead(ctx context.Context, d *schema.ResourceData, me ic, err := findInventoryConfiguration(ctx, conn, bucket, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Inventory (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_inventory_test.go b/internal/service/s3/bucket_inventory_test.go index 150cb941a1a..57b42d08461 100644 --- a/internal/service/s3/bucket_inventory_test.go +++ b/internal/service/s3/bucket_inventory_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -193,7 +193,7 @@ func testAccCheckBucketInventoryDestroy(ctx context.Context) resource.TestCheckF _, err = tfs3.FindInventoryConfiguration(ctx, conn, bucket, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_lifecycle_configuration.go b/internal/service/s3/bucket_lifecycle_configuration.go index de66ddad2db..5f1f71d7498 100644 --- a/internal/service/s3/bucket_lifecycle_configuration.go +++ b/internal/service/s3/bucket_lifecycle_configuration.go @@ -44,6 +44,7 @@ import ( fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" tfobjectvalidator "github.com/hashicorp/terraform-provider-aws/internal/framework/validators/objectvalidator" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -468,7 +469,7 @@ func (r *bucketLifecycleConfigurationResource) Read(ctx context.Context, request return nil }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -662,7 +663,7 @@ func statusLifecycleConfigEquals(ctx context.Context, conn *s3.Client, bucket, o return func() (any, string, error) { output, err := findBucketLifecycleConfiguration(ctx, conn, bucket, owner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/s3/bucket_lifecycle_configuration_test.go b/internal/service/s3/bucket_lifecycle_configuration_test.go index 0ff0d3d23d3..c42a540fcf6 100644 --- a/internal/service/s3/bucket_lifecycle_configuration_test.go +++ b/internal/service/s3/bucket_lifecycle_configuration_test.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -4046,7 +4047,7 @@ func testAccCheckBucketLifecycleConfigurationDestroy(ctx context.Context) resour _, err = tfs3.FindBucketLifecycleConfiguration(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -4087,7 +4088,7 @@ func testAccCheckBucketLifecycleConfigurationExists(ctx context.Context, n strin var err error output, err = tfs3.FindBucketLifecycleConfiguration(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return tfresource.RetryableError(err) } if err != nil { diff --git a/internal/service/s3/bucket_logging.go b/internal/service/s3/bucket_logging.go index c16c5c20b82..afd636e38b0 100644 --- a/internal/service/s3/bucket_logging.go +++ b/internal/service/s3/bucket_logging.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -208,7 +209,7 @@ func resourceBucketLoggingRead(ctx context.Context, d *schema.ResourceData, meta loggingEnabled, err := findLoggingEnabled(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Logging (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_logging_test.go b/internal/service/s3/bucket_logging_test.go index 90699704e68..dfd1a610381 100644 --- a/internal/service/s3/bucket_logging_test.go +++ b/internal/service/s3/bucket_logging_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -486,7 +486,7 @@ func testAccCheckBucketLoggingDestroy(ctx context.Context) resource.TestCheckFun _, err = tfs3.FindLoggingEnabled(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_metadata_configuration.go b/internal/service/s3/bucket_metadata_configuration.go index d69aec88c40..03c966b2270 100644 --- a/internal/service/s3/bucket_metadata_configuration.go +++ b/internal/service/s3/bucket_metadata_configuration.go @@ -279,7 +279,7 @@ func (r *bucketMetadataConfigurationResource) Read(ctx context.Context, request bucket, expectedBucketOwner := fwflex.StringValueFromFramework(ctx, data.Bucket), fwflex.StringValueFromFramework(ctx, data.ExpectedBucketOwner) output, err := findBucketMetadataConfigurationByTwoPartKey(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -513,7 +513,7 @@ func statusBucketMetadataInventoryTableConfiguration(conn *s3.Client, bucket, ex return func(ctx context.Context) (any, string, error) { mcr, err := findBucketMetadataConfigurationByTwoPartKey(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -534,7 +534,7 @@ func statusBucketMetadataJournalTableConfiguration(conn *s3.Client, bucket, expe return func(ctx context.Context) (any, string, error) { mcr, err := findBucketMetadataConfigurationByTwoPartKey(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/s3/bucket_metadata_configuration_test.go b/internal/service/s3/bucket_metadata_configuration_test.go index b8952614826..f0a0c99d325 100644 --- a/internal/service/s3/bucket_metadata_configuration_test.go +++ b/internal/service/s3/bucket_metadata_configuration_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -233,7 +233,7 @@ func testAccCheckBucketMetadataConfigurationDestroy(ctx context.Context) resourc _, err := tfs3.FindBucketMetadataConfigurationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrBucket], rs.Primary.Attributes[names.AttrExpectedBucketOwner]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_metric.go b/internal/service/s3/bucket_metric.go index a163c61a98a..ca0811a4bc1 100644 --- a/internal/service/s3/bucket_metric.go +++ b/internal/service/s3/bucket_metric.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -146,7 +147,7 @@ func resourceBucketMetricRead(ctx context.Context, d *schema.ResourceData, meta mc, err := findMetricsConfiguration(ctx, conn, bucket, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Metric (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_metric_test.go b/internal/service/s3/bucket_metric_test.go index 3861549aff3..2dc8bd20329 100644 --- a/internal/service/s3/bucket_metric_test.go +++ b/internal/service/s3/bucket_metric_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -648,7 +648,7 @@ func testAccCheckBucketMetricDestroy(ctx context.Context) resource.TestCheckFunc _, err = tfs3.FindMetricsConfiguration(ctx, conn, bucket, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_notification.go b/internal/service/s3/bucket_notification.go index 9aa53cb02da..e2560427fc4 100644 --- a/internal/service/s3/bucket_notification.go +++ b/internal/service/s3/bucket_notification.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -346,7 +347,7 @@ func resourceBucketNotificationRead(ctx context.Context, d *schema.ResourceData, output, err := findBucketNotificationConfiguration(ctx, conn, bucket, "") - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Notification (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_notification_test.go b/internal/service/s3/bucket_notification_test.go index 9dcdf6061c8..95e4b76364a 100644 --- a/internal/service/s3/bucket_notification_test.go +++ b/internal/service/s3/bucket_notification_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -285,7 +285,7 @@ func testAccCheckBucketNotificationDestroy(ctx context.Context) resource.TestChe _, err := tfs3.FindBucketNotificationConfiguration(ctx, conn, rs.Primary.ID, "") - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_object.go b/internal/service/s3/bucket_object.go index 18121bed696..0610079e854 100644 --- a/internal/service/s3/bucket_object.go +++ b/internal/service/s3/bucket_object.go @@ -28,9 +28,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -207,7 +207,7 @@ func resourceBucketObjectRead(ctx context.Context, d *schema.ResourceData, meta key := sdkv1CompatibleCleanKey(d.Get(names.AttrKey).(string)) output, err := findObjectByBucketAndKey(ctx, conn, bucket, key, "", "") - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Object (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_object_lock_configuration.go b/internal/service/s3/bucket_object_lock_configuration.go index 6d4a8d61f88..b62e0fb235e 100644 --- a/internal/service/s3/bucket_object_lock_configuration.go +++ b/internal/service/s3/bucket_object_lock_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -168,7 +169,7 @@ func resourceBucketObjectLockConfigurationRead(ctx context.Context, d *schema.Re objLockConfig, err := findObjectLockConfiguration(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Object Lock Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_object_lock_configuration_test.go b/internal/service/s3/bucket_object_lock_configuration_test.go index 07b471783f8..1a63fddad2e 100644 --- a/internal/service/s3/bucket_object_lock_configuration_test.go +++ b/internal/service/s3/bucket_object_lock_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -250,7 +250,7 @@ func testAccCheckBucketObjectLockConfigurationDestroy(ctx context.Context) resou _, err = tfs3.FindObjectLockConfiguration(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/s3/bucket_object_test.go b/internal/service/s3/bucket_object_test.go index 6187686c10f..c2dcaaba922 100644 --- a/internal/service/s3/bucket_object_test.go +++ b/internal/service/s3/bucket_object_test.go @@ -25,8 +25,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1303,7 +1303,7 @@ func testAccCheckBucketObjectDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfs3.FindObjectByBucketAndKey(ctx, conn, rs.Primary.Attributes[names.AttrBucket], tfs3.SDKv1CompatibleCleanKey(rs.Primary.Attributes[names.AttrKey]), rs.Primary.Attributes["etag"], rs.Primary.Attributes["checksum_algorithm"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_ownership_controls.go b/internal/service/s3/bucket_ownership_controls.go index 860eac67504..665d702b194 100644 --- a/internal/service/s3/bucket_ownership_controls.go +++ b/internal/service/s3/bucket_ownership_controls.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +109,7 @@ func resourceBucketOwnershipControlsRead(ctx context.Context, d *schema.Resource oc, err := findOwnershipControls(ctx, conn, bucket) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Ownership Controls (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_ownership_controls_test.go b/internal/service/s3/bucket_ownership_controls_test.go index 50c1dc57097..454e2211745 100644 --- a/internal/service/s3/bucket_ownership_controls_test.go +++ b/internal/service/s3/bucket_ownership_controls_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckBucketOwnershipControlsDestroy(ctx context.Context) resource.Te _, err := tfs3.FindOwnershipControls(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_policy.go b/internal/service/s3/bucket_policy.go index 573fca262c6..3e1cc9c3f4e 100644 --- a/internal/service/s3/bucket_policy.go +++ b/internal/service/s3/bucket_policy.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -95,7 +96,7 @@ func resourceBucketPolicyRead(ctx context.Context, d *schema.ResourceData, meta policy, err := findBucketPolicy(ctx, conn, bucket) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_policy_test.go b/internal/service/s3/bucket_policy_test.go index 768525f66c9..8282934a2b8 100644 --- a/internal/service/s3/bucket_policy_test.go +++ b/internal/service/s3/bucket_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -481,7 +481,7 @@ func testAccCheckBucketPolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfs3.FindBucketPolicy(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_public_access_block.go b/internal/service/s3/bucket_public_access_block.go index 7e2fc783a81..fab8e3ef02d 100644 --- a/internal/service/s3/bucket_public_access_block.go +++ b/internal/service/s3/bucket_public_access_block.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +120,7 @@ func resourceBucketPublicAccessBlockRead(ctx context.Context, d *schema.Resource pabc, err := findPublicAccessBlockConfiguration(ctx, conn, bucket) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Public Access Block (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_public_access_block_test.go b/internal/service/s3/bucket_public_access_block_test.go index 19549b95e14..56f1d1eb904 100644 --- a/internal/service/s3/bucket_public_access_block_test.go +++ b/internal/service/s3/bucket_public_access_block_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -349,7 +349,7 @@ func testAccCheckBucketPublicAccessBlockDestroy(ctx context.Context) resource.Te _, err := tfs3.FindPublicAccessBlockConfiguration(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_replication_configuration.go b/internal/service/s3/bucket_replication_configuration.go index e1a3e40ce5b..c47513856a4 100644 --- a/internal/service/s3/bucket_replication_configuration.go +++ b/internal/service/s3/bucket_replication_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -382,7 +383,7 @@ func resourceBucketReplicationConfigurationRead(ctx context.Context, d *schema.R rc, err := findReplicationConfiguration(ctx, conn, bucket) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Replication Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_replication_configuration_test.go b/internal/service/s3/bucket_replication_configuration_test.go index 9d4392cda78..5058d130b95 100644 --- a/internal/service/s3/bucket_replication_configuration_test.go +++ b/internal/service/s3/bucket_replication_configuration_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1181,7 +1181,7 @@ func testAccCheckBucketReplicationConfigurationDestroy(ctx context.Context) reso _, err := tfs3.FindReplicationConfiguration(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1211,7 +1211,7 @@ func testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx context.C _, err := tfs3.FindReplicationConfiguration(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } @@ -1243,7 +1243,7 @@ func testAccCheckBucketReplicationConfigurationDestroyWithRegion(ctx context.Con _, err := tfs3.FindReplicationConfiguration(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_request_payment_configuration.go b/internal/service/s3/bucket_request_payment_configuration.go index 0cd89b4af6d..ae70f8720a6 100644 --- a/internal/service/s3/bucket_request_payment_configuration.go +++ b/internal/service/s3/bucket_request_payment_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -116,7 +117,7 @@ func resourceBucketRequestPaymentConfigurationRead(ctx context.Context, d *schem output, err := findBucketRequestPayment(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Request Payment Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_request_payment_configuration_test.go b/internal/service/s3/bucket_request_payment_configuration_test.go index 13942725b24..0d9e5ca0acc 100644 --- a/internal/service/s3/bucket_request_payment_configuration_test.go +++ b/internal/service/s3/bucket_request_payment_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -215,7 +215,7 @@ func testAccCheckBucketRequestPaymentConfigurationDestroy(ctx context.Context) r _, err = tfs3.FindBucketRequestPayment(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_server_side_encryption_configuration.go b/internal/service/s3/bucket_server_side_encryption_configuration.go index fe00bbc28e2..5660ae75ab1 100644 --- a/internal/service/s3/bucket_server_side_encryption_configuration.go +++ b/internal/service/s3/bucket_server_side_encryption_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -148,7 +149,7 @@ func resourceBucketServerSideEncryptionConfigurationRead(ctx context.Context, d sse, err := findServerSideEncryptionConfiguration(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Server-side Encryption Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_versioning.go b/internal/service/s3/bucket_versioning.go index 837f65ee9c0..f6f41c060f5 100644 --- a/internal/service/s3/bucket_versioning.go +++ b/internal/service/s3/bucket_versioning.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -166,7 +167,7 @@ func resourceBucketVersioningRead(ctx context.Context, d *schema.ResourceData, m output, err := waitForBucketVersioningStatus(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Versioning (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -343,7 +344,7 @@ func statusBucketVersioning(ctx context.Context, conn *s3.Client, bucket, expect return func() (any, string, error) { output, err := findBucketVersioning(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/s3/bucket_versioning_test.go b/internal/service/s3/bucket_versioning_test.go index 455d6549a75..74a190f1e90 100644 --- a/internal/service/s3/bucket_versioning_test.go +++ b/internal/service/s3/bucket_versioning_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -521,7 +521,7 @@ func testAccCheckBucketVersioningDestroy(ctx context.Context) resource.TestCheck _, err = tfs3.FindBucketVersioning(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/bucket_website_configuration.go b/internal/service/s3/bucket_website_configuration.go index c85d58d9e5a..213f60e59e4 100644 --- a/internal/service/s3/bucket_website_configuration.go +++ b/internal/service/s3/bucket_website_configuration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -263,7 +264,7 @@ func resourceBucketWebsiteConfigurationRead(ctx context.Context, d *schema.Resou output, err := findBucketWebsite(ctx, conn, bucket, expectedBucketOwner) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Bucket Website Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/bucket_website_configuration_test.go b/internal/service/s3/bucket_website_configuration_test.go index 46068b74eee..bd9f57416e5 100644 --- a/internal/service/s3/bucket_website_configuration_test.go +++ b/internal/service/s3/bucket_website_configuration_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -576,7 +576,7 @@ func testAccCheckBucketWebsiteConfigurationDestroy(ctx context.Context) resource _, err = tfs3.FindBucketWebsite(ctx, conn, bucket, expectedBucketOwner) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/directory_bucket.go b/internal/service/s3/directory_bucket.go index 211e38f0873..b96bd6263e8 100644 --- a/internal/service/s3/directory_bucket.go +++ b/internal/service/s3/directory_bucket.go @@ -27,8 +27,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func (r *directoryBucketResource) Read(ctx context.Context, request resource.Rea // Disable S3 Expression session authentication for HeadBucket. output, err := findBucket(ctx, conn, bucket, func(o *s3.Options) { o.DisableS3ExpressSessionAuth = aws.Bool(true) }) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3/directory_bucket_test.go b/internal/service/s3/directory_bucket_test.go index fc24fea4bfa..96352ebc100 100644 --- a/internal/service/s3/directory_bucket_test.go +++ b/internal/service/s3/directory_bucket_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -248,7 +248,7 @@ func testAccCheckDirectoryBucketDestroy(ctx context.Context) resource.TestCheckF _, err := tfs3.FindBucket(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/object.go b/internal/service/s3/object.go index 09db377a928..83aab884fa9 100644 --- a/internal/service/s3/object.go +++ b/internal/service/s3/object.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -275,7 +276,7 @@ func resourceObjectRead(ctx context.Context, d *schema.ResourceData, meta any) d key := sdkv1CompatibleCleanKey(d.Get(names.AttrKey).(string)) output, err := findObjectByBucketAndKey(ctx, conn, bucket, key, "", d.Get("checksum_algorithm").(string), optFns...) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Object (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/object_copy.go b/internal/service/s3/object_copy.go index f181ddd859f..a431a855a57 100644 --- a/internal/service/s3/object_copy.go +++ b/internal/service/s3/object_copy.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -385,7 +385,7 @@ func resourceObjectCopyRead(ctx context.Context, d *schema.ResourceData, meta an key := sdkv1CompatibleCleanKey(d.Get(names.AttrKey).(string)) output, err := findObjectByBucketAndKey(ctx, conn, bucket, key, "", d.Get("checksum_algorithm").(string), optFns...) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Object (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3/object_copy_test.go b/internal/service/s3/object_copy_test.go index 9b888c72244..482b385b147 100644 --- a/internal/service/s3/object_copy_test.go +++ b/internal/service/s3/object_copy_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -708,7 +708,7 @@ func testAccCheckObjectCopyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfs3.FindObjectByBucketAndKey(ctx, conn, rs.Primary.Attributes[names.AttrBucket], tfs3.SDKv1CompatibleCleanKey(rs.Primary.Attributes[names.AttrKey]), rs.Primary.Attributes["etag"], "", optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/object_test.go b/internal/service/s3/object_test.go index be1dab8b32c..dce6f64000b 100644 --- a/internal/service/s3/object_test.go +++ b/internal/service/s3/object_test.go @@ -33,9 +33,9 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2221,7 +2221,7 @@ func testAccCheckObjectDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfs3.FindObjectByBucketAndKey(ctx, conn, rs.Primary.Attributes[names.AttrBucket], tfs3.SDKv1CompatibleCleanKey(rs.Primary.Attributes[names.AttrKey]), rs.Primary.Attributes["etag"], rs.Primary.Attributes["checksum_algorithm"], optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3/sweep.go b/internal/service/s3/sweep.go index be25ff27f13..22953e622d1 100644 --- a/internal/service/s3/sweep.go +++ b/internal/service/s3/sweep.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2" "github.com/hashicorp/terraform-provider-aws/internal/sweep/framework" @@ -74,7 +75,7 @@ func sweepGeneralPurposeBucketObjects(ctx context.Context, client *conns.AWSClie var objectLockEnabled bool objLockConfig, err := findObjectLockConfiguration(ctx, conn, bucketName, "") - if !tfresource.NotFound(err) { + if !retry.NotFound(err) { if err != nil { tflog.Warn(ctx, "Reading S3 Bucket Object Lock Configuration", map[string]any{ "error": err.Error(), From ec3d9d7c0d85c6762d423f1a226db5050899212a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:43 -0800 Subject: [PATCH 177/227] `s3control` --- internal/service/s3control/access_grant.go | 3 ++- internal/service/s3control/access_grant_test.go | 4 ++-- internal/service/s3control/access_grants_instance.go | 3 ++- .../s3control/access_grants_instance_resource_policy.go | 3 ++- .../s3control/access_grants_instance_resource_policy_test.go | 4 ++-- internal/service/s3control/access_grants_instance_test.go | 4 ++-- internal/service/s3control/access_grants_location.go | 3 ++- internal/service/s3control/access_grants_location_test.go | 4 ++-- internal/service/s3control/access_point.go | 5 +++-- internal/service/s3control/access_point_policy.go | 3 ++- internal/service/s3control/access_point_policy_test.go | 4 ++-- internal/service/s3control/access_point_test.go | 4 ++-- internal/service/s3control/account_public_access_block.go | 5 +++-- .../service/s3control/account_public_access_block_test.go | 4 ++-- internal/service/s3control/bucket.go | 3 ++- internal/service/s3control/bucket_lifecycle_configuration.go | 3 ++- .../service/s3control/bucket_lifecycle_configuration_test.go | 4 ++-- internal/service/s3control/bucket_policy.go | 3 ++- internal/service/s3control/bucket_policy_test.go | 4 ++-- internal/service/s3control/bucket_test.go | 4 ++-- .../service/s3control/directory_bucket_access_point_scope.go | 3 ++- .../s3control/directory_bucket_access_point_scope_test.go | 4 ++-- internal/service/s3control/multi_region_access_point.go | 5 +++-- .../service/s3control/multi_region_access_point_policy.go | 3 ++- internal/service/s3control/multi_region_access_point_test.go | 4 ++-- internal/service/s3control/object_lambda_access_point.go | 3 ++- .../service/s3control/object_lambda_access_point_policy.go | 3 ++- .../s3control/object_lambda_access_point_policy_test.go | 4 ++-- .../service/s3control/object_lambda_access_point_test.go | 4 ++-- internal/service/s3control/storage_lens_configuration.go | 3 ++- .../service/s3control/storage_lens_configuration_test.go | 4 ++-- 31 files changed, 65 insertions(+), 49 deletions(-) diff --git a/internal/service/s3control/access_grant.go b/internal/service/s3control/access_grant.go index 81f778399ee..6bf5a5045fc 100644 --- a/internal/service/s3control/access_grant.go +++ b/internal/service/s3control/access_grant.go @@ -27,6 +27,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -216,7 +217,7 @@ func (r *accessGrantResource) Read(ctx context.Context, request resource.ReadReq output, err := findAccessGrantByTwoPartKey(ctx, conn, data.AccountID.ValueString(), data.AccessGrantID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3control/access_grant_test.go b/internal/service/s3control/access_grant_test.go index 8474999fdf3..4049eece8c5 100644 --- a/internal/service/s3control/access_grant_test.go +++ b/internal/service/s3control/access_grant_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +162,7 @@ func testAccCheckAccessGrantDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfs3control.FindAccessGrantByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAccountID], rs.Primary.Attributes["access_grant_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/access_grants_instance.go b/internal/service/s3control/access_grants_instance.go index 5b7a432ce1f..f6720891491 100644 --- a/internal/service/s3control/access_grants_instance.go +++ b/internal/service/s3control/access_grants_instance.go @@ -23,6 +23,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -136,7 +137,7 @@ func (r *accessGrantsInstanceResource) Read(ctx context.Context, request resourc accountID := fwflex.StringValueFromFramework(ctx, data.AccountID) output, err := findAccessGrantsInstanceByID(ctx, conn, accountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3control/access_grants_instance_resource_policy.go b/internal/service/s3control/access_grants_instance_resource_policy.go index 4f1ed65846e..5811b241380 100644 --- a/internal/service/s3control/access_grants_instance_resource_policy.go +++ b/internal/service/s3control/access_grants_instance_resource_policy.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +114,7 @@ func (r *accessGrantsInstanceResourcePolicyResource) Read(ctx context.Context, r output, err := findAccessGrantsInstanceResourcePolicy(ctx, conn, data.AccountID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3control/access_grants_instance_resource_policy_test.go b/internal/service/s3control/access_grants_instance_resource_policy_test.go index bfd9da857f0..e3b811a39c5 100644 --- a/internal/service/s3control/access_grants_instance_resource_policy_test.go +++ b/internal/service/s3control/access_grants_instance_resource_policy_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +78,7 @@ func testAccCheckAccessGrantsInstanceResourcePolicyDestroy(ctx context.Context) _, err := tfs3control.FindAccessGrantsInstanceResourcePolicy(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/access_grants_instance_test.go b/internal/service/s3control/access_grants_instance_test.go index c6aeec7441a..617fdca48f2 100644 --- a/internal/service/s3control/access_grants_instance_test.go +++ b/internal/service/s3control/access_grants_instance_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func testAccCheckAccessGrantsInstanceDestroy(ctx context.Context) resource.TestC _, err := tfs3control.FindAccessGrantsInstanceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/access_grants_location.go b/internal/service/s3control/access_grants_location.go index 5fb17ea0857..11cf5a8a318 100644 --- a/internal/service/s3control/access_grants_location.go +++ b/internal/service/s3control/access_grants_location.go @@ -24,6 +24,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -148,7 +149,7 @@ func (r *accessGrantsLocationResource) Read(ctx context.Context, request resourc output, err := findAccessGrantsLocationByTwoPartKey(ctx, conn, data.AccountID.ValueString(), data.AccessGrantsLocationID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3control/access_grants_location_test.go b/internal/service/s3control/access_grants_location_test.go index 596db14291a..8a915983f8b 100644 --- a/internal/service/s3control/access_grants_location_test.go +++ b/internal/service/s3control/access_grants_location_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -164,7 +164,7 @@ func testAccCheckAccessGrantsLocationDestroy(ctx context.Context) resource.TestC _, err := tfs3control.FindAccessGrantsLocationByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAccountID], rs.Primary.Attributes["access_grants_location_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/access_point.go b/internal/service/s3control/access_point.go index 4659ebf66c2..948dea74470 100644 --- a/internal/service/s3control/access_point.go +++ b/internal/service/s3control/access_point.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -233,7 +234,7 @@ func resourceAccessPointRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findAccessPointByTwoPartKey(ctx, conn, accountID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Access Point (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -323,7 +324,7 @@ func resourceAccessPointRead(ctx context.Context, d *schema.ResourceData, meta a } d.Set(names.AttrPolicy, policyToSet) - } else if policy == "" || tfresource.NotFound(err) { + } else if policy == "" || retry.NotFound(err) { d.Set("has_public_access_policy", false) d.Set(names.AttrPolicy, nil) } else { diff --git a/internal/service/s3control/access_point_policy.go b/internal/service/s3control/access_point_policy.go index f8bf3f9a2a7..077c22c5eff 100644 --- a/internal/service/s3control/access_point_policy.go +++ b/internal/service/s3control/access_point_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -98,7 +99,7 @@ func resourceAccessPointPolicyRead(ctx context.Context, d *schema.ResourceData, policy, status, err := findAccessPointPolicyAndStatusByTwoPartKey(ctx, conn, accountID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Access Point Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/access_point_policy_test.go b/internal/service/s3control/access_point_policy_test.go index 5c48bebc807..b477d780494 100644 --- a/internal/service/s3control/access_point_policy_test.go +++ b/internal/service/s3control/access_point_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -148,7 +148,7 @@ func testAccCheckAccessPointPolicyDestroy(ctx context.Context) resource.TestChec _, _, err = tfs3control.FindAccessPointPolicyAndStatusByTwoPartKey(ctx, conn, accountID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/access_point_test.go b/internal/service/s3control/access_point_test.go index da686675e29..aa8f5161814 100644 --- a/internal/service/s3control/access_point_test.go +++ b/internal/service/s3control/access_point_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -499,7 +499,7 @@ func testAccCheckAccessPointDestroy(ctx context.Context) resource.TestCheckFunc _, err = tfs3control.FindAccessPointByTwoPartKey(ctx, conn, accountID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/account_public_access_block.go b/internal/service/s3control/account_public_access_block.go index f27360f2cb1..38bd5320003 100644 --- a/internal/service/s3control/account_public_access_block.go +++ b/internal/service/s3control/account_public_access_block.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourceAccountPublicAccessBlockRead(ctx context.Context, d *schema.Resourc output, err := findPublicAccessBlockByAccountID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Account Public Access Block (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -217,7 +218,7 @@ func statusPublicAccessBlockEqual(ctx context.Context, conn *s3control.Client, a return func() (any, string, error) { output, err := findPublicAccessBlockByAccountID(ctx, conn, accountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/s3control/account_public_access_block_test.go b/internal/service/s3control/account_public_access_block_test.go index 6de95c4c514..892df63b1e1 100644 --- a/internal/service/s3control/account_public_access_block_test.go +++ b/internal/service/s3control/account_public_access_block_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -320,7 +320,7 @@ func testAccCheckAccountPublicAccessBlockDestroy(ctx context.Context) resource.T _, err := tfs3control.FindPublicAccessBlockByAccountID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/bucket.go b/internal/service/s3control/bucket.go index eda7ac069bc..3886e4dd8ed 100644 --- a/internal/service/s3control/bucket.go +++ b/internal/service/s3control/bucket.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -122,7 +123,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findBucketByTwoPartKey(ctx, conn, parsedArn.AccountID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Control Bucket (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/bucket_lifecycle_configuration.go b/internal/service/s3control/bucket_lifecycle_configuration.go index b0c862985d1..b7a81820b92 100644 --- a/internal/service/s3control/bucket_lifecycle_configuration.go +++ b/internal/service/s3control/bucket_lifecycle_configuration.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -178,7 +179,7 @@ func resourceBucketLifecycleConfigurationRead(ctx context.Context, d *schema.Res output, err := findBucketLifecycleConfigurationByTwoPartKey(ctx, conn, parsedArn.AccountID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Control Bucket Lifecycle Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/bucket_lifecycle_configuration_test.go b/internal/service/s3control/bucket_lifecycle_configuration_test.go index 94ca87b057b..ddb3c53108e 100644 --- a/internal/service/s3control/bucket_lifecycle_configuration_test.go +++ b/internal/service/s3control/bucket_lifecycle_configuration_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -447,7 +447,7 @@ func testAccCheckBucketLifecycleConfigurationDestroy(ctx context.Context) resour _, err = tfs3control.FindBucketLifecycleConfigurationByTwoPartKey(ctx, conn, parsedArn.AccountID, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/bucket_policy.go b/internal/service/s3control/bucket_policy.go index 28725e4b09d..21df3067601 100644 --- a/internal/service/s3control/bucket_policy.go +++ b/internal/service/s3control/bucket_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -99,7 +100,7 @@ func resourceBucketPolicyRead(ctx context.Context, d *schema.ResourceData, meta output, err := findBucketPolicyByTwoPartKey(ctx, conn, parsedArn.AccountID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Control Bucket Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/bucket_policy_test.go b/internal/service/s3control/bucket_policy_test.go index 24019b724b5..730dafc24a0 100644 --- a/internal/service/s3control/bucket_policy_test.go +++ b/internal/service/s3control/bucket_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -121,7 +121,7 @@ func testAccCheckBucketPolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err = tfs3control.FindBucketPolicyByTwoPartKey(ctx, conn, parsedArn.AccountID, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/bucket_test.go b/internal/service/s3control/bucket_test.go index 6ba054a4c37..71326548f68 100644 --- a/internal/service/s3control/bucket_test.go +++ b/internal/service/s3control/bucket_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func testAccCheckBucketDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tfs3control.FindBucketByTwoPartKey(ctx, conn, parsedArn.AccountID, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/directory_bucket_access_point_scope.go b/internal/service/s3control/directory_bucket_access_point_scope.go index 32e87885403..3122779e422 100644 --- a/internal/service/s3control/directory_bucket_access_point_scope.go +++ b/internal/service/s3control/directory_bucket_access_point_scope.go @@ -29,6 +29,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +139,7 @@ func (r *directoryBucketAccessPointScopeResource) Read(ctx context.Context, requ id, _ := data.setID() output, err := findDirectoryAccessPointScopeByTwoPartKey(ctx, conn, data.AccountID.ValueString(), data.Name.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3control/directory_bucket_access_point_scope_test.go b/internal/service/s3control/directory_bucket_access_point_scope_test.go index 877edec938b..85170a8ab77 100644 --- a/internal/service/s3control/directory_bucket_access_point_scope_test.go +++ b/internal/service/s3control/directory_bucket_access_point_scope_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -172,7 +172,7 @@ func testAccCheckDirectoryBucketAccessPointScopeDestroy(ctx context.Context) res _, err := tfs3control.FindDirectoryAccessPointScopeByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrAccountID], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/multi_region_access_point.go b/internal/service/s3control/multi_region_access_point.go index a11a28ca8bd..29bac84a213 100644 --- a/internal/service/s3control/multi_region_access_point.go +++ b/internal/service/s3control/multi_region_access_point.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -199,7 +200,7 @@ func resourceMultiRegionAccessPointRead(ctx context.Context, d *schema.ResourceD accessPoint, err := findMultiRegionAccessPointByTwoPartKey(ctx, conn, accountID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Multi-Region Access Point (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -328,7 +329,7 @@ func statusMultiRegionAccessPointRequest(ctx context.Context, conn *s3control.Cl return func() (any, string, error) { output, err := findMultiRegionAccessPointOperationByTwoPartKey(ctx, conn, accountID, requestTokenARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/s3control/multi_region_access_point_policy.go b/internal/service/s3control/multi_region_access_point_policy.go index 766a3e6da88..609d062d35c 100644 --- a/internal/service/s3control/multi_region_access_point_policy.go +++ b/internal/service/s3control/multi_region_access_point_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -136,7 +137,7 @@ func resourceMultiRegionAccessPointPolicyRead(ctx context.Context, d *schema.Res policyDocument, err := findMultiRegionAccessPointPolicyDocumentByTwoPartKey(ctx, conn, accountID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Multi-Region Access Point Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/multi_region_access_point_test.go b/internal/service/s3control/multi_region_access_point_test.go index 05a1060c9ba..1c5dab28f59 100644 --- a/internal/service/s3control/multi_region_access_point_test.go +++ b/internal/service/s3control/multi_region_access_point_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -248,7 +248,7 @@ func testAccCheckMultiRegionAccessPointDestroy(ctx context.Context) resource.Tes _, err = tfs3control.FindMultiRegionAccessPointByTwoPartKey(ctx, conn, accountID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/object_lambda_access_point.go b/internal/service/s3control/object_lambda_access_point.go index 514edaf408a..c111a91a368 100644 --- a/internal/service/s3control/object_lambda_access_point.go +++ b/internal/service/s3control/object_lambda_access_point.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -174,7 +175,7 @@ func resourceObjectLambdaAccessPointRead(ctx context.Context, d *schema.Resource outputConfiguration, err := findObjectLambdaAccessPointConfigurationByTwoPartKey(ctx, conn, accountID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Object Lambda Access Point (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/object_lambda_access_point_policy.go b/internal/service/s3control/object_lambda_access_point_policy.go index 21e0ef3858a..5e9eb35f255 100644 --- a/internal/service/s3control/object_lambda_access_point_policy.go +++ b/internal/service/s3control/object_lambda_access_point_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -109,7 +110,7 @@ func resourceObjectLambdaAccessPointPolicyRead(ctx context.Context, d *schema.Re policy, status, err := findObjectLambdaAccessPointPolicyAndStatusByTwoPartKey(ctx, conn, accountID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Object Lambda Access Point Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/object_lambda_access_point_policy_test.go b/internal/service/s3control/object_lambda_access_point_policy_test.go index 6f53664f8ee..2f9bb30a293 100644 --- a/internal/service/s3control/object_lambda_access_point_policy_test.go +++ b/internal/service/s3control/object_lambda_access_point_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -151,7 +151,7 @@ func testAccCheckObjectLambdaAccessPointPolicyDestroy(ctx context.Context) resou _, _, err = tfs3control.FindObjectLambdaAccessPointPolicyAndStatusByTwoPartKey(ctx, conn, accountID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/object_lambda_access_point_test.go b/internal/service/s3control/object_lambda_access_point_test.go index 4bc38f580dc..000f94ecd5c 100644 --- a/internal/service/s3control/object_lambda_access_point_test.go +++ b/internal/service/s3control/object_lambda_access_point_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -172,7 +172,7 @@ func testAccCheckObjectLambdaAccessPointDestroy(ctx context.Context) resource.Te _, err = tfs3control.FindObjectLambdaAccessPointConfigurationByTwoPartKey(ctx, conn, accountID, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3control/storage_lens_configuration.go b/internal/service/s3control/storage_lens_configuration.go index eaeeff0c7c4..e43f66f26f9 100644 --- a/internal/service/s3control/storage_lens_configuration.go +++ b/internal/service/s3control/storage_lens_configuration.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -435,7 +436,7 @@ func resourceStorageLensConfigurationRead(ctx context.Context, d *schema.Resourc output, err := findStorageLensConfigurationByAccountIDAndConfigID(ctx, conn, accountID, configID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] S3 Storage Lens Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/s3control/storage_lens_configuration_test.go b/internal/service/s3control/storage_lens_configuration_test.go index fee3df78070..fb5994ff9bb 100644 --- a/internal/service/s3control/storage_lens_configuration_test.go +++ b/internal/service/s3control/storage_lens_configuration_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -340,7 +340,7 @@ func testAccCheckStorageLensConfigurationDestroy(ctx context.Context) resource.T _, err = tfs3control.FindStorageLensConfigurationByAccountIDAndConfigID(ctx, conn, accountID, configID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From ae333db342aa14e188a52a0e059c4a84df6e7db2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:46 -0800 Subject: [PATCH 178/227] `s3outposts` --- internal/service/s3outposts/endpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/s3outposts/endpoint.go b/internal/service/s3outposts/endpoint.go index 4635ac2a78e..bac73d00c24 100644 --- a/internal/service/s3outposts/endpoint.go +++ b/internal/service/s3outposts/endpoint.go @@ -254,7 +254,7 @@ func statusEndpoint(conn *s3outposts.Client, arn string) retry.StateRefreshFunc return func(ctx context.Context) (any, string, error) { output, err := findEndpointByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 28522686a3fa886561beb6608e5b92f320c9e193 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:47 -0800 Subject: [PATCH 179/227] `s3tables` --- internal/service/s3tables/namespace.go | 3 ++- internal/service/s3tables/namespace_test.go | 4 ++-- internal/service/s3tables/table.go | 13 +++++++------ internal/service/s3tables/table_bucket.go | 13 +++++++------ internal/service/s3tables/table_bucket_policy.go | 3 ++- .../service/s3tables/table_bucket_policy_test.go | 4 ++-- internal/service/s3tables/table_bucket_test.go | 4 ++-- internal/service/s3tables/table_policy.go | 3 ++- internal/service/s3tables/table_policy_test.go | 4 ++-- internal/service/s3tables/table_test.go | 4 ++-- 10 files changed, 30 insertions(+), 25 deletions(-) diff --git a/internal/service/s3tables/namespace.go b/internal/service/s3tables/namespace.go index ccfa6b773dd..5eebbbe7ebd 100644 --- a/internal/service/s3tables/namespace.go +++ b/internal/service/s3tables/namespace.go @@ -30,6 +30,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" tfstringvalidator "github.com/hashicorp/terraform-provider-aws/internal/framework/validators/stringvalidator" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +136,7 @@ func (r *namespaceResource) Read(ctx context.Context, request resource.ReadReque namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Namespace), fwflex.StringValueFromFramework(ctx, data.TableBucketARN) output, err := findNamespaceByTwoPartKey(ctx, conn, tableBucketARN, namespace) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3tables/namespace_test.go b/internal/service/s3tables/namespace_test.go index b8d9abb6fc3..f8073f82338 100644 --- a/internal/service/s3tables/namespace_test.go +++ b/internal/service/s3tables/namespace_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +103,7 @@ func testAccCheckNamespaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfs3tables.FindNamespaceByTwoPartKey(ctx, conn, rs.Primary.Attributes["table_bucket_arn"], rs.Primary.Attributes[names.AttrNamespace]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3tables/table.go b/internal/service/s3tables/table.go index 33d6843a730..f722eae3f24 100644 --- a/internal/service/s3tables/table.go +++ b/internal/service/s3tables/table.go @@ -37,6 +37,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" tfstringvalidator "github.com/hashicorp/terraform-provider-aws/internal/framework/validators/stringvalidator" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -356,7 +357,7 @@ func (r *tableResource) Create(ctx context.Context, request resource.CreateReque outputGTMC, err := findTableMaintenanceConfigurationByThreePartKey(ctx, conn, tableBucketARN, namespace, name) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) maintenance configuration", name), err.Error()) @@ -373,7 +374,7 @@ func (r *tableResource) Create(ctx context.Context, request resource.CreateReque awsEncryptionConfig, err := findTableEncryptionByThreePartKey(ctx, conn, tableBucketARN, namespace, name) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) encryption", name), err.Error()) @@ -407,7 +408,7 @@ func (r *tableResource) Read(ctx context.Context, request resource.ReadRequest, name, namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Name), fwflex.StringValueFromFramework(ctx, data.Namespace), fwflex.StringValueFromFramework(ctx, data.TableBucketARN) outputGT, err := findTableByThreePartKey(ctx, conn, tableBucketARN, namespace, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -429,7 +430,7 @@ func (r *tableResource) Read(ctx context.Context, request resource.ReadRequest, outputGTMC, err := findTableMaintenanceConfigurationByThreePartKey(ctx, conn, tableBucketARN, namespace, name) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) maintenance configuration", name), err.Error()) @@ -446,7 +447,7 @@ func (r *tableResource) Read(ctx context.Context, request resource.ReadRequest, awsEncryptionConfig, err := findTableEncryptionByThreePartKey(ctx, conn, tableBucketARN, namespace, name) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) encryption", name), err.Error()) @@ -589,7 +590,7 @@ func (r *tableResource) Update(ctx context.Context, request resource.UpdateReque outputGTMC, err := findTableMaintenanceConfigurationByThreePartKey(ctx, conn, tableBucketARN, namespace, name) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table (%s) maintenance configuration", name), err.Error()) diff --git a/internal/service/s3tables/table_bucket.go b/internal/service/s3tables/table_bucket.go index 75d70d6010a..a3b105fde38 100644 --- a/internal/service/s3tables/table_bucket.go +++ b/internal/service/s3tables/table_bucket.go @@ -30,6 +30,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" tfstringvalidator "github.com/hashicorp/terraform-provider-aws/internal/framework/validators/stringvalidator" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -196,7 +197,7 @@ func (r *tableBucketResource) Create(ctx context.Context, request resource.Creat outputGTBMC, err := findTableBucketMaintenanceConfigurationByARN(ctx, conn, tableBucketARN) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table Bucket (%s) maintenance configuration", name), err.Error()) @@ -213,7 +214,7 @@ func (r *tableBucketResource) Create(ctx context.Context, request resource.Creat awsEncryptionConfig, err := findTableBucketEncryptionConfigurationByARN(ctx, conn, tableBucketARN) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table Bucket (%s) encryption", name), err.Error()) @@ -247,7 +248,7 @@ func (r *tableBucketResource) Read(ctx context.Context, request resource.ReadReq name, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Name), fwflex.StringValueFromFramework(ctx, data.ARN) outputGTB, err := findTableBucketByARN(ctx, conn, tableBucketARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -268,7 +269,7 @@ func (r *tableBucketResource) Read(ctx context.Context, request resource.ReadReq outputGTBMC, err := findTableBucketMaintenanceConfigurationByARN(ctx, conn, tableBucketARN) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table Bucket (%s) maintenance configuration", name), err.Error()) @@ -285,7 +286,7 @@ func (r *tableBucketResource) Read(ctx context.Context, request resource.ReadReq awsEncryptionConfig, err := findTableBucketEncryptionConfigurationByARN(ctx, conn, tableBucketARN) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table Bucket (%s) encryption", name), err.Error()) @@ -382,7 +383,7 @@ func (r *tableBucketResource) Update(ctx context.Context, request resource.Updat outputGTBMC, err := findTableBucketMaintenanceConfigurationByARN(ctx, conn, tableBucketARN) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: response.Diagnostics.AddError(fmt.Sprintf("reading S3 Tables Table Bucket (%s) maintenance configuration", name), err.Error()) diff --git a/internal/service/s3tables/table_bucket_policy.go b/internal/service/s3tables/table_bucket_policy.go index 25c81cad1b4..c755162e3c3 100644 --- a/internal/service/s3tables/table_bucket_policy.go +++ b/internal/service/s3tables/table_bucket_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -95,7 +96,7 @@ func (r *tableBucketPolicyResource) Read(ctx context.Context, request resource.R tableBucketARN := fwflex.StringValueFromFramework(ctx, data.TableBucketARN) output, err := findTableBucketPolicyByARN(ctx, conn, tableBucketARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3tables/table_bucket_policy_test.go b/internal/service/s3tables/table_bucket_policy_test.go index 82b0b4424cf..c3bddcbb050 100644 --- a/internal/service/s3tables/table_bucket_policy_test.go +++ b/internal/service/s3tables/table_bucket_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckTableBucketPolicyDestroy(ctx context.Context) resource.TestChec _, err := tfs3tables.FindTableBucketPolicyByARN(ctx, conn, rs.Primary.Attributes["table_bucket_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3tables/table_bucket_test.go b/internal/service/s3tables/table_bucket_test.go index 3a00dbec295..5867a8ba2d7 100644 --- a/internal/service/s3tables/table_bucket_test.go +++ b/internal/service/s3tables/table_bucket_test.go @@ -21,8 +21,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -378,7 +378,7 @@ func testAccCheckTableBucketDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfs3tables.FindTableBucketByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3tables/table_policy.go b/internal/service/s3tables/table_policy.go index aa8b8cd9f3a..b88b8fcae3e 100644 --- a/internal/service/s3tables/table_policy.go +++ b/internal/service/s3tables/table_policy.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +104,7 @@ func (r *tablePolicyResource) Read(ctx context.Context, request resource.ReadReq name, namespace, tableBucketARN := fwflex.StringValueFromFramework(ctx, data.Name), fwflex.StringValueFromFramework(ctx, data.Namespace), fwflex.StringValueFromFramework(ctx, data.TableBucketARN) output, err := findTablePolicyByThreePartKey(ctx, conn, tableBucketARN, namespace, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3tables/table_policy_test.go b/internal/service/s3tables/table_policy_test.go index 7e2c8827297..f0c951dc989 100644 --- a/internal/service/s3tables/table_policy_test.go +++ b/internal/service/s3tables/table_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +105,7 @@ func testAccCheckTablePolicyDestroy(ctx context.Context) resource.TestCheckFunc rs.Primary.Attributes[names.AttrName], ) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3tables/table_test.go b/internal/service/s3tables/table_test.go index 8186ca88463..70035a7237c 100644 --- a/internal/service/s3tables/table_test.go +++ b/internal/service/s3tables/table_test.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -605,7 +605,7 @@ func testAccCheckTableDestroy(ctx context.Context) resource.TestCheckFunc { rs.Primary.Attributes[names.AttrName], ) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 1d5f4763a2d91ecf5807da10eee2f38cb9e7817e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:48 -0800 Subject: [PATCH 180/227] `sagemaker` --- internal/service/sagemaker/app.go | 3 +- .../service/sagemaker/app_image_config.go | 3 +- .../sagemaker/app_image_config_test.go | 4 +-- internal/service/sagemaker/app_test.go | 4 +-- .../sagemaker/data_quality_job_definition.go | 3 +- .../data_quality_job_definition_test.go | 4 +-- internal/service/sagemaker/device.go | 3 +- internal/service/sagemaker/device_fleet.go | 3 +- .../service/sagemaker/device_fleet_test.go | 4 +-- internal/service/sagemaker/device_test.go | 4 +-- internal/service/sagemaker/domain.go | 3 +- internal/service/sagemaker/domain_test.go | 4 +-- internal/service/sagemaker/endpoint.go | 5 +-- .../sagemaker/endpoint_configuration.go | 3 +- .../sagemaker/endpoint_configuration_test.go | 4 +-- internal/service/sagemaker/endpoint_test.go | 4 +-- internal/service/sagemaker/feature_group.go | 3 +- .../service/sagemaker/feature_group_test.go | 4 +-- internal/service/sagemaker/flow_definition.go | 3 +- .../service/sagemaker/flow_definition_test.go | 4 +-- internal/service/sagemaker/hub.go | 3 +- internal/service/sagemaker/hub_test.go | 4 +-- internal/service/sagemaker/human_task_ui.go | 3 +- .../service/sagemaker/human_task_ui_test.go | 4 +-- internal/service/sagemaker/image.go | 3 +- internal/service/sagemaker/image_test.go | 4 +-- internal/service/sagemaker/image_version.go | 3 +- .../service/sagemaker/image_version_test.go | 4 +-- .../sagemaker/mlflow_tracking_server.go | 3 +- .../sagemaker/mlflow_tracking_server_test.go | 4 +-- internal/service/sagemaker/model.go | 3 +- .../service/sagemaker/model_package_group.go | 3 +- .../sagemaker/model_package_group_policy.go | 3 +- .../model_package_group_policy_test.go | 4 +-- .../sagemaker/model_package_group_test.go | 4 +-- internal/service/sagemaker/model_test.go | 4 +-- .../service/sagemaker/monitoring_schedule.go | 3 +- .../sagemaker/monitoring_schedule_test.go | 4 +-- .../service/sagemaker/notebook_instance.go | 7 ++-- ...tebook_instance_lifecycle_configuration.go | 3 +- ...k_instance_lifecycle_configuration_test.go | 4 +-- .../sagemaker/notebook_instance_test.go | 4 +-- internal/service/sagemaker/pipeline.go | 3 +- internal/service/sagemaker/pipeline_test.go | 4 +-- internal/service/sagemaker/project.go | 3 +- internal/service/sagemaker/project_test.go | 4 +-- internal/service/sagemaker/space.go | 3 +- internal/service/sagemaker/space_test.go | 4 +-- internal/service/sagemaker/status.go | 34 +++++++++---------- .../sagemaker/studio_lifecycle_config.go | 3 +- .../sagemaker/studio_lifecycle_config_test.go | 4 +-- internal/service/sagemaker/user_profile.go | 5 +-- .../service/sagemaker/user_profile_test.go | 4 +-- internal/service/sagemaker/workforce.go | 3 +- internal/service/sagemaker/workforce_test.go | 4 +-- internal/service/sagemaker/workteam.go | 3 +- internal/service/sagemaker/workteam_test.go | 4 +-- 57 files changed, 133 insertions(+), 105 deletions(-) diff --git a/internal/service/sagemaker/app.go b/internal/service/sagemaker/app.go index 417b3fde24a..9c4eb376a89 100644 --- a/internal/service/sagemaker/app.go +++ b/internal/service/sagemaker/app.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -175,7 +176,7 @@ func resourceAppRead(ctx context.Context, d *schema.ResourceData, meta any) diag app, err := findAppByName(ctx, conn, domainID, userProfileOrSpaceName, appType, appName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI App (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/app_image_config.go b/internal/service/sagemaker/app_image_config.go index 049271f8ddb..5e03b081f75 100644 --- a/internal/service/sagemaker/app_image_config.go +++ b/internal/service/sagemaker/app_image_config.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -300,7 +301,7 @@ func resourceAppImageConfigRead(ctx context.Context, d *schema.ResourceData, met image, err := findAppImageConfigByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI App Image Config (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/app_image_config_test.go b/internal/service/sagemaker/app_image_config_test.go index fe1fb17a719..36ad549ca64 100644 --- a/internal/service/sagemaker/app_image_config_test.go +++ b/internal/service/sagemaker/app_image_config_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -324,7 +324,7 @@ func testAccCheckAppImageConfigDestroy(ctx context.Context) resource.TestCheckFu _, err := tfsagemaker.FindAppImageConfigByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/app_test.go b/internal/service/sagemaker/app_test.go index 529b3cda421..aab450198e2 100644 --- a/internal/service/sagemaker/app_test.go +++ b/internal/service/sagemaker/app_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -304,7 +304,7 @@ func testAccCheckAppDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindAppByName(ctx, conn, domainID, userProfileOrSpaceName, appType, appName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/data_quality_job_definition.go b/internal/service/sagemaker/data_quality_job_definition.go index 8f05ee755fe..638b12a730b 100644 --- a/internal/service/sagemaker/data_quality_job_definition.go +++ b/internal/service/sagemaker/data_quality_job_definition.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -510,7 +511,7 @@ func resourceDataQualityJobDefinitionRead(ctx context.Context, d *schema.Resourc jobDefinition, err := findDataQualityJobDefinitionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Data Quality Job Definition (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/data_quality_job_definition_test.go b/internal/service/sagemaker/data_quality_job_definition_test.go index a423ba158de..3fed223bc68 100644 --- a/internal/service/sagemaker/data_quality_job_definition_test.go +++ b/internal/service/sagemaker/data_quality_job_definition_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -599,7 +599,7 @@ func testAccCheckDataQualityJobDefinitionDestroy(ctx context.Context) resource.T _, err := tfsagemaker.FindDataQualityJobDefinitionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/device.go b/internal/service/sagemaker/device.go index dc1aecd7525..fa4c2afe2b4 100644 --- a/internal/service/sagemaker/device.go +++ b/internal/service/sagemaker/device.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +112,7 @@ func resourceDeviceRead(ctx context.Context, d *schema.ResourceData, meta any) d return sdkdiag.AppendErrorf(diags, "reading SageMaker AI Device (%s): %s", d.Id(), err) } device, err := findDeviceByName(ctx, conn, deviceFleetName, deviceName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Unable to find SageMaker AI Device (%s); removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/device_fleet.go b/internal/service/sagemaker/device_fleet.go index 2693366c2d4..ee49722c8f1 100644 --- a/internal/service/sagemaker/device_fleet.go +++ b/internal/service/sagemaker/device_fleet.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -132,7 +133,7 @@ func resourceDeviceFleetRead(ctx context.Context, d *schema.ResourceData, meta a deviceFleet, err := findDeviceFleetByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Unable to find SageMaker AI Device Fleet (%s); removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/device_fleet_test.go b/internal/service/sagemaker/device_fleet_test.go index 3d04ecd4bed..93408fd63f4 100644 --- a/internal/service/sagemaker/device_fleet_test.go +++ b/internal/service/sagemaker/device_fleet_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func testAccCheckDeviceFleetDestroy(ctx context.Context) resource.TestCheckFunc } _, err := tfsagemaker.FindDeviceFleetByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/device_test.go b/internal/service/sagemaker/device_test.go index c2af89684c5..4e6841c1779 100644 --- a/internal/service/sagemaker/device_test.go +++ b/internal/service/sagemaker/device_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -157,7 +157,7 @@ func testAccCheckDeviceDestroy(ctx context.Context) resource.TestCheckFunc { } _, err = tfsagemaker.FindDeviceByName(ctx, conn, deviceFleetName, deviceName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/domain.go b/internal/service/sagemaker/domain.go index 98a14818780..72bcf6a2db1 100644 --- a/internal/service/sagemaker/domain.go +++ b/internal/service/sagemaker/domain.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -1512,7 +1513,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta any) d domain, err := findDomainByName(ctx, conn, d.Id()) if err != nil { - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Domain (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/domain_test.go b/internal/service/sagemaker/domain_test.go index 8e720ecc1e1..b6867d7557a 100644 --- a/internal/service/sagemaker/domain_test.go +++ b/internal/service/sagemaker/domain_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1810,7 +1810,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindDomainByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/endpoint.go b/internal/service/sagemaker/endpoint.go index 6225c9950d2..e8047fd69fd 100644 --- a/internal/service/sagemaker/endpoint.go +++ b/internal/service/sagemaker/endpoint.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -277,7 +278,7 @@ func resourceEndpointRead(ctx context.Context, d *schema.ResourceData, meta any) endpoint, err := findEndpointByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Endpoint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -397,7 +398,7 @@ func statusEndpoint(ctx context.Context, conn *sagemaker.Client, name string) sd return func() (any, string, error) { output, err := findEndpointByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/sagemaker/endpoint_configuration.go b/internal/service/sagemaker/endpoint_configuration.go index 5617b53a019..9c648b1935d 100644 --- a/internal/service/sagemaker/endpoint_configuration.go +++ b/internal/service/sagemaker/endpoint_configuration.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -748,7 +749,7 @@ func resourceEndpointConfigurationRead(ctx context.Context, d *schema.ResourceDa endpointConfig, err := findEndpointConfigByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Endpoint Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/endpoint_configuration_test.go b/internal/service/sagemaker/endpoint_configuration_test.go index ad4c67e2284..da57c8652be 100644 --- a/internal/service/sagemaker/endpoint_configuration_test.go +++ b/internal/service/sagemaker/endpoint_configuration_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1025,7 +1025,7 @@ func testAccCheckEndpointConfigurationDestroy(ctx context.Context) resource.Test _, err := tfsagemaker.FindEndpointConfigByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/endpoint_test.go b/internal/service/sagemaker/endpoint_test.go index bf161f878a9..722b22f4fdb 100644 --- a/internal/service/sagemaker/endpoint_test.go +++ b/internal/service/sagemaker/endpoint_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -289,7 +289,7 @@ func testAccCheckEndpointDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindEndpointByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/feature_group.go b/internal/service/sagemaker/feature_group.go index d7b03187499..b36a64bb943 100644 --- a/internal/service/sagemaker/feature_group.go +++ b/internal/service/sagemaker/feature_group.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -378,7 +379,7 @@ func resourceFeatureGroupRead(ctx context.Context, d *schema.ResourceData, meta output, err := findFeatureGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Feature Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/feature_group_test.go b/internal/service/sagemaker/feature_group_test.go index 3c4661f72d9..3d003aa4444 100644 --- a/internal/service/sagemaker/feature_group_test.go +++ b/internal/service/sagemaker/feature_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -593,7 +593,7 @@ func testAccCheckFeatureGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsagemaker.FindFeatureGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/flow_definition.go b/internal/service/sagemaker/flow_definition.go index 9ef4025297e..079c4bb7d76 100644 --- a/internal/service/sagemaker/flow_definition.go +++ b/internal/service/sagemaker/flow_definition.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -297,7 +298,7 @@ func resourceFlowDefinitionRead(ctx context.Context, d *schema.ResourceData, met flowDefinition, err := findFlowDefinitionByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Flow Definition (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/flow_definition_test.go b/internal/service/sagemaker/flow_definition_test.go index ba6040a073f..2dcd2fca75b 100644 --- a/internal/service/sagemaker/flow_definition_test.go +++ b/internal/service/sagemaker/flow_definition_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -209,7 +209,7 @@ func testAccCheckFlowDefinitionDestroy(ctx context.Context) resource.TestCheckFu _, err := tfsagemaker.FindFlowDefinitionByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/hub.go b/internal/service/sagemaker/hub.go index 97a7a0bcb3e..15f75b0e8bf 100644 --- a/internal/service/sagemaker/hub.go +++ b/internal/service/sagemaker/hub.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -135,7 +136,7 @@ func resourceHubRead(ctx context.Context, d *schema.ResourceData, meta any) diag hub, err := findHubByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Hub (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/hub_test.go b/internal/service/sagemaker/hub_test.go index 5fb5647a605..fb1fa37e90c 100644 --- a/internal/service/sagemaker/hub_test.go +++ b/internal/service/sagemaker/hub_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -226,7 +226,7 @@ func testAccCheckHubDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindHubByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/human_task_ui.go b/internal/service/sagemaker/human_task_ui.go index ba74fab711d..2ea3cdce5a6 100644 --- a/internal/service/sagemaker/human_task_ui.go +++ b/internal/service/sagemaker/human_task_ui.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -108,7 +109,7 @@ func resourceHumanTaskUIRead(ctx context.Context, d *schema.ResourceData, meta a humanTaskUi, err := findHumanTaskUIByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI HumanTaskUi (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/human_task_ui_test.go b/internal/service/sagemaker/human_task_ui_test.go index 6caec995ec8..4be2807d597 100644 --- a/internal/service/sagemaker/human_task_ui_test.go +++ b/internal/service/sagemaker/human_task_ui_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +133,7 @@ func testAccCheckHumanTaskUIDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsagemaker.FindHumanTaskUIByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/image.go b/internal/service/sagemaker/image.go index c7d3463dffc..7380f6a15e5 100644 --- a/internal/service/sagemaker/image.go +++ b/internal/service/sagemaker/image.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -115,7 +116,7 @@ func resourceImageRead(ctx context.Context, d *schema.ResourceData, meta any) di image, err := findImageByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Image (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/image_test.go b/internal/service/sagemaker/image_test.go index d3e768b6a6e..4d4d2a30cde 100644 --- a/internal/service/sagemaker/image_test.go +++ b/internal/service/sagemaker/image_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -215,7 +215,7 @@ func testAccCheckImageDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindImageByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/image_version.go b/internal/service/sagemaker/image_version.go index b34694a84b9..d44ef32deb5 100644 --- a/internal/service/sagemaker/image_version.go +++ b/internal/service/sagemaker/image_version.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +195,7 @@ func resourceImageVersionRead(ctx context.Context, d *schema.ResourceData, meta image, err := findImageVersionByTwoPartKey(ctx, conn, name, version) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Image Version (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/image_version_test.go b/internal/service/sagemaker/image_version_test.go index a5ed6088d2a..36cc007d2bf 100644 --- a/internal/service/sagemaker/image_version_test.go +++ b/internal/service/sagemaker/image_version_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -352,7 +352,7 @@ func testAccCheckImageVersionDestroy(ctx context.Context) resource.TestCheckFunc version := flex.StringValueToInt32Value(rs.Primary.Attributes[names.AttrVersion]) _, err := tfsagemaker.FindImageVersionByTwoPartKey(ctx, conn, name, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/mlflow_tracking_server.go b/internal/service/sagemaker/mlflow_tracking_server.go index 8fdf5e83132..d32c4990d36 100644 --- a/internal/service/sagemaker/mlflow_tracking_server.go +++ b/internal/service/sagemaker/mlflow_tracking_server.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/semver" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -133,7 +134,7 @@ func resourceMlflowTrackingServerRead(ctx context.Context, d *schema.ResourceDat output, err := findMlflowTrackingServerByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Mlflow Tracking Server (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/mlflow_tracking_server_test.go b/internal/service/sagemaker/mlflow_tracking_server_test.go index cf6549d61f7..abf63469f0e 100644 --- a/internal/service/sagemaker/mlflow_tracking_server_test.go +++ b/internal/service/sagemaker/mlflow_tracking_server_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -178,7 +178,7 @@ func testAccCheckMlflowTrackingServerDestroy(ctx context.Context) resource.TestC _, err := tfsagemaker.FindMlflowTrackingServerByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/model.go b/internal/service/sagemaker/model.go index 33364663ed2..185aa5296ca 100644 --- a/internal/service/sagemaker/model.go +++ b/internal/service/sagemaker/model.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -573,7 +574,7 @@ func resourceModelRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findModelByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[INFO] unable to find the sagemaker model resource and therefore it is removed from the state: %s", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/model_package_group.go b/internal/service/sagemaker/model_package_group.go index 9c0118d9f70..3f315ac68c7 100644 --- a/internal/service/sagemaker/model_package_group.go +++ b/internal/service/sagemaker/model_package_group.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -95,7 +96,7 @@ func resourceModelPackageGroupRead(ctx context.Context, d *schema.ResourceData, mpg, err := findModelPackageGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Model Package Group (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/model_package_group_policy.go b/internal/service/sagemaker/model_package_group_policy.go index ff9e3c9ce03..72f61d410b2 100644 --- a/internal/service/sagemaker/model_package_group_policy.go +++ b/internal/service/sagemaker/model_package_group_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -84,7 +85,7 @@ func resourceModelPackageGroupPolicyRead(ctx context.Context, d *schema.Resource mpg, err := findModelPackageGroupPolicyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Unable to find SageMaker AI Model Package Group Policy (%s); removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/model_package_group_policy_test.go b/internal/service/sagemaker/model_package_group_policy_test.go index 890bfe4b19b..51d9d37c83a 100644 --- a/internal/service/sagemaker/model_package_group_policy_test.go +++ b/internal/service/sagemaker/model_package_group_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +107,7 @@ func testAccCheckModelPackageGroupPolicyDestroy(ctx context.Context) resource.Te _, err := tfsagemaker.FindModelPackageGroupPolicyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/model_package_group_test.go b/internal/service/sagemaker/model_package_group_test.go index d2176cf49a8..0df6d1b9d1e 100644 --- a/internal/service/sagemaker/model_package_group_test.go +++ b/internal/service/sagemaker/model_package_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckModelPackageGroupDestroy(ctx context.Context) resource.TestChec _, err := tfsagemaker.FindModelPackageGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/model_test.go b/internal/service/sagemaker/model_test.go index 2e1f8ea0569..cdfbebcecfb 100644 --- a/internal/service/sagemaker/model_test.go +++ b/internal/service/sagemaker/model_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -467,7 +467,7 @@ func testAccCheckModelDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindModelByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/monitoring_schedule.go b/internal/service/sagemaker/monitoring_schedule.go index c2aef413503..acc9dcbf315 100644 --- a/internal/service/sagemaker/monitoring_schedule.go +++ b/internal/service/sagemaker/monitoring_schedule.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -129,7 +130,7 @@ func resourceMonitoringScheduleRead(ctx context.Context, d *schema.ResourceData, monitoringSchedule, err := findMonitoringScheduleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Monitoring Schedule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/monitoring_schedule_test.go b/internal/service/sagemaker/monitoring_schedule_test.go index 8ee258d05a7..b46e4aae023 100644 --- a/internal/service/sagemaker/monitoring_schedule_test.go +++ b/internal/service/sagemaker/monitoring_schedule_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -176,7 +176,7 @@ func testAccCheckMonitoringScheduleDestroy(ctx context.Context) resource.TestChe _, err := tfsagemaker.FindMonitoringScheduleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/notebook_instance.go b/internal/service/sagemaker/notebook_instance.go index 45512ff017c..5599cd78cbd 100644 --- a/internal/service/sagemaker/notebook_instance.go +++ b/internal/service/sagemaker/notebook_instance.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -228,7 +229,7 @@ func resourceNotebookInstanceRead(ctx context.Context, d *schema.ResourceData, m notebookInstance, err := findNotebookInstanceByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Notebook Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -355,7 +356,7 @@ func resourceNotebookInstanceDelete(ctx context.Context, d *schema.ResourceData, notebook, err := findNotebookInstanceByName(ctx, conn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return diags } @@ -445,7 +446,7 @@ func stopNotebookInstance(ctx context.Context, conn *sagemaker.Client, id string notebook, err := findNotebookInstanceByName(ctx, conn, id) if err != nil { - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } return err diff --git a/internal/service/sagemaker/notebook_instance_lifecycle_configuration.go b/internal/service/sagemaker/notebook_instance_lifecycle_configuration.go index e6f05ae9af8..15c39118d0c 100644 --- a/internal/service/sagemaker/notebook_instance_lifecycle_configuration.go +++ b/internal/service/sagemaker/notebook_instance_lifecycle_configuration.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -106,7 +107,7 @@ func resourceNotebookInstanceLifeCycleConfigurationRead(ctx context.Context, d * output, err := findNotebookInstanceLifecycleConfigByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[INFO] unable to find the SageMaker AI notebook instance lifecycle configuration (%s); therefore it is removed from the state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go b/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go index 8e2402c0774..2f43f318489 100644 --- a/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go +++ b/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -197,7 +197,7 @@ func testAccCheckNotebookInstanceLifecycleConfigurationDestroy(ctx context.Conte _, err := tfsagemaker.FindNotebookInstanceLifecycleConfigByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/notebook_instance_test.go b/internal/service/sagemaker/notebook_instance_test.go index 5418913848e..6cc510631c5 100644 --- a/internal/service/sagemaker/notebook_instance_test.go +++ b/internal/service/sagemaker/notebook_instance_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -681,7 +681,7 @@ func testAccCheckNotebookInstanceDestroy(ctx context.Context) resource.TestCheck _, err := tfsagemaker.FindNotebookInstanceByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/pipeline.go b/internal/service/sagemaker/pipeline.go index fbcb54e9c2e..9aea0e40d52 100644 --- a/internal/service/sagemaker/pipeline.go +++ b/internal/service/sagemaker/pipeline.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -167,7 +168,7 @@ func resourcePipelineRead(ctx context.Context, d *schema.ResourceData, meta any) pipeline, err := findPipelineByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Pipeline (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/pipeline_test.go b/internal/service/sagemaker/pipeline_test.go index d9c341b1069..38c3d549fcb 100644 --- a/internal/service/sagemaker/pipeline_test.go +++ b/internal/service/sagemaker/pipeline_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func testAccCheckPipelineDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindPipelineByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/project.go b/internal/service/sagemaker/project.go index dc17adf5442..9a4e4552144 100644 --- a/internal/service/sagemaker/project.go +++ b/internal/service/sagemaker/project.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -143,7 +144,7 @@ func resourceProjectRead(ctx context.Context, d *schema.ResourceData, meta any) project, err := findProjectByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Project (%s); removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/project_test.go b/internal/service/sagemaker/project_test.go index e74118b7c0e..43d442ac6d0 100644 --- a/internal/service/sagemaker/project_test.go +++ b/internal/service/sagemaker/project_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -180,7 +180,7 @@ func testAccCheckProjectDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindProjectByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/space.go b/internal/service/sagemaker/space.go index 93a740c9969..7c1601cb094 100644 --- a/internal/service/sagemaker/space.go +++ b/internal/service/sagemaker/space.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -500,7 +501,7 @@ func resourceSpaceRead(ctx context.Context, d *schema.ResourceData, meta any) di space, err := findSpaceByName(ctx, conn, domainID, name) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI Space (%s), removing from state", d.Id()) return diags diff --git a/internal/service/sagemaker/space_test.go b/internal/service/sagemaker/space_test.go index 5978165b56e..e8430cce471 100644 --- a/internal/service/sagemaker/space_test.go +++ b/internal/service/sagemaker/space_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -446,7 +446,7 @@ func testAccCheckSpaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindSpaceByName(ctx, conn, domainID, spaceName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/status.go b/internal/service/sagemaker/status.go index 55cf248b4c3..17ab1e59a84 100644 --- a/internal/service/sagemaker/status.go +++ b/internal/service/sagemaker/status.go @@ -9,14 +9,14 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sagemaker" awstypes "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusNotebookInstance(ctx context.Context, conn *sagemaker.Client, notebookName string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := findNotebookInstanceByName(ctx, conn, notebookName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -32,7 +32,7 @@ func statusModelPackageGroup(ctx context.Context, conn *sagemaker.Client, name s return func() (any, string, error) { output, err := findModelPackageGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -48,7 +48,7 @@ func statusImage(ctx context.Context, conn *sagemaker.Client, name string) sdkre return func() (any, string, error) { output, err := findImageByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -64,7 +64,7 @@ func statusImageVersionByName(ctx context.Context, conn *sagemaker.Client, name return func() (any, string, error) { output, err := findImageVersionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -80,7 +80,7 @@ func statusImageVersionByID(ctx context.Context, conn *sagemaker.Client, name st return func() (any, string, error) { output, err := findImageVersionByTwoPartKey(ctx, conn, name, version) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -96,7 +96,7 @@ func statusDomain(ctx context.Context, conn *sagemaker.Client, domainID string) return func() (any, string, error) { output, err := findDomainByName(ctx, conn, domainID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -112,7 +112,7 @@ func statusFeatureGroup(ctx context.Context, conn *sagemaker.Client, name string return func() (any, string, error) { output, err := findFeatureGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -128,7 +128,7 @@ func statusFeatureGroupUpdate(ctx context.Context, conn *sagemaker.Client, name return func() (any, string, error) { output, err := findFeatureGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -148,7 +148,7 @@ func statusFlowDefinition(ctx context.Context, conn *sagemaker.Client, name stri return func() (any, string, error) { output, err := findFlowDefinitionByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -164,7 +164,7 @@ func statusApp(ctx context.Context, conn *sagemaker.Client, domainID, userProfil return func() (any, string, error) { output, err := findAppByName(ctx, conn, domainID, userProfileOrSpaceName, appType, appName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -180,7 +180,7 @@ func statusProject(ctx context.Context, conn *sagemaker.Client, name string) sdk return func() (any, string, error) { output, err := findProjectByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -196,7 +196,7 @@ func statusWorkforce(ctx context.Context, conn *sagemaker.Client, name string) s return func() (any, string, error) { output, err := findWorkforceByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -212,7 +212,7 @@ func statusSpace(ctx context.Context, conn *sagemaker.Client, domainId, name str return func() (any, string, error) { output, err := findSpaceByName(ctx, conn, domainId, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -228,7 +228,7 @@ func statusMonitoringSchedule(ctx context.Context, conn *sagemaker.Client, name return func() (any, string, error) { output, err := findMonitoringScheduleByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -244,7 +244,7 @@ func statusMlflowTrackingServer(ctx context.Context, conn *sagemaker.Client, nam return func() (any, string, error) { output, err := findMlflowTrackingServerByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -260,7 +260,7 @@ func statusHub(ctx context.Context, conn *sagemaker.Client, name string) sdkretr return func() (any, string, error) { output, err := findHubByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/sagemaker/studio_lifecycle_config.go b/internal/service/sagemaker/studio_lifecycle_config.go index fe4825d82f7..43b1d60cff2 100644 --- a/internal/service/sagemaker/studio_lifecycle_config.go +++ b/internal/service/sagemaker/studio_lifecycle_config.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func resourceStudioLifecycleConfigRead(ctx context.Context, d *schema.ResourceDa image, err := findStudioLifecycleConfigByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Studio Lifecycle Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/studio_lifecycle_config_test.go b/internal/service/sagemaker/studio_lifecycle_config_test.go index 5785d9ee34f..f1bda91e671 100644 --- a/internal/service/sagemaker/studio_lifecycle_config_test.go +++ b/internal/service/sagemaker/studio_lifecycle_config_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckStudioLifecycleDestroyConfig(ctx context.Context) resource.Test _, err := tfsagemaker.FindStudioLifecycleConfigByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/user_profile.go b/internal/service/sagemaker/user_profile.go index f1698d185ba..f3ab8f63184 100644 --- a/internal/service/sagemaker/user_profile.go +++ b/internal/service/sagemaker/user_profile.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -982,7 +983,7 @@ func resourceUserProfileRead(ctx context.Context, d *schema.ResourceData, meta a userProfile, err := findUserProfileByName(ctx, conn, domainID, userProfileName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { d.SetId("") log.Printf("[WARN] Unable to find SageMaker AI User Profile (%s); removing from state", d.Id()) return diags @@ -1124,7 +1125,7 @@ func statusUserProfile(ctx context.Context, conn *sagemaker.Client, domainID, us return func() (any, string, error) { output, err := findUserProfileByName(ctx, conn, domainID, userProfileName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/sagemaker/user_profile_test.go b/internal/service/sagemaker/user_profile_test.go index f814edcb9d4..627fc1bd99c 100644 --- a/internal/service/sagemaker/user_profile_test.go +++ b/internal/service/sagemaker/user_profile_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -467,7 +467,7 @@ func testAccCheckUserProfileDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsagemaker.FindUserProfileByName(ctx, conn, domainID, userProfileName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/workforce.go b/internal/service/sagemaker/workforce.go index 280969dfb0d..d7ab0051a6c 100644 --- a/internal/service/sagemaker/workforce.go +++ b/internal/service/sagemaker/workforce.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -243,7 +244,7 @@ func resourceWorkforceRead(ctx context.Context, d *schema.ResourceData, meta any workforce, err := findWorkforceByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Workforce (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/workforce_test.go b/internal/service/sagemaker/workforce_test.go index 1f95febe4b5..9d26abdf63d 100644 --- a/internal/service/sagemaker/workforce_test.go +++ b/internal/service/sagemaker/workforce_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -315,7 +315,7 @@ func testAccCheckWorkforceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindWorkforceByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sagemaker/workteam.go b/internal/service/sagemaker/workteam.go index 1c7c556c780..92dd8aa39e0 100644 --- a/internal/service/sagemaker/workteam.go +++ b/internal/service/sagemaker/workteam.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -225,7 +226,7 @@ func resourceWorkteamRead(ctx context.Context, d *schema.ResourceData, meta any) workteam, err := findWorkteamByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SageMaker AI Workteam (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sagemaker/workteam_test.go b/internal/service/sagemaker/workteam_test.go index 1ce70df8808..477178e7612 100644 --- a/internal/service/sagemaker/workteam_test.go +++ b/internal/service/sagemaker/workteam_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -366,7 +366,7 @@ func testAccCheckWorkteamDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsagemaker.FindWorkteamByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 8d2c548884698a35f0b7887bdeb11b7eda417098 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:49 -0800 Subject: [PATCH 181/227] `scheduler` --- internal/service/scheduler/schedule.go | 3 ++- internal/service/scheduler/schedule_group.go | 4 ++-- internal/service/scheduler/schedule_test.go | 4 ++-- internal/service/scheduler/status.go | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/service/scheduler/schedule.go b/internal/service/scheduler/schedule.go index 6348dc03046..e1d6fa19af6 100644 --- a/internal/service/scheduler/schedule.go +++ b/internal/service/scheduler/schedule.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -532,7 +533,7 @@ func resourceScheduleRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := findScheduleByTwoPartKey(ctx, conn, groupName, scheduleName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Scheduler Schedule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/scheduler/schedule_group.go b/internal/service/scheduler/schedule_group.go index d83c5518076..dfdb6cbe2f1 100644 --- a/internal/service/scheduler/schedule_group.go +++ b/internal/service/scheduler/schedule_group.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func resourceScheduleGroupRead(ctx context.Context, d *schema.ResourceData, meta out, err := findScheduleGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Scheduler Schedule Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/scheduler/schedule_test.go b/internal/service/scheduler/schedule_test.go index 76359a5a835..f61fb6548cd 100644 --- a/internal/service/scheduler/schedule_test.go +++ b/internal/service/scheduler/schedule_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfscheduler "github.com/hashicorp/terraform-provider-aws/internal/service/scheduler" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1655,7 +1655,7 @@ func testAccCheckScheduleDestroy(ctx context.Context, t *testing.T) resource.Tes _, err = tfscheduler.FindScheduleByTwoPartKey(ctx, conn, groupName, scheduleName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/scheduler/status.go b/internal/service/scheduler/status.go index c22c0f72411..772c3298057 100644 --- a/internal/service/scheduler/status.go +++ b/internal/service/scheduler/status.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/scheduler" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) const ( @@ -19,7 +19,7 @@ const ( func statusScheduleGroup(ctx context.Context, conn *scheduler.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := findScheduleGroupByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 78f5942736e904ffa28da846bd4f96ac50fcec9e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:51 -0800 Subject: [PATCH 182/227] `schemas` --- internal/service/schemas/discoverer.go | 3 ++- internal/service/schemas/discoverer_test.go | 4 ++-- internal/service/schemas/registry.go | 3 ++- internal/service/schemas/registry_policy.go | 3 ++- internal/service/schemas/registry_policy_test.go | 4 ++-- internal/service/schemas/registry_test.go | 4 ++-- internal/service/schemas/schema.go | 3 ++- internal/service/schemas/schema_test.go | 4 ++-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/service/schemas/discoverer.go b/internal/service/schemas/discoverer.go index d9344fdbfbf..fb3b6b4eeb3 100644 --- a/internal/service/schemas/discoverer.go +++ b/internal/service/schemas/discoverer.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -89,7 +90,7 @@ func resourceDiscovererRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findDiscovererByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Schemas Discoverer (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/schemas/discoverer_test.go b/internal/service/schemas/discoverer_test.go index 0d035c39f10..7b109ed0d7a 100644 --- a/internal/service/schemas/discoverer_test.go +++ b/internal/service/schemas/discoverer_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -172,7 +172,7 @@ func testAccCheckDiscovererDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfschemas.FindDiscovererByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/schemas/registry.go b/internal/service/schemas/registry.go index 8734cf47385..9f062ff3f66 100644 --- a/internal/service/schemas/registry.go +++ b/internal/service/schemas/registry.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -92,7 +93,7 @@ func resourceRegistryRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findRegistryByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Schemas Registry (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/schemas/registry_policy.go b/internal/service/schemas/registry_policy.go index c006fa06072..4d587d2f568 100644 --- a/internal/service/schemas/registry_policy.go +++ b/internal/service/schemas/registry_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -88,7 +89,7 @@ func resourceRegistryPolicyRead(ctx context.Context, d *schema.ResourceData, met output, err := findRegistryPolicyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Schemas Registry Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/schemas/registry_policy_test.go b/internal/service/schemas/registry_policy_test.go index 277ed9e63d9..8daec79fb20 100644 --- a/internal/service/schemas/registry_policy_test.go +++ b/internal/service/schemas/registry_policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -156,7 +156,7 @@ func testAccCheckRegistryPolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfschemas.FindRegistryPolicyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/schemas/registry_test.go b/internal/service/schemas/registry_test.go index 25c21b99f72..a215e4f5190 100644 --- a/internal/service/schemas/registry_test.go +++ b/internal/service/schemas/registry_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckRegistryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfschemas.FindRegistryByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/schemas/schema.go b/internal/service/schemas/schema.go index e267e380831..7f19db60528 100644 --- a/internal/service/schemas/schema.go +++ b/internal/service/schemas/schema.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -134,7 +135,7 @@ func resourceSchemaRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findSchemaByTwoPartKey(ctx, conn, name, registryName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] EventBridge Schemas Schema (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/schemas/schema_test.go b/internal/service/schemas/schema_test.go index ff9d14c8fc3..6cb7d8cc14e 100644 --- a/internal/service/schemas/schema_test.go +++ b/internal/service/schemas/schema_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -295,7 +295,7 @@ func testAccCheckSchemaDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfschemas.FindSchemaByTwoPartKey(ctx, conn, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes["registry_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 082a80dc83189f299a6579f1177270afab4c6e00 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:52 -0800 Subject: [PATCH 183/227] `secretsmanager` --- internal/service/secretsmanager/secret.go | 3 ++- internal/service/secretsmanager/secret_policy.go | 3 ++- internal/service/secretsmanager/secret_policy_test.go | 4 ++-- internal/service/secretsmanager/secret_rotation.go | 3 ++- internal/service/secretsmanager/secret_rotation_test.go | 4 ++-- internal/service/secretsmanager/secret_test.go | 4 ++-- internal/service/secretsmanager/secret_version.go | 3 ++- internal/service/secretsmanager/secret_version_test.go | 4 ++-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/internal/service/secretsmanager/secret.go b/internal/service/secretsmanager/secret.go index dc727403183..d98d5fac496 100644 --- a/internal/service/secretsmanager/secret.go +++ b/internal/service/secretsmanager/secret.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -228,7 +229,7 @@ func resourceSecretRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findSecretByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Secrets Manager Secret (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/secretsmanager/secret_policy.go b/internal/service/secretsmanager/secret_policy.go index 7b065c5f074..8f1e963d97a 100644 --- a/internal/service/secretsmanager/secret_policy.go +++ b/internal/service/secretsmanager/secret_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -103,7 +104,7 @@ func resourceSecretPolicyRead(ctx context.Context, d *schema.ResourceData, meta output, err := findSecretPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Secrets Manager Secret Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/secretsmanager/secret_policy_test.go b/internal/service/secretsmanager/secret_policy_test.go index 7149b474d03..74ecf36ee13 100644 --- a/internal/service/secretsmanager/secret_policy_test.go +++ b/internal/service/secretsmanager/secret_policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +162,7 @@ func testAccCheckSecretPolicyDestroy(ctx context.Context) resource.TestCheckFunc output, err := tfsecretsmanager.FindSecretPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/secretsmanager/secret_rotation.go b/internal/service/secretsmanager/secret_rotation.go index 46c88406455..d6f404ce1e0 100644 --- a/internal/service/secretsmanager/secret_rotation.go +++ b/internal/service/secretsmanager/secret_rotation.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -132,7 +133,7 @@ func resourceSecretRotationRead(ctx context.Context, d *schema.ResourceData, met output, err := findSecretByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Secrets Manager Secret Rotation (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/secretsmanager/secret_rotation_test.go b/internal/service/secretsmanager/secret_rotation_test.go index 6cc07ac7147..540bce17377 100644 --- a/internal/service/secretsmanager/secret_rotation_test.go +++ b/internal/service/secretsmanager/secret_rotation_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -405,7 +405,7 @@ func testAccCheckSecretRotationDestroy(ctx context.Context) resource.TestCheckFu output, err := tfsecretsmanager.FindSecretByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/secretsmanager/secret_test.go b/internal/service/secretsmanager/secret_test.go index a5355de6089..91f8080bfa1 100644 --- a/internal/service/secretsmanager/secret_test.go +++ b/internal/service/secretsmanager/secret_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -337,7 +337,7 @@ func testAccCheckSecretDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsecretsmanager.FindSecretByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/secretsmanager/secret_version.go b/internal/service/secretsmanager/secret_version.go index e0a77f54795..0e525bbef38 100644 --- a/internal/service/secretsmanager/secret_version.go +++ b/internal/service/secretsmanager/secret_version.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -172,7 +173,7 @@ func resourceSecretVersionRead(ctx context.Context, d *schema.ResourceData, meta output, err := findSecretVersionByTwoPartKey(ctx, conn, secretID, versionID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Secrets Manager Secret Version (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/secretsmanager/secret_version_test.go b/internal/service/secretsmanager/secret_version_test.go index 5e9728e2d40..edc2045c627 100644 --- a/internal/service/secretsmanager/secret_version_test.go +++ b/internal/service/secretsmanager/secret_version_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -323,7 +323,7 @@ func testAccCheckSecretVersionDestroy(ctx context.Context) resource.TestCheckFun output, err := tfsecretsmanager.FindSecretVersionByTwoPartKey(ctx, conn, rs.Primary.Attributes["secret_id"], rs.Primary.Attributes["version_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From fde4974e3ead88b050724a6230f2318e26b17bf9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:54 -0800 Subject: [PATCH 184/227] `securityhub` --- internal/service/securityhub/account.go | 3 ++- internal/service/securityhub/account_test.go | 4 ++-- internal/service/securityhub/action_target.go | 3 ++- internal/service/securityhub/action_target_test.go | 4 ++-- internal/service/securityhub/automation_rule.go | 3 ++- internal/service/securityhub/automation_rule_test.go | 4 ++-- internal/service/securityhub/configuration_policy.go | 3 ++- .../securityhub/configuration_policy_association.go | 5 +++-- .../securityhub/configuration_policy_association_test.go | 4 ++-- internal/service/securityhub/configuration_policy_test.go | 4 ++-- internal/service/securityhub/finding_aggregator.go | 3 ++- internal/service/securityhub/finding_aggregator_test.go | 4 ++-- internal/service/securityhub/insight.go | 3 ++- internal/service/securityhub/insight_test.go | 4 ++-- internal/service/securityhub/invite_accepter.go | 3 ++- internal/service/securityhub/invite_accepter_test.go | 4 ++-- internal/service/securityhub/member.go | 5 +++-- internal/service/securityhub/member_test.go | 4 ++-- internal/service/securityhub/organization_admin_account.go | 5 +++-- .../service/securityhub/organization_admin_account_test.go | 4 ++-- internal/service/securityhub/organization_configuration.go | 5 +++-- .../service/securityhub/organization_configuration_test.go | 4 ++-- internal/service/securityhub/product_subscription.go | 3 ++- internal/service/securityhub/product_subscription_test.go | 4 ++-- internal/service/securityhub/standards_control.go | 3 ++- .../service/securityhub/standards_control_association.go | 3 ++- internal/service/securityhub/standards_subscription.go | 7 ++++--- .../service/securityhub/standards_subscription_test.go | 4 ++-- 28 files changed, 62 insertions(+), 47 deletions(-) diff --git a/internal/service/securityhub/account.go b/internal/service/securityhub/account.go index 3803248f293..e42d4fe7f6a 100644 --- a/internal/service/securityhub/account.go +++ b/internal/service/securityhub/account.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -136,7 +137,7 @@ func resourceAccountRead(ctx context.Context, d *schema.ResourceData, meta any) arn := accountHubARN(ctx, meta.(*conns.AWSClient)) output, err := findHubByARN(ctx, conn, arn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Account %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/account_test.go b/internal/service/securityhub/account_test.go index 7b4dd4051cf..4157eefe664 100644 --- a/internal/service/securityhub/account_test.go +++ b/internal/service/securityhub/account_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -247,7 +247,7 @@ func testAccCheckAccountDestroy(ctx context.Context) resource.TestCheckFunc { arn := tfsecurityhub.AccountHubARN(ctx, awsClient) _, err := tfsecurityhub.FindHubByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/action_target.go b/internal/service/securityhub/action_target.go index 78a1347ae25..28ca796856e 100644 --- a/internal/service/securityhub/action_target.go +++ b/internal/service/securityhub/action_target.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +98,7 @@ func resourceActionTargetRead(ctx context.Context, d *schema.ResourceData, meta output, err := findActionTargetByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Action Target %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/action_target_test.go b/internal/service/securityhub/action_target_test.go index 2d9313b9735..7647face076 100644 --- a/internal/service/securityhub/action_target_test.go +++ b/internal/service/securityhub/action_target_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckActionTargetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsecurityhub.FindActionTargetByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/automation_rule.go b/internal/service/securityhub/automation_rule.go index b55ae3f5fb9..0753531feb9 100644 --- a/internal/service/securityhub/automation_rule.go +++ b/internal/service/securityhub/automation_rule.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -418,7 +419,7 @@ func (r *automationRuleResource) Read(ctx context.Context, request resource.Read ruleARN := data.ID.ValueString() automationRule, err := findAutomationRuleByARN(ctx, conn, ruleARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/securityhub/automation_rule_test.go b/internal/service/securityhub/automation_rule_test.go index 6570f5d2cde..8fd68e3bf99 100644 --- a/internal/service/securityhub/automation_rule_test.go +++ b/internal/service/securityhub/automation_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -372,7 +372,7 @@ func testAccCheckAutomationRuleDestroy(ctx context.Context) resource.TestCheckFu _, err := tfsecurityhub.FindAutomationRuleByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/configuration_policy.go b/internal/service/securityhub/configuration_policy.go index c47b42c675a..54e544cbee6 100644 --- a/internal/service/securityhub/configuration_policy.go +++ b/internal/service/securityhub/configuration_policy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -303,7 +304,7 @@ func resourceConfigurationPolicyRead(ctx context.Context, d *schema.ResourceData output, err := findConfigurationPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Configuration Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/configuration_policy_association.go b/internal/service/securityhub/configuration_policy_association.go index 66fbc61574f..9370b41a438 100644 --- a/internal/service/securityhub/configuration_policy_association.go +++ b/internal/service/securityhub/configuration_policy_association.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -99,7 +100,7 @@ func resourceConfigurationPolicyAssociationRead(ctx context.Context, d *schema.R output, err := findConfigurationPolicyAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Configuration Policy Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -169,7 +170,7 @@ func statusConfigurationPolicyAssociation(ctx context.Context, conn *securityhub return func() (any, string, error) { output, err := findConfigurationPolicyAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/securityhub/configuration_policy_association_test.go b/internal/service/securityhub/configuration_policy_association_test.go index f01b7c559bf..4ea4f99ade5 100644 --- a/internal/service/securityhub/configuration_policy_association_test.go +++ b/internal/service/securityhub/configuration_policy_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -153,7 +153,7 @@ func testAccCheckConfigurationPolicyAssociationDestroy(ctx context.Context) reso _, err := tfsecurityhub.FindConfigurationPolicyAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/configuration_policy_test.go b/internal/service/securityhub/configuration_policy_test.go index 91b91271c92..7d4e258fcad 100644 --- a/internal/service/securityhub/configuration_policy_test.go +++ b/internal/service/securityhub/configuration_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -343,7 +343,7 @@ func testAccCheckConfigurationPolicyDestroy(ctx context.Context) resource.TestCh _, err := tfsecurityhub.FindConfigurationPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/finding_aggregator.go b/internal/service/securityhub/finding_aggregator.go index 5e07e6cb9ca..040c91d80a6 100644 --- a/internal/service/securityhub/finding_aggregator.go +++ b/internal/service/securityhub/finding_aggregator.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -96,7 +97,7 @@ func resourceFindingAggregatorRead(ctx context.Context, d *schema.ResourceData, output, err := findFindingAggregatorByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Finding Aggregator (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/finding_aggregator_test.go b/internal/service/securityhub/finding_aggregator_test.go index 65fd6431fe1..5241cade95e 100644 --- a/internal/service/securityhub/finding_aggregator_test.go +++ b/internal/service/securityhub/finding_aggregator_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -116,7 +116,7 @@ func testAccCheckFindingAggregatorDestroy(ctx context.Context) resource.TestChec _, err := tfsecurityhub.FindFindingAggregatorByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/insight.go b/internal/service/securityhub/insight.go index cf965b6684c..a30edf5aa8e 100644 --- a/internal/service/securityhub/insight.go +++ b/internal/service/securityhub/insight.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -183,7 +184,7 @@ func resourceInsightRead(ctx context.Context, d *schema.ResourceData, meta any) insight, err := findInsightByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Insight (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/insight_test.go b/internal/service/securityhub/insight_test.go index 025a85a0a52..73abf92bf91 100644 --- a/internal/service/securityhub/insight_test.go +++ b/internal/service/securityhub/insight_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -462,7 +462,7 @@ func testAccCheckInsightDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsecurityhub.FindInsightByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/invite_accepter.go b/internal/service/securityhub/invite_accepter.go index 91074896f6a..0ff794bdd27 100644 --- a/internal/service/securityhub/invite_accepter.go +++ b/internal/service/securityhub/invite_accepter.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -81,7 +82,7 @@ func resourceInviteAccepterRead(ctx context.Context, d *schema.ResourceData, met master, err := findMasterAccount(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Master Account (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/invite_accepter_test.go b/internal/service/securityhub/invite_accepter_test.go index 61d1e7fc892..99acb4791b0 100644 --- a/internal/service/securityhub/invite_accepter_test.go +++ b/internal/service/securityhub/invite_accepter_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -72,7 +72,7 @@ func testAccCheckInviteAccepterDestroy(ctx context.Context) resource.TestCheckFu _, err := tfsecurityhub.FindMasterAccount(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/member.go b/internal/service/securityhub/member.go index bf0b0772c1b..787b07cdabb 100644 --- a/internal/service/securityhub/member.go +++ b/internal/service/securityhub/member.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -115,7 +116,7 @@ func resourceMemberRead(ctx context.Context, d *schema.ResourceData, meta any) d member, err := findMemberByAccountID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Member (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -168,7 +169,7 @@ func resourceMemberDelete(ctx context.Context, d *schema.ResourceData, meta any) err = unprocessedAccountsError(output.UnprocessedAccounts) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { log.Printf("[WARN] Security Hub Insight (%s) not found, removing from state", d.Id()) return diags } diff --git a/internal/service/securityhub/member_test.go b/internal/service/securityhub/member_test.go index 8c88c64a117..423617b5195 100644 --- a/internal/service/securityhub/member_test.go +++ b/internal/service/securityhub/member_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckMemberDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsecurityhub.FindMemberByAccountID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/organization_admin_account.go b/internal/service/securityhub/organization_admin_account.go index 6ef3e8743fb..b473e68d693 100644 --- a/internal/service/securityhub/organization_admin_account.go +++ b/internal/service/securityhub/organization_admin_account.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -80,7 +81,7 @@ func resourceOrganizationAdminAccountRead(ctx context.Context, d *schema.Resourc adminAccount, err := findAdminAccountByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Organization Admin Account (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -170,7 +171,7 @@ func statusAdminAccount(ctx context.Context, conn *securityhub.Client, adminAcco return func() (any, string, error) { output, err := findAdminAccountByID(ctx, conn, adminAccountID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/securityhub/organization_admin_account_test.go b/internal/service/securityhub/organization_admin_account_test.go index ab159126154..57680fdb13b 100644 --- a/internal/service/securityhub/organization_admin_account_test.go +++ b/internal/service/securityhub/organization_admin_account_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -110,7 +110,7 @@ func testAccCheckOrganizationAdminAccountDestroy(ctx context.Context) resource.T _, err := tfsecurityhub.FindAdminAccountByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/organization_configuration.go b/internal/service/securityhub/organization_configuration.go index 207deafbf26..21b40f8763d 100644 --- a/internal/service/securityhub/organization_configuration.go +++ b/internal/service/securityhub/organization_configuration.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -125,7 +126,7 @@ func resourceOrganizationConfigurationRead(ctx context.Context, d *schema.Resour output, err := findOrganizationConfiguration(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Organization Configuration %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -208,7 +209,7 @@ func statusOrganizationConfiguration(ctx context.Context, conn *securityhub.Clie return func() (any, string, error) { output, err := findOrganizationConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/securityhub/organization_configuration_test.go b/internal/service/securityhub/organization_configuration_test.go index 9188f82d63e..b4ccc9c5b35 100644 --- a/internal/service/securityhub/organization_configuration_test.go +++ b/internal/service/securityhub/organization_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -167,7 +167,7 @@ func testAccCheckOrganizationConfigurationDestroy(ctx context.Context) resource. output, err := tfsecurityhub.FindOrganizationConfiguration(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/product_subscription.go b/internal/service/securityhub/product_subscription.go index 024f830347b..3b0f5af4ddf 100644 --- a/internal/service/securityhub/product_subscription.go +++ b/internal/service/securityhub/product_subscription.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -89,7 +90,7 @@ func resourceProductSubscriptionRead(ctx context.Context, d *schema.ResourceData _, err = findProductSubscriptionByARN(ctx, conn, productSubscriptionARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Product Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/product_subscription_test.go b/internal/service/securityhub/product_subscription_test.go index f33366d8914..6f777306ad8 100644 --- a/internal/service/securityhub/product_subscription_test.go +++ b/internal/service/securityhub/product_subscription_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -107,7 +107,7 @@ func testAccCheckProductSubscriptionDestroy(ctx context.Context) resource.TestCh _, err := tfsecurityhub.FindProductSubscriptionByARN(ctx, conn, rs.Primary.Attributes[names.AttrARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securityhub/standards_control.go b/internal/service/securityhub/standards_control.go index 3a890177cb3..0f72a13f23a 100644 --- a/internal/service/securityhub/standards_control.go +++ b/internal/service/securityhub/standards_control.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -120,7 +121,7 @@ func resourceStandardsControlRead(ctx context.Context, d *schema.ResourceData, m control, err := findStandardsControlByTwoPartKey(ctx, conn, standardsSubscriptionARN, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Standards Control (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/securityhub/standards_control_association.go b/internal/service/securityhub/standards_control_association.go index df65385117f..fcd3a56264f 100644 --- a/internal/service/securityhub/standards_control_association.go +++ b/internal/service/securityhub/standards_control_association.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func (r *standardsControlAssociationResource) Read(ctx context.Context, request securityControlID, standardsARN := data.SecurityControlID.ValueString(), data.StandardsARN.ValueString() output, err := findStandardsControlAssociationByTwoPartKey(ctx, conn, securityControlID, standardsARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/securityhub/standards_subscription.go b/internal/service/securityhub/standards_subscription.go index 6c8c65e5874..93f95d1ca78 100644 --- a/internal/service/securityhub/standards_subscription.go +++ b/internal/service/securityhub/standards_subscription.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -80,7 +81,7 @@ func resourceStandardsSubscriptionRead(ctx context.Context, d *schema.ResourceDa output, err := findStandardsSubscriptionByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Security Hub Standards Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -174,7 +175,7 @@ func statusStandardsSubscriptionCreate(ctx context.Context, conn *securityhub.Cl return func() (any, string, error) { output, err := findStandardsSubscriptionByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -190,7 +191,7 @@ func statusStandardsSubscriptionDelete(ctx context.Context, conn *securityhub.Cl return func() (any, string, error) { output, err := findStandardsSubscriptionByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/securityhub/standards_subscription_test.go b/internal/service/securityhub/standards_subscription_test.go index a330e12bb0c..683bcec39de 100644 --- a/internal/service/securityhub/standards_subscription_test.go +++ b/internal/service/securityhub/standards_subscription_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +99,7 @@ func testAccCheckStandardsSubscriptionDestroy(ctx context.Context) resource.Test output, err := tfsecurityhub.FindStandardsSubscriptionByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 527fe47907d603fc5b7d93cc4f554627a58a7fc0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:55 -0800 Subject: [PATCH 185/227] `securitylake` --- internal/service/securitylake/aws_log_source.go | 3 ++- internal/service/securitylake/aws_log_source_test.go | 4 ++-- internal/service/securitylake/custom_log_source.go | 3 ++- internal/service/securitylake/custom_log_source_test.go | 4 ++-- internal/service/securitylake/data_lake.go | 7 ++++--- internal/service/securitylake/data_lake_test.go | 4 ++-- internal/service/securitylake/subscriber.go | 5 +++-- internal/service/securitylake/subscriber_notification.go | 3 ++- .../service/securitylake/subscriber_notification_test.go | 4 ++-- internal/service/securitylake/subscriber_test.go | 4 ++-- 10 files changed, 23 insertions(+), 18 deletions(-) diff --git a/internal/service/securitylake/aws_log_source.go b/internal/service/securitylake/aws_log_source.go index d66a76231c3..2e2cae1cc99 100644 --- a/internal/service/securitylake/aws_log_source.go +++ b/internal/service/securitylake/aws_log_source.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -158,7 +159,7 @@ func (r *awsLogSourceResource) Read(ctx context.Context, request resource.ReadRe logSource, err := findAWSLogSourceBySourceName(ctx, conn, awstypes.AwsLogSourceName(data.ID.ValueString())) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/securitylake/aws_log_source_test.go b/internal/service/securitylake/aws_log_source_test.go index 13b09c1c815..168fb55ffb8 100644 --- a/internal/service/securitylake/aws_log_source_test.go +++ b/internal/service/securitylake/aws_log_source_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecuritylake "github.com/hashicorp/terraform-provider-aws/internal/service/securitylake" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -256,7 +256,7 @@ func testAccCheckAWSLogSourceDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsecuritylake.FindAWSLogSourceBySourceName(ctx, conn, types.AwsLogSourceName(rs.Primary.ID)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securitylake/custom_log_source.go b/internal/service/securitylake/custom_log_source.go index f5bc0279500..0dafab03500 100644 --- a/internal/service/securitylake/custom_log_source.go +++ b/internal/service/securitylake/custom_log_source.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -227,7 +228,7 @@ func (r *customLogSourceResource) Read(ctx context.Context, request resource.Rea sourceName := data.SourceName.ValueString() customLogSource, err := findCustomLogSourceBySourceName(ctx, conn, sourceName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/securitylake/custom_log_source_test.go b/internal/service/securitylake/custom_log_source_test.go index 976961f2507..6422c739f91 100644 --- a/internal/service/securitylake/custom_log_source_test.go +++ b/internal/service/securitylake/custom_log_source_test.go @@ -16,9 +16,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecuritylake "github.com/hashicorp/terraform-provider-aws/internal/service/securitylake" "github.com/hashicorp/terraform-provider-aws/internal/slices" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -280,7 +280,7 @@ func testAccCheckCustomLogSourceDestroy(ctx context.Context) resource.TestCheckF _, err := tfsecuritylake.FindCustomLogSourceBySourceName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securitylake/data_lake.go b/internal/service/securitylake/data_lake.go index 956e0a63af4..ab32aa26364 100644 --- a/internal/service/securitylake/data_lake.go +++ b/internal/service/securitylake/data_lake.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -248,7 +249,7 @@ func (r *dataLakeResource) Read(ctx context.Context, request resource.ReadReques dataLake, err := findDataLakeByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -415,7 +416,7 @@ func statusDataLakeCreate(ctx context.Context, conn *securitylake.Client, arn st return func() (any, string, error) { output, err := findDataLakeByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -431,7 +432,7 @@ func statusDataLakeUpdate(ctx context.Context, conn *securitylake.Client, arn st return func() (any, string, error) { output, err := findDataLakeByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/securitylake/data_lake_test.go b/internal/service/securitylake/data_lake_test.go index e9a32b0df12..c772b550f7f 100644 --- a/internal/service/securitylake/data_lake_test.go +++ b/internal/service/securitylake/data_lake_test.go @@ -22,8 +22,8 @@ import ( tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecuritylake "github.com/hashicorp/terraform-provider-aws/internal/service/securitylake" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -520,7 +520,7 @@ func testAccCheckDataLakeDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsecuritylake.FindDataLakeByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securitylake/subscriber.go b/internal/service/securitylake/subscriber.go index 48a6e359e04..9d30a968618 100644 --- a/internal/service/securitylake/subscriber.go +++ b/internal/service/securitylake/subscriber.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -234,7 +235,7 @@ func (r *subscriberResource) Read(ctx context.Context, request resource.ReadRequ output, err := findSubscriberByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -378,7 +379,7 @@ func statusSubscriber(ctx context.Context, conn *securitylake.Client, id string) return func() (any, string, error) { output, err := findSubscriberByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/securitylake/subscriber_notification.go b/internal/service/securitylake/subscriber_notification.go index 364d4096963..5fc788bd83a 100644 --- a/internal/service/securitylake/subscriber_notification.go +++ b/internal/service/securitylake/subscriber_notification.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +174,7 @@ func (r *subscriberNotificationResource) Read(ctx context.Context, request resou output, err := findSubscriberNotificationBySubscriberID(ctx, conn, data.SubscriberID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } diff --git a/internal/service/securitylake/subscriber_notification_test.go b/internal/service/securitylake/subscriber_notification_test.go index 4f7aa4992a4..0815bf8c941 100644 --- a/internal/service/securitylake/subscriber_notification_test.go +++ b/internal/service/securitylake/subscriber_notification_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecuritylake "github.com/hashicorp/terraform-provider-aws/internal/service/securitylake" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -385,7 +385,7 @@ func testAccCheckSubscriberNotificationDestroy(ctx context.Context) resource.Tes _, err := tfsecuritylake.FindSubscriberNotificationBySubscriberID(ctx, conn, rs.Primary.Attributes["subscriber_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/securitylake/subscriber_test.go b/internal/service/securitylake/subscriber_test.go index 13a56c2f2d3..15d38c9c6fd 100644 --- a/internal/service/securitylake/subscriber_test.go +++ b/internal/service/securitylake/subscriber_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsecuritylake "github.com/hashicorp/terraform-provider-aws/internal/service/securitylake" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -522,7 +522,7 @@ func testAccCheckSubscriberDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsecuritylake.FindSubscriberByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 242f0b17bcd68f0ddfeb8d05c95ee2f6c8632a05 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:56 -0800 Subject: [PATCH 186/227] `serverlessrepo` --- internal/service/serverlessrepo/cloudformation_stack.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/serverlessrepo/cloudformation_stack.go b/internal/service/serverlessrepo/cloudformation_stack.go index ebc3dc76c17..69da204adba 100644 --- a/internal/service/serverlessrepo/cloudformation_stack.go +++ b/internal/service/serverlessrepo/cloudformation_stack.go @@ -24,9 +24,9 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -140,7 +140,7 @@ func resourceCloudFormationStackRead(ctx context.Context, d *schema.ResourceData stack, err := tfcloudformation.FindStackByName(ctx, cfConn, d.Id()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { log.Printf("[WARN] Serverless Application Repository CloudFormation Stack (%s) not found, removing from state", d.Id()) d.SetId("") return diags From adda854b5f2e0872c41fdab33ffa74512eff2ecf Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:57 -0800 Subject: [PATCH 187/227] `servicecatalog` --- .../service/servicecatalog/budget_resource_association.go | 5 +++-- .../servicecatalog/budget_resource_association_test.go | 4 ++-- internal/service/servicecatalog/constraint.go | 5 +++-- internal/service/servicecatalog/portfolio.go | 3 ++- internal/service/servicecatalog/portfolio_share.go | 3 ++- internal/service/servicecatalog/portfolio_share_test.go | 4 ++-- internal/service/servicecatalog/portfolio_test.go | 4 ++-- .../servicecatalog/principal_portfolio_association.go | 3 ++- .../servicecatalog/principal_portfolio_association_test.go | 4 ++-- .../servicecatalog/product_portfolio_association.go | 5 +++-- .../servicecatalog/product_portfolio_association_test.go | 4 ++-- internal/service/servicecatalog/provisioned_product.go | 7 ++++--- .../service/servicecatalog/provisioned_product_test.go | 4 ++-- internal/service/servicecatalog/status.go | 4 ++-- .../servicecatalog/tag_option_resource_association.go | 5 +++-- .../servicecatalog/tag_option_resource_association_test.go | 4 ++-- 16 files changed, 38 insertions(+), 30 deletions(-) diff --git a/internal/service/servicecatalog/budget_resource_association.go b/internal/service/servicecatalog/budget_resource_association.go index 27b3eba0cfe..0c1002eaa13 100644 --- a/internal/service/servicecatalog/budget_resource_association.go +++ b/internal/service/servicecatalog/budget_resource_association.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -101,7 +102,7 @@ func resourceBudgetResourceAssociationRead(ctx context.Context, d *schema.Resour output, err := waitBudgetResourceAssociationReady(ctx, conn, budgetName, resourceID, d.Timeout(schema.TimeoutRead)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Budget Resource Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -148,7 +149,7 @@ func resourceBudgetResourceAssociationDelete(ctx context.Context, d *schema.Reso err = waitBudgetResourceAssociationDeleted(ctx, conn, budgetName, resourceID, d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "waiting for Service Catalog Budget Resource Disassociation (%s): %s", d.Id(), err) } diff --git a/internal/service/servicecatalog/budget_resource_association_test.go b/internal/service/servicecatalog/budget_resource_association_test.go index a951f7783ab..428ec890334 100644 --- a/internal/service/servicecatalog/budget_resource_association_test.go +++ b/internal/service/servicecatalog/budget_resource_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func testAccCheckBudgetResourceAssociationDestroy(ctx context.Context) resource. err = tfservicecatalog.WaitBudgetResourceAssociationDeleted(ctx, conn, budgetName, resourceID, tfservicecatalog.BudgetResourceAssociationDeleteTimeout) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicecatalog/constraint.go b/internal/service/servicecatalog/constraint.go index 7cface18f6d..49dc3c6fa41 100644 --- a/internal/service/servicecatalog/constraint.go +++ b/internal/service/servicecatalog/constraint.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -150,7 +151,7 @@ func resourceConstraintRead(ctx context.Context, d *schema.ResourceData, meta an output, err := waitConstraintReady(ctx, conn, d.Get("accept_language").(string), d.Id(), d.Timeout(schema.TimeoutRead)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Constraint (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -251,7 +252,7 @@ func resourceConstraintDelete(ctx context.Context, d *schema.ResourceData, meta err = waitConstraintDeleted(ctx, conn, d.Get("accept_language").(string), d.Id(), d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "waiting for Service Catalog Constraint (%s) to be deleted: %s", d.Id(), err) } diff --git a/internal/service/servicecatalog/portfolio.go b/internal/service/servicecatalog/portfolio.go index 70fc06dd784..764affb61b8 100644 --- a/internal/service/servicecatalog/portfolio.go +++ b/internal/service/servicecatalog/portfolio.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -113,7 +114,7 @@ func resourcePortfolioRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findPortfolioByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Portfolio (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicecatalog/portfolio_share.go b/internal/service/servicecatalog/portfolio_share.go index 8c1907bd6a6..d344bdac0c6 100644 --- a/internal/service/servicecatalog/portfolio_share.go +++ b/internal/service/servicecatalog/portfolio_share.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +200,7 @@ func resourcePortfolioShareRead(ctx context.Context, d *schema.ResourceData, met output, err := waitPortfolioShareReady(ctx, conn, portfolioID, shareType, principalID, waitForAcceptance, d.Timeout(schema.TimeoutRead)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Portfolio Share (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicecatalog/portfolio_share_test.go b/internal/service/servicecatalog/portfolio_share_test.go index 367383e15ed..e2e67316819 100644 --- a/internal/service/servicecatalog/portfolio_share_test.go +++ b/internal/service/servicecatalog/portfolio_share_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -199,7 +199,7 @@ func testAccCheckPortfolioShareDestroy(ctx context.Context) resource.TestCheckFu rs.Primary.Attributes["principal_id"], ) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicecatalog/portfolio_test.go b/internal/service/servicecatalog/portfolio_test.go index e307a2175a6..bd07c631b2c 100644 --- a/internal/service/servicecatalog/portfolio_test.go +++ b/internal/service/servicecatalog/portfolio_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +113,7 @@ func testAccCheckPortfolioDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfservicecatalog.FindPortfolioByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicecatalog/principal_portfolio_association.go b/internal/service/servicecatalog/principal_portfolio_association.go index f9a26b3810c..7eab2cb5bf0 100644 --- a/internal/service/servicecatalog/principal_portfolio_association.go +++ b/internal/service/servicecatalog/principal_portfolio_association.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -126,7 +127,7 @@ func resourcePrincipalPortfolioAssociationRead(ctx context.Context, d *schema.Re output, err := findPrincipalPortfolioAssociation(ctx, conn, acceptLanguage, principalARN, portfolioID, principalType) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Principal Portfolio Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicecatalog/principal_portfolio_association_test.go b/internal/service/servicecatalog/principal_portfolio_association_test.go index 31812f71ed9..e7b933b846a 100644 --- a/internal/service/servicecatalog/principal_portfolio_association_test.go +++ b/internal/service/servicecatalog/principal_portfolio_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -147,7 +147,7 @@ func testAccCheckPrincipalPortfolioAssociationDestroy(ctx context.Context) resou _, err = tfservicecatalog.FindPrincipalPortfolioAssociation(ctx, conn, acceptLanguage, principalARN, portfolioID, principalType) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicecatalog/product_portfolio_association.go b/internal/service/servicecatalog/product_portfolio_association.go index 1001cb36a44..dd584d0d992 100644 --- a/internal/service/servicecatalog/product_portfolio_association.go +++ b/internal/service/servicecatalog/product_portfolio_association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -120,7 +121,7 @@ func resourceProductPortfolioAssociationRead(ctx context.Context, d *schema.Reso output, err := waitProductPortfolioAssociationReady(ctx, conn, acceptLanguage, portfolioID, productID, d.Timeout(schema.TimeoutRead)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Product Portfolio Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -173,7 +174,7 @@ func resourceProductPortfolioAssociationDelete(ctx context.Context, d *schema.Re err = waitProductPortfolioAssociationDeleted(ctx, conn, acceptLanguage, portfolioID, productID, d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "waiting for Service Catalog Product Portfolio Disassociation (%s): %s", d.Id(), err) } diff --git a/internal/service/servicecatalog/product_portfolio_association_test.go b/internal/service/servicecatalog/product_portfolio_association_test.go index 4c914f4f155..2b7a50c96ca 100644 --- a/internal/service/servicecatalog/product_portfolio_association_test.go +++ b/internal/service/servicecatalog/product_portfolio_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func testAccCheckProductPortfolioAssociationDestroy(ctx context.Context) resourc err = tfservicecatalog.WaitProductPortfolioAssociationDeleted(ctx, conn, acceptLanguage, portfolioID, productID, tfservicecatalog.ProductPortfolioAssociationDeleteTimeout) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicecatalog/provisioned_product.go b/internal/service/servicecatalog/provisioned_product.go index dfb4fa177f2..b12de5a8d07 100644 --- a/internal/service/servicecatalog/provisioned_product.go +++ b/internal/service/servicecatalog/provisioned_product.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -377,7 +378,7 @@ func resourceProvisionedProductRead(ctx context.Context, d *schema.ResourceData, outputDPP, err := findProvisionedProductByTwoPartKey(ctx, conn, d.Id(), acceptLanguage) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Provisioned Product (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -420,7 +421,7 @@ func resourceProvisionedProductRead(ctx context.Context, d *schema.ResourceData, } outputDR, err := findRecordByTwoPartKey(ctx, conn, recordIdToUse, acceptLanguage) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Provisioned Product (%s) Record (%s) not found, unable to set tags", d.Id(), recordIdToUse) return diags } @@ -691,7 +692,7 @@ func statusProvisionedProduct(ctx context.Context, conn *servicecatalog.Client, return func() (any, string, error) { output, err := findProvisionedProductByTwoPartKey(ctx, conn, id, acceptLanguage) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/servicecatalog/provisioned_product_test.go b/internal/service/servicecatalog/provisioned_product_test.go index 2984edf4b08..ffc7bb03c13 100644 --- a/internal/service/servicecatalog/provisioned_product_test.go +++ b/internal/service/servicecatalog/provisioned_product_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -592,7 +592,7 @@ func testAccCheckProvisionedProductDestroy(ctx context.Context) resource.TestChe _, err := tfservicecatalog.FindProvisionedProductByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["accept_language"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicecatalog/status.go b/internal/service/servicecatalog/status.go index f8e2ffb7ae2..eb04022c34e 100644 --- a/internal/service/servicecatalog/status.go +++ b/internal/service/servicecatalog/status.go @@ -12,7 +12,7 @@ import ( awstypes "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/errs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusProduct(ctx context.Context, conn *servicecatalog.Client, acceptLanguage, productID string) sdkretry.StateRefreshFunc { @@ -104,7 +104,7 @@ func statusPortfolioShare(ctx context.Context, conn *servicecatalog.Client, port return func() (any, string, error) { output, err := findPortfolioShare(ctx, conn, portfolioID, shareType, principalID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/servicecatalog/tag_option_resource_association.go b/internal/service/servicecatalog/tag_option_resource_association.go index 0848c9d8b87..b566451cb6c 100644 --- a/internal/service/servicecatalog/tag_option_resource_association.go +++ b/internal/service/servicecatalog/tag_option_resource_association.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -118,7 +119,7 @@ func resourceTagOptionResourceAssociationRead(ctx context.Context, d *schema.Res output, err := waitTagOptionResourceAssociationReady(ctx, conn, tagOptionID, resourceID, d.Timeout(schema.TimeoutRead)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Catalog Tag Option Resource Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -172,7 +173,7 @@ func resourceTagOptionResourceAssociationDelete(ctx context.Context, d *schema.R err = waitTagOptionResourceAssociationDeleted(ctx, conn, tagOptionID, resourceID, d.Timeout(schema.TimeoutDelete)) - if err != nil && !tfresource.NotFound(err) { + if err != nil && !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "waiting for Service Catalog Tag Option Resource Disassociation (%s): %s", d.Id(), err) } diff --git a/internal/service/servicecatalog/tag_option_resource_association_test.go b/internal/service/servicecatalog/tag_option_resource_association_test.go index d17394c7866..348bc0aa575 100644 --- a/internal/service/servicecatalog/tag_option_resource_association_test.go +++ b/internal/service/servicecatalog/tag_option_resource_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -88,7 +88,7 @@ func testAccCheckTagOptionResourceAssociationDestroy(ctx context.Context) resour err = tfservicecatalog.WaitTagOptionResourceAssociationDeleted(ctx, conn, tagOptionID, resourceID, tfservicecatalog.TagOptionResourceAssociationDeleteTimeout) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 58c0d32b01564ee97f04d45822fed7a2852173d4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:57 -0800 Subject: [PATCH 188/227] `servicecatalogappregistry` --- internal/service/servicecatalogappregistry/application.go | 3 ++- internal/service/servicecatalogappregistry/attribute_group.go | 3 ++- .../servicecatalogappregistry/attribute_group_association.go | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/service/servicecatalogappregistry/application.go b/internal/service/servicecatalogappregistry/application.go index c4b0c0f7fbe..fcb7315b607 100644 --- a/internal/service/servicecatalogappregistry/application.go +++ b/internal/service/servicecatalogappregistry/application.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -120,7 +121,7 @@ func (r *applicationResource) Read(ctx context.Context, req resource.ReadRequest } out, err := findApplicationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/servicecatalogappregistry/attribute_group.go b/internal/service/servicecatalogappregistry/attribute_group.go index 5532b434336..20c6ad2e504 100644 --- a/internal/service/servicecatalogappregistry/attribute_group.go +++ b/internal/service/servicecatalogappregistry/attribute_group.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -129,7 +130,7 @@ func (r *attributeGroupResource) Read(ctx context.Context, req resource.ReadRequ } out, err := findAttributeGroupByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/servicecatalogappregistry/attribute_group_association.go b/internal/service/servicecatalogappregistry/attribute_group_association.go index 9f2b94500a6..e64a27d2ca7 100644 --- a/internal/service/servicecatalogappregistry/attribute_group_association.go +++ b/internal/service/servicecatalogappregistry/attribute_group_association.go @@ -22,7 +22,7 @@ import ( intflex "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -100,7 +100,7 @@ func (r *attributeGroupAssociationResource) Read(ctx context.Context, req resour } _, err := findAttributeGroupAssociationByTwoPartKey(ctx, conn, state.Application.ValueString(), state.AttributeGroup.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } From 9894f114a828d24e498310f6b3e59bf48e5cd2c9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:58 -0800 Subject: [PATCH 189/227] `servicediscovery` --- internal/service/servicediscovery/http_namespace.go | 3 ++- internal/service/servicediscovery/http_namespace_test.go | 4 ++-- internal/service/servicediscovery/instance.go | 3 ++- internal/service/servicediscovery/instance_test.go | 4 ++-- internal/service/servicediscovery/operation.go | 3 ++- internal/service/servicediscovery/private_dns_namespace.go | 4 ++-- .../service/servicediscovery/private_dns_namespace_test.go | 4 ++-- internal/service/servicediscovery/public_dns_namespace.go | 4 ++-- .../service/servicediscovery/public_dns_namespace_test.go | 4 ++-- internal/service/servicediscovery/service.go | 3 ++- internal/service/servicediscovery/service_test.go | 4 ++-- 11 files changed, 22 insertions(+), 18 deletions(-) diff --git a/internal/service/servicediscovery/http_namespace.go b/internal/service/servicediscovery/http_namespace.go index 94f6fb9b50d..b39027cdd89 100644 --- a/internal/service/servicediscovery/http_namespace.go +++ b/internal/service/servicediscovery/http_namespace.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -102,7 +103,7 @@ func resourceHTTPNamespaceRead(ctx context.Context, d *schema.ResourceData, meta ns, err := findNamespaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Discovery HTTP Namespace %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicediscovery/http_namespace_test.go b/internal/service/servicediscovery/http_namespace_test.go index 88abe1e6ca1..72b2e2e91ed 100644 --- a/internal/service/servicediscovery/http_namespace_test.go +++ b/internal/service/servicediscovery/http_namespace_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -171,7 +171,7 @@ func testAccCheckHTTPNamespaceDestroy(ctx context.Context) resource.TestCheckFun _, err := tfservicediscovery.FindNamespaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicediscovery/instance.go b/internal/service/servicediscovery/instance.go index 64dd9891dac..fe056b1bd30 100644 --- a/internal/service/servicediscovery/instance.go +++ b/internal/service/servicediscovery/instance.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -104,7 +105,7 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta any) instance, err := findInstanceByTwoPartKey(ctx, conn, d.Get("service_id").(string), d.Get(names.AttrInstanceID).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Discovery Instance (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicediscovery/instance_test.go b/internal/service/servicediscovery/instance_test.go index 2842e412ed8..434579b78c4 100644 --- a/internal/service/servicediscovery/instance_test.go +++ b/internal/service/servicediscovery/instance_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -191,7 +191,7 @@ func testAccCheckInstanceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfservicediscovery.FindInstanceByTwoPartKey(ctx, conn, rs.Primary.Attributes["service_id"], rs.Primary.Attributes[names.AttrInstanceID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicediscovery/operation.go b/internal/service/servicediscovery/operation.go index a42847b71ea..2ac1ed3cdcc 100644 --- a/internal/service/servicediscovery/operation.go +++ b/internal/service/servicediscovery/operation.go @@ -14,6 +14,7 @@ import ( sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -49,7 +50,7 @@ func statusOperation(ctx context.Context, conn *servicediscovery.Client, id stri return func() (any, string, error) { output, err := findOperationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/servicediscovery/private_dns_namespace.go b/internal/service/servicediscovery/private_dns_namespace.go index 7d5cddab7d4..043b17e306e 100644 --- a/internal/service/servicediscovery/private_dns_namespace.go +++ b/internal/service/servicediscovery/private_dns_namespace.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +113,7 @@ func resourcePrivateDNSNamespaceRead(ctx context.Context, d *schema.ResourceData ns, err := findNamespaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Discovery Private DNS Namespace %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicediscovery/private_dns_namespace_test.go b/internal/service/servicediscovery/private_dns_namespace_test.go index c68ec7e2240..92bdc544e41 100644 --- a/internal/service/servicediscovery/private_dns_namespace_test.go +++ b/internal/service/servicediscovery/private_dns_namespace_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckPrivateDNSNamespaceDestroy(ctx context.Context) resource.TestCh _, err := tfservicediscovery.FindNamespaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicediscovery/public_dns_namespace.go b/internal/service/servicediscovery/public_dns_namespace.go index 46cbed327ef..f7f80004857 100644 --- a/internal/service/servicediscovery/public_dns_namespace.go +++ b/internal/service/servicediscovery/public_dns_namespace.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -97,7 +97,7 @@ func resourcePublicDNSNamespaceRead(ctx context.Context, d *schema.ResourceData, ns, err := findNamespaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Discovery Public DNS Namespace %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicediscovery/public_dns_namespace_test.go b/internal/service/servicediscovery/public_dns_namespace_test.go index 3445a19ed22..885c5dc17ab 100644 --- a/internal/service/servicediscovery/public_dns_namespace_test.go +++ b/internal/service/servicediscovery/public_dns_namespace_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckPublicDNSNamespaceDestroy(ctx context.Context) resource.TestChe _, err := tfservicediscovery.FindNamespaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicediscovery/service.go b/internal/service/servicediscovery/service.go index b2576cf89a5..6ec3f409f2c 100644 --- a/internal/service/servicediscovery/service.go +++ b/internal/service/servicediscovery/service.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -208,7 +209,7 @@ func resourceServiceRead(ctx context.Context, d *schema.ResourceData, meta any) service, err := findServiceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Discovery Service (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/servicediscovery/service_test.go b/internal/service/servicediscovery/service_test.go index a633a5f79a3..3dc816503f5 100644 --- a/internal/service/servicediscovery/service_test.go +++ b/internal/service/servicediscovery/service_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -304,7 +304,7 @@ func testAccCheckServiceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfservicediscovery.FindServiceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From cb729011f5627a965b8a10e886454cd1eff43968 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:33:59 -0800 Subject: [PATCH 190/227] `servicequotas` --- internal/service/servicequotas/service_quota.go | 9 +++++---- .../service/servicequotas/service_quota_data_source.go | 3 ++- internal/service/servicequotas/template.go | 3 ++- internal/service/servicequotas/template_association.go | 3 ++- .../service/servicequotas/template_association_test.go | 4 ++-- internal/service/servicequotas/template_test.go | 4 ++-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/internal/service/servicequotas/service_quota.go b/internal/service/servicequotas/service_quota.go index a2d2160a5d5..58c13deaf49 100644 --- a/internal/service/servicequotas/service_quota.go +++ b/internal/service/servicequotas/service_quota.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +156,7 @@ func resourceServiceQuotaCreate(ctx context.Context, d *schema.ResourceData, met serviceQuota, err := findServiceQuotaByServiceCodeAndQuotaCode(ctx, conn, serviceCode, quotaCode) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendErrorf(diags, "reading Service Quotas Service Quota (%s/%s): %s", serviceCode, quotaCode, err) default: @@ -201,7 +202,7 @@ func resourceServiceQuotaRead(ctx context.Context, d *schema.ResourceData, meta // A Service Quota will always have a default value, but will only have a current value if it has been set. defaultQuota, err := findDefaultServiceQuotaByServiceCodeAndQuotaCode(ctx, conn, serviceCode, quotaCode) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Service Quotas default Service Quota (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -226,7 +227,7 @@ func resourceServiceQuotaRead(ctx context.Context, d *schema.ResourceData, meta serviceQuota, err := findServiceQuotaByServiceCodeAndQuotaCode(ctx, conn, serviceCode, quotaCode) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): tflog.Debug(ctx, "No quota value set", map[string]any{ "service_code": serviceCode, "quota_code": quotaCode, @@ -242,7 +243,7 @@ func resourceServiceQuotaRead(ctx context.Context, d *schema.ResourceData, meta output, err := findRequestedServiceQuotaChangeByID(ctx, conn, requestID) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): d.Set("request_id", "") d.Set("request_status", "") diff --git a/internal/service/servicequotas/service_quota_data_source.go b/internal/service/servicequotas/service_quota_data_source.go index 8cc58bec2b2..e786ce7ccbd 100644 --- a/internal/service/servicequotas/service_quota_data_source.go +++ b/internal/service/servicequotas/service_quota_data_source.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -158,7 +159,7 @@ func dataSourceServiceQuotaRead(ctx context.Context, d *schema.ResourceData, met serviceQuota, err := findServiceQuotaByServiceCodeAndQuotaCode(ctx, conn, serviceCode, quotaCode) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendErrorf(diags, "reading Service Quotas Service Quota (%s/%s): %s", serviceCode, quotaCode, err) default: diff --git a/internal/service/servicequotas/template.go b/internal/service/servicequotas/template.go index a5f3af1a4b3..684c94046d5 100644 --- a/internal/service/servicequotas/template.go +++ b/internal/service/servicequotas/template.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -176,7 +177,7 @@ func (r *templateResource) Read(ctx context.Context, request resource.ReadReques output, err := findTemplateByThreePartKey(ctx, conn, parts[0], parts[1], parts[2]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/servicequotas/template_association.go b/internal/service/servicequotas/template_association.go index eebe98f30d4..93ebb12d7d9 100644 --- a/internal/service/servicequotas/template_association.go +++ b/internal/service/servicequotas/template_association.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +85,7 @@ func (r *resourceTemplateAssociation) Read(ctx context.Context, request resource output, err := findTemplateAssociation(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/servicequotas/template_association_test.go b/internal/service/servicequotas/template_association_test.go index 56116484842..1a2b096163c 100644 --- a/internal/service/servicequotas/template_association_test.go +++ b/internal/service/servicequotas/template_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicequotas "github.com/hashicorp/terraform-provider-aws/internal/service/servicequotas" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -126,7 +126,7 @@ func testAccCheckTemplateAssociationDestroy(ctx context.Context) resource.TestCh _, err := tfservicequotas.FindTemplateAssociation(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/servicequotas/template_test.go b/internal/service/servicequotas/template_test.go index 29d8399b250..6f9cd301d14 100644 --- a/internal/service/servicequotas/template_test.go +++ b/internal/service/servicequotas/template_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfservicequotas "github.com/hashicorp/terraform-provider-aws/internal/service/servicequotas" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckTemplateDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfservicequotas.FindTemplateByThreePartKey(ctx, conn, rs.Primary.Attributes["aws_region"], rs.Primary.Attributes["quota_code"], rs.Primary.Attributes["service_code"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From f735e12c25e7c4b2c7817d2e657bb2870216be05 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:00 -0800 Subject: [PATCH 191/227] `ses` --- internal/service/ses/active_receipt_rule_set.go | 3 ++- internal/service/ses/active_receipt_rule_set_test.go | 4 ++-- internal/service/ses/configuration_set.go | 3 ++- internal/service/ses/configuration_set_test.go | 4 ++-- internal/service/ses/domain_dkim.go | 3 ++- internal/service/ses/domain_identity.go | 4 ++-- internal/service/ses/domain_identity_test.go | 4 ++-- internal/service/ses/domain_identity_verification.go | 3 ++- internal/service/ses/domain_mail_from.go | 3 ++- internal/service/ses/domain_mail_from_test.go | 4 ++-- internal/service/ses/email_identity.go | 3 ++- internal/service/ses/email_identity_test.go | 4 ++-- internal/service/ses/event_destination.go | 3 ++- internal/service/ses/event_destination_test.go | 4 ++-- internal/service/ses/identity_notification_topic.go | 3 ++- internal/service/ses/identity_policy.go | 3 ++- internal/service/ses/identity_policy_test.go | 4 ++-- internal/service/ses/receipt_filter.go | 3 ++- internal/service/ses/receipt_filter_test.go | 4 ++-- internal/service/ses/receipt_rule.go | 3 ++- internal/service/ses/receipt_rule_set.go | 3 ++- internal/service/ses/receipt_rule_set_test.go | 4 ++-- internal/service/ses/receipt_rule_test.go | 4 ++-- internal/service/ses/template.go | 3 ++- internal/service/ses/template_test.go | 4 ++-- 25 files changed, 50 insertions(+), 37 deletions(-) diff --git a/internal/service/ses/active_receipt_rule_set.go b/internal/service/ses/active_receipt_rule_set.go index f4dc71ace1d..c01b2668c2b 100644 --- a/internal/service/ses/active_receipt_rule_set.go +++ b/internal/service/ses/active_receipt_rule_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -75,7 +76,7 @@ func resourceActiveReceiptRuleSetRead(ctx context.Context, d *schema.ResourceDat output, err := findActiveReceiptRuleSet(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Active Receipt Rule Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/active_receipt_rule_set_test.go b/internal/service/ses/active_receipt_rule_set_test.go index 9e8b6222aa7..79c5fffcf10 100644 --- a/internal/service/ses/active_receipt_rule_set_test.go +++ b/internal/service/ses/active_receipt_rule_set_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckActiveReceiptRuleSetDestroy(ctx context.Context) resource.TestC _, err := tfses.FindActiveReceiptRuleSet(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/configuration_set.go b/internal/service/ses/configuration_set.go index 6cd75effb90..6b59306f407 100644 --- a/internal/service/ses/configuration_set.go +++ b/internal/service/ses/configuration_set.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +186,7 @@ func resourceConfigurationSetRead(ctx context.Context, d *schema.ResourceData, m output, err := findConfigurationSet(ctx, conn, input) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Configuration Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/configuration_set_test.go b/internal/service/ses/configuration_set_test.go index ec395bfba85..ae42c8de9a3 100644 --- a/internal/service/ses/configuration_set_test.go +++ b/internal/service/ses/configuration_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -398,7 +398,7 @@ func testAccCheckConfigurationSetDestroy(ctx context.Context) resource.TestCheck _, err := tfses.FindConfigurationSetByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/domain_dkim.go b/internal/service/ses/domain_dkim.go index b7b68cda9a8..bb8943e7647 100644 --- a/internal/service/ses/domain_dkim.go +++ b/internal/service/ses/domain_dkim.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -71,7 +72,7 @@ func resourceDomainDKIMRead(ctx context.Context, d *schema.ResourceData, meta an verificationAttrs, err := findIdentityDKIMAttributesByIdentity(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Domain DKIM (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/domain_identity.go b/internal/service/ses/domain_identity.go index dd6bdc47beb..654a6b1a549 100644 --- a/internal/service/ses/domain_identity.go +++ b/internal/service/ses/domain_identity.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -76,7 +76,7 @@ func resourceDomainIdentityRead(ctx context.Context, d *schema.ResourceData, met verificationAttrs, err := findIdentityVerificationAttributesByIdentity(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Domain Identity (%s) verification not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/domain_identity_test.go b/internal/service/ses/domain_identity_test.go index a637faeb7bd..73d9e4dca06 100644 --- a/internal/service/ses/domain_identity_test.go +++ b/internal/service/ses/domain_identity_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -98,7 +98,7 @@ func testAccCheckDomainIdentityDestroy(ctx context.Context) resource.TestCheckFu _, err := tfses.FindIdentityVerificationAttributesByIdentity(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/domain_identity_verification.go b/internal/service/ses/domain_identity_verification.go index 2128fc8074c..688dbedda8e 100644 --- a/internal/service/ses/domain_identity_verification.go +++ b/internal/service/ses/domain_identity_verification.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -86,7 +87,7 @@ func resourceDomainIdentityVerificationRead(ctx context.Context, d *schema.Resou } } - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Domain Identity Verification (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/domain_mail_from.go b/internal/service/ses/domain_mail_from.go index 5270eb91a30..8f8983fdd4e 100644 --- a/internal/service/ses/domain_mail_from.go +++ b/internal/service/ses/domain_mail_from.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -82,7 +83,7 @@ func resourceDomainMailFromRead(ctx context.Context, d *schema.ResourceData, met attributes, err := findIdentityMailFromDomainAttributesByIdentity(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES MAIL FROM Domain (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/domain_mail_from_test.go b/internal/service/ses/domain_mail_from_test.go index c67348fee3d..72aa12f46cd 100644 --- a/internal/service/ses/domain_mail_from_test.go +++ b/internal/service/ses/domain_mail_from_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -169,7 +169,7 @@ func testAccCheckDomainMailFromDestroy(ctx context.Context) resource.TestCheckFu _, err := tfses.FindIdentityMailFromDomainAttributesByIdentity(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/email_identity.go b/internal/service/ses/email_identity.go index 2b80012a9aa..b5eab9c9b37 100644 --- a/internal/service/ses/email_identity.go +++ b/internal/service/ses/email_identity.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -76,7 +77,7 @@ func resourceEmailIdentityRead(ctx context.Context, d *schema.ResourceData, meta _, err := findIdentityVerificationAttributesByIdentity(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Email Identity (%s) verification not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/email_identity_test.go b/internal/service/ses/email_identity_test.go index b0b505f5595..05744ebfcdb 100644 --- a/internal/service/ses/email_identity_test.go +++ b/internal/service/ses/email_identity_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func testAccCheckEmailIdentityDestroy(ctx context.Context) resource.TestCheckFun _, err := tfses.FindIdentityVerificationAttributesByIdentity(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/event_destination.go b/internal/service/ses/event_destination.go index 56b394bd08c..60cf2c7f7e9 100644 --- a/internal/service/ses/event_destination.go +++ b/internal/service/ses/event_destination.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -198,7 +199,7 @@ func resourceEventDestinationRead(ctx context.Context, d *schema.ResourceData, m configurationSetName := d.Get("configuration_set_name").(string) eventDestination, err := findEventDestinationByTwoPartKey(ctx, conn, configurationSetName, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Configuration Set Event Destination (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/event_destination_test.go b/internal/service/ses/event_destination_test.go index 43d56b10429..0e436eb173c 100644 --- a/internal/service/ses/event_destination_test.go +++ b/internal/service/ses/event_destination_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -301,7 +301,7 @@ func testAccCheckEventDestinationDestroy(ctx context.Context) resource.TestCheck _, err := tfses.FindEventDestinationByTwoPartKey(ctx, conn, rs.Primary.Attributes["configuration_set_name"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/identity_notification_topic.go b/internal/service/ses/identity_notification_topic.go index 5352ad406da..3db13d32b17 100644 --- a/internal/service/ses/identity_notification_topic.go +++ b/internal/service/ses/identity_notification_topic.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -115,7 +116,7 @@ func resourceIdentityNotificationTopicRead(ctx context.Context, d *schema.Resour notificationAttributes, err := findIdentityNotificationAttributesByIdentity(ctx, conn, identity) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Identity Notification Topic (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/identity_policy.go b/internal/service/ses/identity_policy.go index cf2e6cadac8..1b0a4063cfb 100644 --- a/internal/service/ses/identity_policy.go +++ b/internal/service/ses/identity_policy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -97,7 +98,7 @@ func resourceIdentityPolicyRead(ctx context.Context, d *schema.ResourceData, met policy, err := findIdentityPolicyByTwoPartKey(ctx, conn, identity, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Identity Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/identity_policy_test.go b/internal/service/ses/identity_policy_test.go index 8c53f2cdae3..b848415aa07 100644 --- a/internal/service/ses/identity_policy_test.go +++ b/internal/service/ses/identity_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -153,7 +153,7 @@ func testAccCheckIdentityPolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfses.FindIdentityPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["identity"], rs.Primary.Attributes[names.AttrName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/receipt_filter.go b/internal/service/ses/receipt_filter.go index 45027b56179..843f8bdbe09 100644 --- a/internal/service/ses/receipt_filter.go +++ b/internal/service/ses/receipt_filter.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -102,7 +103,7 @@ func resourceReceiptFilterRead(ctx context.Context, d *schema.ResourceData, meta filter, err := findReceiptFilterByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Receipt Filter (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/receipt_filter_test.go b/internal/service/ses/receipt_filter_test.go index eca0b9954a5..10acce0bd95 100644 --- a/internal/service/ses/receipt_filter_test.go +++ b/internal/service/ses/receipt_filter_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -82,7 +82,7 @@ func testAccCheckReceiptFilterDestroy(ctx context.Context) resource.TestCheckFun _, err := tfses.FindReceiptFilterByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/receipt_rule.go b/internal/service/ses/receipt_rule.go index 46a7b725c66..400c4517827 100644 --- a/internal/service/ses/receipt_rule.go +++ b/internal/service/ses/receipt_rule.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -327,7 +328,7 @@ func resourceReceiptRuleRead(ctx context.Context, d *schema.ResourceData, meta a ruleSetName := d.Get("rule_set_name").(string) rule, err := findReceiptRuleByTwoPartKey(ctx, conn, d.Id(), ruleSetName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Receipt Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/receipt_rule_set.go b/internal/service/ses/receipt_rule_set.go index c9f0d644c56..791612fd964 100644 --- a/internal/service/ses/receipt_rule_set.go +++ b/internal/service/ses/receipt_rule_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -75,7 +76,7 @@ func resourceReceiptRuleSetRead(ctx context.Context, d *schema.ResourceData, met output, err := findReceiptRuleSetByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Receipt Rule Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/receipt_rule_set_test.go b/internal/service/ses/receipt_rule_set_test.go index 922398c00c0..bf5603e9280 100644 --- a/internal/service/ses/receipt_rule_set_test.go +++ b/internal/service/ses/receipt_rule_set_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -80,7 +80,7 @@ func testAccCheckReceiptRuleSetDestroy(ctx context.Context) resource.TestCheckFu _, err := tfses.FindReceiptRuleSetByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/receipt_rule_test.go b/internal/service/ses/receipt_rule_test.go index 98401c3c994..a21bfdb2e69 100644 --- a/internal/service/ses/receipt_rule_test.go +++ b/internal/service/ses/receipt_rule_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -428,7 +428,7 @@ func testAccCheckReceiptRuleDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfses.FindReceiptRuleByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["rule_set_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ses/template.go b/internal/service/ses/template.go index 7540f755c3e..0ab9ca211df 100644 --- a/internal/service/ses/template.go +++ b/internal/service/ses/template.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -105,7 +106,7 @@ func resourceTemplateRead(ctx context.Context, d *schema.ResourceData, meta any) template, err := findTemplateByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SES Template (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ses/template_test.go b/internal/service/ses/template_test.go index b530d284c32..4ee940eb43a 100644 --- a/internal/service/ses/template_test.go +++ b/internal/service/ses/template_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -158,7 +158,7 @@ func testAccCheckTemplateDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfses.FindTemplateByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 546bff686b5042bec7a969d945707b0843c85f74 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:01 -0800 Subject: [PATCH 192/227] `sesv2` --- internal/service/sesv2/account_suppression_attributes.go | 3 ++- internal/service/sesv2/account_vdm_attributes.go | 3 ++- internal/service/sesv2/account_vdm_attributes_test.go | 4 ++-- internal/service/sesv2/configuration_set.go | 3 ++- internal/service/sesv2/configuration_set_event_destination.go | 3 ++- .../service/sesv2/configuration_set_event_destination_test.go | 4 ++-- internal/service/sesv2/configuration_set_test.go | 4 ++-- internal/service/sesv2/contact_list.go | 3 ++- internal/service/sesv2/contact_list_test.go | 4 ++-- internal/service/sesv2/dedicated_ip_assignment.go | 3 ++- internal/service/sesv2/dedicated_ip_assignment_test.go | 4 ++-- internal/service/sesv2/dedicated_ip_pool.go | 3 ++- internal/service/sesv2/dedicated_ip_pool_test.go | 4 ++-- internal/service/sesv2/email_identity.go | 3 ++- internal/service/sesv2/email_identity_feedback_attributes.go | 4 ++-- internal/service/sesv2/email_identity_mail_from_attributes.go | 4 ++-- internal/service/sesv2/email_identity_policy.go | 3 ++- internal/service/sesv2/email_identity_policy_test.go | 4 ++-- internal/service/sesv2/email_identity_test.go | 4 ++-- 19 files changed, 38 insertions(+), 29 deletions(-) diff --git a/internal/service/sesv2/account_suppression_attributes.go b/internal/service/sesv2/account_suppression_attributes.go index 03e179db810..a20534f0ab6 100644 --- a/internal/service/sesv2/account_suppression_attributes.go +++ b/internal/service/sesv2/account_suppression_attributes.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -87,7 +88,7 @@ func (r *accountSuppressionAttributesResource) Read(ctx context.Context, request suppressionAttributes, err := findAccountSuppressionAttributes(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/sesv2/account_vdm_attributes.go b/internal/service/sesv2/account_vdm_attributes.go index 913283f60b3..6b4d5bbe139 100644 --- a/internal/service/sesv2/account_vdm_attributes.go +++ b/internal/service/sesv2/account_vdm_attributes.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +116,7 @@ func resourceAccountVDMAttributesRead(ctx context.Context, d *schema.ResourceDat out, err := findAccountVDMAttributes(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 AccountVDMAttributes (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/account_vdm_attributes_test.go b/internal/service/sesv2/account_vdm_attributes_test.go index ee59baa5fce..baf8b9d861f 100644 --- a/internal/service/sesv2/account_vdm_attributes_test.go +++ b/internal/service/sesv2/account_vdm_attributes_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -154,7 +154,7 @@ func testAccCheckAccountVDMAttributesDestroy(ctx context.Context) resource.TestC output, err := tfsesv2.FindAccountVDMAttributes(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/configuration_set.go b/internal/service/sesv2/configuration_set.go index b0adca266f9..81f95ffbb71 100644 --- a/internal/service/sesv2/configuration_set.go +++ b/internal/service/sesv2/configuration_set.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -252,7 +253,7 @@ func resourceConfigurationSetRead(ctx context.Context, d *schema.ResourceData, m output, err := findConfigurationSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 ConfigurationSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/configuration_set_event_destination.go b/internal/service/sesv2/configuration_set_event_destination.go index 671bdf83686..fb55ef65150 100644 --- a/internal/service/sesv2/configuration_set_event_destination.go +++ b/internal/service/sesv2/configuration_set_event_destination.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -260,7 +261,7 @@ func resourceConfigurationSetEventDestinationRead(ctx context.Context, d *schema out, err := findConfigurationSetEventDestinationByTwoPartKey(ctx, conn, configurationSetName, eventDestinationName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 ConfigurationSetEventDestination (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/configuration_set_event_destination_test.go b/internal/service/sesv2/configuration_set_event_destination_test.go index 334afe8c81c..bd874c7ff8a 100644 --- a/internal/service/sesv2/configuration_set_event_destination_test.go +++ b/internal/service/sesv2/configuration_set_event_destination_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -285,7 +285,7 @@ func testAccCheckConfigurationSetEventDestinationDestroy(ctx context.Context) re _, err := tfsesv2.FindConfigurationSetEventDestinationByTwoPartKey(ctx, conn, rs.Primary.Attributes["configuration_set_name"], rs.Primary.Attributes["event_destination_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/configuration_set_test.go b/internal/service/sesv2/configuration_set_test.go index be44ca14005..f858b5163a2 100644 --- a/internal/service/sesv2/configuration_set_test.go +++ b/internal/service/sesv2/configuration_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -353,7 +353,7 @@ func testAccCheckConfigurationSetDestroy(ctx context.Context) resource.TestCheck _, err := tfsesv2.FindConfigurationSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/contact_list.go b/internal/service/sesv2/contact_list.go index abc19e690cf..6e3029eb5bd 100644 --- a/internal/service/sesv2/contact_list.go +++ b/internal/service/sesv2/contact_list.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -134,7 +135,7 @@ func resourceContactListRead(ctx context.Context, d *schema.ResourceData, meta a out, err := findContactListByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 ContactList (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/contact_list_test.go b/internal/service/sesv2/contact_list_test.go index 658c59274c7..c0f9f7fbc9d 100644 --- a/internal/service/sesv2/contact_list_test.go +++ b/internal/service/sesv2/contact_list_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckContactListDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsesv2.FindContactListByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/dedicated_ip_assignment.go b/internal/service/sesv2/dedicated_ip_assignment.go index cca452d3360..d77588f392d 100644 --- a/internal/service/sesv2/dedicated_ip_assignment.go +++ b/internal/service/sesv2/dedicated_ip_assignment.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +95,7 @@ func resourceDedicatedIPAssignmentRead(ctx context.Context, d *schema.ResourceDa out, err := findDedicatedIPByTwoPartKey(ctx, conn, ip, destinationPoolName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 DedicatedIPAssignment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/dedicated_ip_assignment_test.go b/internal/service/sesv2/dedicated_ip_assignment_test.go index cdaa5b13398..3b7b25cc738 100644 --- a/internal/service/sesv2/dedicated_ip_assignment_test.go +++ b/internal/service/sesv2/dedicated_ip_assignment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -102,7 +102,7 @@ func testAccCheckDedicatedIPAssignmentDestroy(ctx context.Context) resource.Test _, err := tfsesv2.FindDedicatedIPByTwoPartKey(ctx, conn, rs.Primary.Attributes["ip"], rs.Primary.Attributes["destination_pool_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/dedicated_ip_pool.go b/internal/service/sesv2/dedicated_ip_pool.go index 8f83810fc47..6ffce91dcef 100644 --- a/internal/service/sesv2/dedicated_ip_pool.go +++ b/internal/service/sesv2/dedicated_ip_pool.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -94,7 +95,7 @@ func resourceDedicatedIPPoolRead(ctx context.Context, d *schema.ResourceData, me out, err := findDedicatedIPPoolByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 DedicatedIPPool (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/dedicated_ip_pool_test.go b/internal/service/sesv2/dedicated_ip_pool_test.go index 556246b5a49..9d4e47a5d33 100644 --- a/internal/service/sesv2/dedicated_ip_pool_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -119,7 +119,7 @@ func testAccCheckDedicatedIPPoolDestroy(ctx context.Context) resource.TestCheckF _, err := tfsesv2.FindDedicatedIPPoolByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/email_identity.go b/internal/service/sesv2/email_identity.go index 590c9e42ee7..747016eccf9 100644 --- a/internal/service/sesv2/email_identity.go +++ b/internal/service/sesv2/email_identity.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -168,7 +169,7 @@ func resourceEmailIdentityRead(ctx context.Context, d *schema.ResourceData, meta out, err := findEmailIdentityByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 EmailIdentity (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/email_identity_feedback_attributes.go b/internal/service/sesv2/email_identity_feedback_attributes.go index 46f5f2c4aaa..6bb328951e0 100644 --- a/internal/service/sesv2/email_identity_feedback_attributes.go +++ b/internal/service/sesv2/email_identity_feedback_attributes.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -80,7 +80,7 @@ func resourceEmailIdentityFeedbackAttributesRead(ctx context.Context, d *schema. out, err := findEmailIdentityByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 EmailIdentityFeedbackAttributes (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/email_identity_mail_from_attributes.go b/internal/service/sesv2/email_identity_mail_from_attributes.go index 566a2b01989..6de477a590a 100644 --- a/internal/service/sesv2/email_identity_mail_from_attributes.go +++ b/internal/service/sesv2/email_identity_mail_from_attributes.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -99,7 +99,7 @@ func resourceEmailIdentityMailFromAttributesRead(ctx context.Context, d *schema. out, err := findEmailIdentityByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 EmailIdentityMailFromAttributes (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/email_identity_policy.go b/internal/service/sesv2/email_identity_policy.go index fea1849a148..7ac60a17f87 100644 --- a/internal/service/sesv2/email_identity_policy.go +++ b/internal/service/sesv2/email_identity_policy.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -114,7 +115,7 @@ func resourceEmailIdentityPolicyRead(ctx context.Context, d *schema.ResourceData out, err := findEmailIdentityPolicyByTwoPartKey(ctx, conn, emailIdentity, policyName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SESV2 EmailIdentityPolicy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sesv2/email_identity_policy_test.go b/internal/service/sesv2/email_identity_policy_test.go index bdf47bdb777..d1db3ad06c5 100644 --- a/internal/service/sesv2/email_identity_policy_test.go +++ b/internal/service/sesv2/email_identity_policy_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func testAccCheckEmailIdentityPolicyDestroy(ctx context.Context) resource.TestCh _, err := tfsesv2.FindEmailIdentityPolicyByTwoPartKey(ctx, conn, rs.Primary.Attributes["email_identity"], rs.Primary.Attributes["policy_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sesv2/email_identity_test.go b/internal/service/sesv2/email_identity_test.go index d8962888506..4d1d90e5bef 100644 --- a/internal/service/sesv2/email_identity_test.go +++ b/internal/service/sesv2/email_identity_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsesv2 "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -246,7 +246,7 @@ func testAccCheckEmailIdentityDestroy(ctx context.Context) resource.TestCheckFun _, err := tfsesv2.FindEmailIdentityByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 33648bccfc41aca7c544c6c71fe7796b7a3f5459 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:02 -0800 Subject: [PATCH 193/227] `sfn` --- internal/service/sfn/activity.go | 3 ++- internal/service/sfn/activity_test.go | 3 ++- internal/service/sfn/alias.go | 3 ++- internal/service/sfn/alias_test.go | 4 ++-- internal/service/sfn/state_machine.go | 5 +++-- internal/service/sfn/state_machine_test.go | 4 ++-- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/service/sfn/activity.go b/internal/service/sfn/activity.go index c67e6959cdf..bdc2372a2bd 100644 --- a/internal/service/sfn/activity.go +++ b/internal/service/sfn/activity.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -113,7 +114,7 @@ func resourceActivityRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findActivityByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Step Functions Activity (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sfn/activity_test.go b/internal/service/sfn/activity_test.go index aea11b5ab1a..9cf9ae1c55b 100644 --- a/internal/service/sfn/activity_test.go +++ b/internal/service/sfn/activity_test.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsfn "github.com/hashicorp/terraform-provider-aws/internal/service/sfn" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -207,7 +208,7 @@ func testAccCheckActivityDestroy(ctx context.Context) resource.TestCheckFunc { err := tfresource.Retry(ctx, 1*time.Minute, func(ctx context.Context) *tfresource.RetryError { _, err := tfsfn.FindActivityByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/sfn/alias.go b/internal/service/sfn/alias.go index 7bb7c8e5331..7f48adfbaeb 100644 --- a/internal/service/sfn/alias.go +++ b/internal/service/sfn/alias.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +115,7 @@ func resourceAliasRead(ctx context.Context, d *schema.ResourceData, meta any) di out, err := findAliasByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SFN Alias (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sfn/alias_test.go b/internal/service/sfn/alias_test.go index d5944e4be6c..a3f3e516b48 100644 --- a/internal/service/sfn/alias_test.go +++ b/internal/service/sfn/alias_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsfn "github.com/hashicorp/terraform-provider-aws/internal/service/sfn" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +112,7 @@ func testAccCheckAliasDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsfn.FindAliasByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sfn/state_machine.go b/internal/service/sfn/state_machine.go index a0fcf4e0561..008719dbc2c 100644 --- a/internal/service/sfn/state_machine.go +++ b/internal/service/sfn/state_machine.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -252,7 +253,7 @@ func resourceStateMachineRead(ctx context.Context, d *schema.ResourceData, meta output, err := findStateMachineByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Step Functions State Machine (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -441,7 +442,7 @@ func statusStateMachine(ctx context.Context, conn *sfn.Client, stateMachineArn s return func() (any, string, error) { output, err := findStateMachineByARN(ctx, conn, stateMachineArn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/sfn/state_machine_test.go b/internal/service/sfn/state_machine_test.go index 69d3b2b4b07..d5d7c1f7414 100644 --- a/internal/service/sfn/state_machine_test.go +++ b/internal/service/sfn/state_machine_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsfn "github.com/hashicorp/terraform-provider-aws/internal/service/sfn" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -644,7 +644,7 @@ func testAccCheckStateMachineDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsfn.FindStateMachineByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 33445857baae0dd3d5da48958fc822733e973022 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:03 -0800 Subject: [PATCH 194/227] `shield` --- .../service/shield/application_layer_automatic_response.go | 5 +++-- .../shield/application_layer_automatic_response_test.go | 4 ++-- internal/service/shield/drt_access_log_bucket_association.go | 3 ++- .../service/shield/drt_access_log_bucket_association_test.go | 4 ++-- internal/service/shield/drt_access_role_arn_association.go | 3 ++- .../service/shield/drt_access_role_arn_association_test.go | 4 ++-- internal/service/shield/proactive_engagement.go | 3 ++- internal/service/shield/proactive_engagement_test.go | 4 ++-- internal/service/shield/protection.go | 3 ++- internal/service/shield/protection_group.go | 3 ++- internal/service/shield/protection_test.go | 4 ++-- 11 files changed, 23 insertions(+), 17 deletions(-) diff --git a/internal/service/shield/application_layer_automatic_response.go b/internal/service/shield/application_layer_automatic_response.go index 0e3319799ea..67736309c76 100644 --- a/internal/service/shield/application_layer_automatic_response.go +++ b/internal/service/shield/application_layer_automatic_response.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -144,7 +145,7 @@ func (r *applicationLayerAutomaticResponseResource) Read(ctx context.Context, re resourceARN := data.ID.ValueString() output, err := findApplicationLayerAutomaticResponseByResourceARN(ctx, conn, resourceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -270,7 +271,7 @@ func statusApplicationLayerAutomaticResponse(ctx context.Context, conn *shield.C return func() (any, string, error) { output, err := findApplicationLayerAutomaticResponseByResourceARN(ctx, conn, resourceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/shield/application_layer_automatic_response_test.go b/internal/service/shield/application_layer_automatic_response_test.go index 85f26c2a6c5..fd32b83f2ae 100644 --- a/internal/service/shield/application_layer_automatic_response_test.go +++ b/internal/service/shield/application_layer_automatic_response_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func testAccCheckApplicationLayerAutomaticResponseDestroy(ctx context.Context) r _, err := tfshield.FindApplicationLayerAutomaticResponseByResourceARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/shield/drt_access_log_bucket_association.go b/internal/service/shield/drt_access_log_bucket_association.go index 7e95d5d233b..36bdd9d1f1a 100644 --- a/internal/service/shield/drt_access_log_bucket_association.go +++ b/internal/service/shield/drt_access_log_bucket_association.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -131,7 +132,7 @@ func (r *drtAccessLogBucketAssociationResource) Read(ctx context.Context, reques logBucket := data.ID.ValueString() _, err := findDRTLogBucketAssociation(ctx, conn, logBucket) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/shield/drt_access_log_bucket_association_test.go b/internal/service/shield/drt_access_log_bucket_association_test.go index 55cded75001..afdb1d4c870 100644 --- a/internal/service/shield/drt_access_log_bucket_association_test.go +++ b/internal/service/shield/drt_access_log_bucket_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func testAccDRTAccessLogBucketAssociation_basic(t *testing.T) { @@ -114,7 +114,7 @@ func testAccCheckDRTAccessLogBucketAssociationDestroy(ctx context.Context) resou _, err := tfshield.FindDRTLogBucketAssociation(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/shield/drt_access_role_arn_association.go b/internal/service/shield/drt_access_role_arn_association.go index f90017c9ba2..c76279dfccd 100644 --- a/internal/service/shield/drt_access_role_arn_association.go +++ b/internal/service/shield/drt_access_role_arn_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +112,7 @@ func (r *drtAccessRoleARNAssociationResource) Read(ctx context.Context, request output, err := findDRTAccess(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/shield/drt_access_role_arn_association_test.go b/internal/service/shield/drt_access_role_arn_association_test.go index 5374937c124..c5e39ee9ab0 100644 --- a/internal/service/shield/drt_access_role_arn_association_test.go +++ b/internal/service/shield/drt_access_role_arn_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +91,7 @@ func testAccCheckDRTAccessRoleARNAssociationDestroy(ctx context.Context) resourc _, err := tfshield.FindDRTRoleARNAssociation(ctx, conn, rs.Primary.Attributes[names.AttrRoleARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/shield/proactive_engagement.go b/internal/service/shield/proactive_engagement.go index d62da9f6e4e..1afc241259b 100644 --- a/internal/service/shield/proactive_engagement.go +++ b/internal/service/shield/proactive_engagement.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -141,7 +142,7 @@ func (r *proactiveEngagementResource) Read(ctx context.Context, request resource emergencyContacts, err = findEmergencyContactSettings(ctx, conn) } - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/shield/proactive_engagement_test.go b/internal/service/shield/proactive_engagement_test.go index 109aee2bfb0..3d084701ac1 100644 --- a/internal/service/shield/proactive_engagement_test.go +++ b/internal/service/shield/proactive_engagement_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -123,7 +123,7 @@ func testAccCheckProactiveEngagementAssociationDestroy(ctx context.Context) reso _, err := tfshield.FindEmergencyContactSettings(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/shield/protection.go b/internal/service/shield/protection.go index bd235be46a2..fe7bf302cce 100644 --- a/internal/service/shield/protection.go +++ b/internal/service/shield/protection.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -85,7 +86,7 @@ func resourceProtectionRead(ctx context.Context, d *schema.ResourceData, meta an protection, err := findProtectionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Shield Protection (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/shield/protection_group.go b/internal/service/shield/protection_group.go index fabbec60906..8f6de3360a9 100644 --- a/internal/service/shield/protection_group.go +++ b/internal/service/shield/protection_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -120,7 +121,7 @@ func resourceProtectionGroupRead(ctx context.Context, d *schema.ResourceData, me resp, err := findProtectionGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Shield Protection Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/shield/protection_test.go b/internal/service/shield/protection_test.go index 6d1e190de02..72118b22353 100644 --- a/internal/service/shield/protection_test.go +++ b/internal/service/shield/protection_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -304,7 +304,7 @@ func testAccCheckProtectionDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfshield.FindProtectionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5f46a68a258101d5492e7ba26a38295490f847b7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:04 -0800 Subject: [PATCH 195/227] `signer` --- internal/service/signer/signing_job.go | 5 +++-- internal/service/signer/signing_profile.go | 3 ++- internal/service/signer/signing_profile_permission.go | 3 ++- internal/service/signer/signing_profile_permission_test.go | 4 ++-- internal/service/signer/signing_profile_test.go | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/service/signer/signing_job.go b/internal/service/signer/signing_job.go index e569f0c55da..490b7d3a8d1 100644 --- a/internal/service/signer/signing_job.go +++ b/internal/service/signer/signing_job.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -244,7 +245,7 @@ func resourceSigningJobRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findSigningJobByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Signer Signing Job (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -312,7 +313,7 @@ func statusSigningJob(ctx context.Context, conn *signer.Client, id string) sdkre return func() (any, string, error) { output, err := findSigningJobByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/signer/signing_profile.go b/internal/service/signer/signing_profile.go index d8c3d5aa820..a65148e1bb7 100644 --- a/internal/service/signer/signing_profile.go +++ b/internal/service/signer/signing_profile.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -203,7 +204,7 @@ func resourceSigningProfileRead(ctx context.Context, d *schema.ResourceData, met output, err := findSigningProfileByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Signer Signing Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/signer/signing_profile_permission.go b/internal/service/signer/signing_profile_permission.go index 44795ed0db4..eee9a0c76df 100644 --- a/internal/service/signer/signing_profile_permission.go +++ b/internal/service/signer/signing_profile_permission.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -159,7 +160,7 @@ func resourceSigningProfilePermissionRead(ctx context.Context, d *schema.Resourc profileName, statementID := d.Get("profile_name").(string), d.Get("statement_id").(string) permission, err := findPermissionByTwoPartKey(ctx, conn, profileName, statementID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Signer Signing Profile Permission (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/signer/signing_profile_permission_test.go b/internal/service/signer/signing_profile_permission_test.go index 1e61971186c..f34204c7c95 100644 --- a/internal/service/signer/signing_profile_permission_test.go +++ b/internal/service/signer/signing_profile_permission_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsigner "github.com/hashicorp/terraform-provider-aws/internal/service/signer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -230,7 +230,7 @@ func testAccCheckSigningProfilePermissionDestroy(ctx context.Context) resource.T _, err := tfsigner.FindPermissionByTwoPartKey(ctx, conn, rs.Primary.Attributes["profile_name"], rs.Primary.Attributes["statement_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/signer/signing_profile_test.go b/internal/service/signer/signing_profile_test.go index 88121a5f4f4..486aebd2835 100644 --- a/internal/service/signer/signing_profile_test.go +++ b/internal/service/signer/signing_profile_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsigner "github.com/hashicorp/terraform-provider-aws/internal/service/signer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -338,7 +338,7 @@ func testAccCheckSigningProfileDestroy(ctx context.Context) resource.TestCheckFu _, err := tfsigner.FindSigningProfileByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From e84442c7a134dbdacaf836908ffddff2d437b1fe Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:05 -0800 Subject: [PATCH 196/227] `sns` --- internal/service/sns/platform_application.go | 3 ++- internal/service/sns/platform_application_test.go | 4 ++-- internal/service/sns/topic.go | 3 ++- internal/service/sns/topic_data_protection_policy.go | 3 ++- internal/service/sns/topic_data_protection_policy_test.go | 4 ++-- internal/service/sns/topic_policy.go | 3 ++- internal/service/sns/topic_policy_test.go | 4 ++-- internal/service/sns/topic_subscription.go | 7 ++++--- internal/service/sns/topic_subscription_test.go | 4 ++-- internal/service/sns/topic_test.go | 4 ++-- 10 files changed, 22 insertions(+), 17 deletions(-) diff --git a/internal/service/sns/platform_application.go b/internal/service/sns/platform_application.go index 89e204b8011..3907a5bde2b 100644 --- a/internal/service/sns/platform_application.go +++ b/internal/service/sns/platform_application.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -165,7 +166,7 @@ func resourcePlatformApplicationRead(ctx context.Context, d *schema.ResourceData attributes, err := findPlatformApplicationAttributesByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SNS Platform Application (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sns/platform_application_test.go b/internal/service/sns/platform_application_test.go index 8407d4ae53c..3f8302e08b4 100644 --- a/internal/service/sns/platform_application_test.go +++ b/internal/service/sns/platform_application_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -481,7 +481,7 @@ func testAccCheckPlatformApplicationDestroy(ctx context.Context) resource.TestCh _, err := tfsns.FindPlatformApplicationAttributesByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sns/topic.go b/internal/service/sns/topic.go index 43747574abc..41c5d003646 100644 --- a/internal/service/sns/topic.go +++ b/internal/service/sns/topic.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -303,7 +304,7 @@ func resourceTopicRead(ctx context.Context, d *schema.ResourceData, meta any) di attributes, err := findTopicAttributesWithValidAWSPrincipalsByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SNS Topic (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sns/topic_data_protection_policy.go b/internal/service/sns/topic_data_protection_policy.go index 5b5d855f787..e70f9b006e8 100644 --- a/internal/service/sns/topic_data_protection_policy.go +++ b/internal/service/sns/topic_data_protection_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -79,7 +80,7 @@ func resourceTopicDataProtectionPolicyRead(ctx context.Context, d *schema.Resour output, err := findDataProtectionPolicyByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SNS Data Protection Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sns/topic_data_protection_policy_test.go b/internal/service/sns/topic_data_protection_policy_test.go index b54038d9ad4..d6ae3390819 100644 --- a/internal/service/sns/topic_data_protection_policy_test.go +++ b/internal/service/sns/topic_data_protection_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -83,7 +83,7 @@ func testAccCheckTopicDataProtectionPolicyDestroy(ctx context.Context) resource. _, err := tfsns.FindTopicAttributesByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sns/topic_policy.go b/internal/service/sns/topic_policy.go index 70430b20f81..494e2867b83 100644 --- a/internal/service/sns/topic_policy.go +++ b/internal/service/sns/topic_policy.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -87,7 +88,7 @@ func resourceTopicPolicyRead(ctx context.Context, d *schema.ResourceData, meta a } } - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SNS Topic Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/sns/topic_policy_test.go b/internal/service/sns/topic_policy_test.go index b42edfdebda..506bc14f800 100644 --- a/internal/service/sns/topic_policy_test.go +++ b/internal/service/sns/topic_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func testAccCheckTopicPolicyDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfsns.FindTopicAttributesByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sns/topic_subscription.go b/internal/service/sns/topic_subscription.go index 44d69b0dfe0..2bbe8bd66b1 100644 --- a/internal/service/sns/topic_subscription.go +++ b/internal/service/sns/topic_subscription.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -204,7 +205,7 @@ func resourceTopicSubscriptionRead(ctx context.Context, d *schema.ResourceData, // avoid errant removals from state on subsequent applies). if v, ok := d.GetOk(names.AttrTopicARN); ok && waitForConfirmation(d.Get("endpoint_auto_confirms").(bool), d.Get(names.AttrProtocol).(string)) { _, err := findSubscriptionInTopic(ctx, conn, v.(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SNS Topic Subscription %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -227,7 +228,7 @@ func resourceTopicSubscriptionRead(ctx context.Context, d *schema.ResourceData, return findSubscriptionAttributesByARN(ctx, conn, d.Id()) }, d.IsNewResource()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SNS Topic Subscription %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -423,7 +424,7 @@ func statusSubscriptionPendingConfirmation(ctx context.Context, conn *sns.Client return func() (any, string, error) { output, err := findSubscriptionAttributesByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/sns/topic_subscription_test.go b/internal/service/sns/topic_subscription_test.go index b52128b61da..4809cf18aa2 100644 --- a/internal/service/sns/topic_subscription_test.go +++ b/internal/service/sns/topic_subscription_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -816,7 +816,7 @@ func testAccCheckTopicSubscriptionDestroy(ctx context.Context) resource.TestChec output, err := tfsns.FindSubscriptionAttributesByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/sns/topic_test.go b/internal/service/sns/topic_test.go index c86ce0d4856..a997c3a64c8 100644 --- a/internal/service/sns/topic_test.go +++ b/internal/service/sns/topic_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -855,7 +855,7 @@ func testAccCheckTopicDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsns.FindTopicAttributesByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7821bfa0e9a7e2c3445fe520c28e448ae9c62392 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:06 -0800 Subject: [PATCH 197/227] `sqs` --- internal/service/sqs/attribute_funcs.go | 3 ++- internal/service/sqs/queue.go | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/service/sqs/attribute_funcs.go b/internal/service/sqs/attribute_funcs.go index db799f2fd13..98a95a1db5a 100644 --- a/internal/service/sqs/attribute_funcs.go +++ b/internal/service/sqs/attribute_funcs.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -74,7 +75,7 @@ func (h *queueAttributeHandler) Read(ctx context.Context, d *schema.ResourceData return findQueueAttributeByTwoPartKey(ctx, conn, d.Id(), h.AttributeName) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SQS Queue (%s) attribute (%s) not found, removing from state", d.Id(), h.AttributeName) d.SetId("") return diags diff --git a/internal/service/sqs/queue.go b/internal/service/sqs/queue.go index 761bda2e525..933f14c3eb2 100644 --- a/internal/service/sqs/queue.go +++ b/internal/service/sqs/queue.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -287,7 +288,7 @@ func resourceQueueRead(ctx context.Context, d *schema.ResourceData, meta any) di return findQueueAttributesByURL(ctx, conn, d.Id()) }) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SQS Queue (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -521,7 +522,7 @@ func statusQueueState(ctx context.Context, conn *sqs.Client, url string) sdkretr return func() (any, string, error) { output, err := findQueueAttributesByURL(ctx, conn, url) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -588,7 +589,7 @@ func statusQueueAttributeState(ctx context.Context, conn *sqs.Client, url string got, err := findQueueAttributesByURL(ctx, conn, url) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 36df3540471380524933ef88184b57c5f341940b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:06 -0800 Subject: [PATCH 198/227] `ssm` --- internal/service/ssm/activation.go | 3 ++- internal/service/ssm/activation_test.go | 4 ++-- internal/service/ssm/association.go | 5 +++-- internal/service/ssm/association_test.go | 4 ++-- internal/service/ssm/default_patch_baseline.go | 3 ++- internal/service/ssm/default_patch_baseline_test.go | 4 ++-- internal/service/ssm/document.go | 5 +++-- internal/service/ssm/document_test.go | 4 ++-- internal/service/ssm/maintenance_window.go | 3 ++- internal/service/ssm/maintenance_window_target.go | 3 ++- internal/service/ssm/maintenance_window_target_test.go | 4 ++-- internal/service/ssm/maintenance_window_task.go | 3 ++- internal/service/ssm/maintenance_window_task_test.go | 4 ++-- internal/service/ssm/maintenance_window_test.go | 4 ++-- internal/service/ssm/parameter.go | 7 ++++--- internal/service/ssm/parameter_test.go | 4 ++-- internal/service/ssm/patch_baseline.go | 3 ++- internal/service/ssm/patch_baseline_test.go | 4 ++-- internal/service/ssm/patch_group.go | 3 ++- internal/service/ssm/patch_group_test.go | 4 ++-- internal/service/ssm/resource_data_sync.go | 3 ++- internal/service/ssm/resource_data_sync_test.go | 4 ++-- internal/service/ssm/service_setting.go | 5 +++-- internal/service/ssm/service_setting_test.go | 4 ++-- 24 files changed, 53 insertions(+), 41 deletions(-) diff --git a/internal/service/ssm/activation.go b/internal/service/ssm/activation.go index fa7492f576a..bc52877a644 100644 --- a/internal/service/ssm/activation.go +++ b/internal/service/ssm/activation.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func resourceActivationRead(ctx context.Context, d *schema.ResourceData, meta an activation, err := findActivationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Activation %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/activation_test.go b/internal/service/ssm/activation_test.go index 1adeeed13a6..7faab783ad5 100644 --- a/internal/service/ssm/activation_test.go +++ b/internal/service/ssm/activation_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func testAccCheckActivationDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfssm.FindActivationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/association.go b/internal/service/ssm/association.go index 4ed5384b539..1533a3b9d15 100644 --- a/internal/service/ssm/association.go +++ b/internal/service/ssm/association.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -251,7 +252,7 @@ func resourceAssociationRead(ctx context.Context, d *schema.ResourceData, meta a association, err := findAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Association %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -410,7 +411,7 @@ func statusAssociation(ctx context.Context, conn *ssm.Client, id string) sdkretr return func() (any, string, error) { output, err := findAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ssm/association_test.go b/internal/service/ssm/association_test.go index 1cb9b2abe1c..24e86df2637 100644 --- a/internal/service/ssm/association_test.go +++ b/internal/service/ssm/association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -664,7 +664,7 @@ func testAccCheckAssociationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfssm.FindAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/default_patch_baseline.go b/internal/service/ssm/default_patch_baseline.go index 2cfc302ebf1..4a794cf7241 100644 --- a/internal/service/ssm/default_patch_baseline.go +++ b/internal/service/ssm/default_patch_baseline.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -115,7 +116,7 @@ func resourceDefaultPatchBaselineRead(ctx context.Context, d *schema.ResourceDat output, err := findDefaultPatchBaselineByOperatingSystem(ctx, conn, awstypes.OperatingSystem(d.Id())) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Default Patch Baseline (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/default_patch_baseline_test.go b/internal/service/ssm/default_patch_baseline_test.go index 147c0e52d60..3d7880335d5 100644 --- a/internal/service/ssm/default_patch_baseline_test.go +++ b/internal/service/ssm/default_patch_baseline_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -350,7 +350,7 @@ func testAccCheckDefaultPatchBaselineDestroy(ctx context.Context) resource.TestC // If the resource has been deleted, the default patch baseline will be the AWS-provided patch baseline for the OS. output, err := tfssm.FindDefaultPatchBaselineByOperatingSystem(ctx, conn, awstypes.OperatingSystem(rs.Primary.ID)) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/document.go b/internal/service/ssm/document.go index 878a7598012..af64e5b5607 100644 --- a/internal/service/ssm/document.go +++ b/internal/service/ssm/document.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -314,7 +315,7 @@ func resourceDocumentRead(ctx context.Context, d *schema.ResourceData, meta any) doc, err := findDocumentByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Document %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -569,7 +570,7 @@ func statusDocument(ctx context.Context, conn *ssm.Client, name string) sdkretry return func() (any, string, error) { output, err := findDocumentByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ssm/document_test.go b/internal/service/ssm/document_test.go index 7774fb24da9..e1495d4a412 100644 --- a/internal/service/ssm/document_test.go +++ b/internal/service/ssm/document_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -603,7 +603,7 @@ func testAccCheckDocumentDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfssm.FindDocumentByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/maintenance_window.go b/internal/service/ssm/maintenance_window.go index a90d848cd24..ee0054a39df 100644 --- a/internal/service/ssm/maintenance_window.go +++ b/internal/service/ssm/maintenance_window.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -152,7 +153,7 @@ func resourceMaintenanceWindowRead(ctx context.Context, d *schema.ResourceData, output, err := findMaintenanceWindowByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Maintenance Window %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/maintenance_window_target.go b/internal/service/ssm/maintenance_window_target.go index 7fc47a5587f..6f69a7ed39a 100644 --- a/internal/service/ssm/maintenance_window_target.go +++ b/internal/service/ssm/maintenance_window_target.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" @@ -136,7 +137,7 @@ func resourceMaintenanceWindowTargetRead(ctx context.Context, d *schema.Resource windowID := d.Get("window_id").(string) target, err := findMaintenanceWindowTargetByTwoPartKey(ctx, conn, windowID, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Maintenance Window Target %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/maintenance_window_target_test.go b/internal/service/ssm/maintenance_window_target_test.go index d1a29ee0f7a..beebee821e3 100644 --- a/internal/service/ssm/maintenance_window_target_test.go +++ b/internal/service/ssm/maintenance_window_target_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -294,7 +294,7 @@ func testAccCheckMaintenanceWindowTargetDestroy(ctx context.Context) resource.Te _, err := tfssm.FindMaintenanceWindowTargetByTwoPartKey(ctx, conn, rs.Primary.Attributes["window_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/maintenance_window_task.go b/internal/service/ssm/maintenance_window_task.go index 6727d582edc..a06880c2118 100644 --- a/internal/service/ssm/maintenance_window_task.go +++ b/internal/service/ssm/maintenance_window_task.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfmaps "github.com/hashicorp/terraform-provider-aws/internal/maps" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -388,7 +389,7 @@ func resourceMaintenanceWindowTaskRead(ctx context.Context, d *schema.ResourceDa output, err := findMaintenanceWindowTaskByTwoPartKey(ctx, conn, d.Get("window_id").(string), d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Maintenance Window Task %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/maintenance_window_task_test.go b/internal/service/ssm/maintenance_window_task_test.go index 1c264d3cad3..bf460c9ac8f 100644 --- a/internal/service/ssm/maintenance_window_task_test.go +++ b/internal/service/ssm/maintenance_window_task_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -519,7 +519,7 @@ func testAccCheckMaintenanceWindowTaskDestroy(ctx context.Context) resource.Test _, err := tfssm.FindMaintenanceWindowTaskByTwoPartKey(ctx, conn, rs.Primary.Attributes["window_id"], rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/maintenance_window_test.go b/internal/service/ssm/maintenance_window_test.go index 7438ce15cf5..e10b7bdd9ab 100644 --- a/internal/service/ssm/maintenance_window_test.go +++ b/internal/service/ssm/maintenance_window_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -500,7 +500,7 @@ func testAccCheckMaintenanceWindowDestroy(ctx context.Context) resource.TestChec _, err := tfssm.FindMaintenanceWindowByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/parameter.go b/internal/service/ssm/parameter.go index 176522b4339..5a24c80aecc 100644 --- a/internal/service/ssm/parameter.go +++ b/internal/service/ssm/parameter.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2/importer" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -272,7 +273,7 @@ func resourceParameterRead(ctx context.Context, d *schema.ResourceData, meta any return findParameterByName(ctx, conn, d.Id(), true) }, func(err error) (bool, error) { - if d.IsNewResource() && tfresource.NotFound(err) && d.Get("data_type").(string) == "aws:ec2:image" { + if d.IsNewResource() && retry.NotFound(err) && d.Get("data_type").(string) == "aws:ec2:image" { return true, err } @@ -280,7 +281,7 @@ func resourceParameterRead(ctx context.Context, d *schema.ResourceData, meta any }, ) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Parameter %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -330,7 +331,7 @@ func resourceParameterRead(ctx context.Context, d *schema.ResourceData, meta any detail, err := findParameterMetadataByName(ctx, conn, d.Get(names.AttrName).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Parameter %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/parameter_test.go b/internal/service/ssm/parameter_test.go index d6b714d659c..bc603d25d39 100644 --- a/internal/service/ssm/parameter_test.go +++ b/internal/service/ssm/parameter_test.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfversion" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1337,7 +1337,7 @@ func testAccCheckParameterDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfssm.FindParameterByName(ctx, conn, rs.Primary.ID, false) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/patch_baseline.go b/internal/service/ssm/patch_baseline.go index 52824ca71c4..a7298c7fc8a 100644 --- a/internal/service/ssm/patch_baseline.go +++ b/internal/service/ssm/patch_baseline.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfjson "github.com/hashicorp/terraform-provider-aws/internal/json" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -311,7 +312,7 @@ func resourcePatchBaselineRead(ctx context.Context, d *schema.ResourceData, meta output, err := findPatchBaselineByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Patch Baseline (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/patch_baseline_test.go b/internal/service/ssm/patch_baseline_test.go index 760454617d8..3e2823b5597 100644 --- a/internal/service/ssm/patch_baseline_test.go +++ b/internal/service/ssm/patch_baseline_test.go @@ -21,8 +21,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -525,7 +525,7 @@ func testAccCheckPatchBaselineDestroy(ctx context.Context) resource.TestCheckFun _, err := tfssm.FindPatchBaselineByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/patch_group.go b/internal/service/ssm/patch_group.go index f297c9ae864..f18dcb2d563 100644 --- a/internal/service/ssm/patch_group.go +++ b/internal/service/ssm/patch_group.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -91,7 +92,7 @@ func resourcePatchGroupRead(ctx context.Context, d *schema.ResourceData, meta an patchGroup, baselineID := parts[0], parts[1] group, err := findPatchGroupByTwoPartKey(ctx, conn, patchGroup, baselineID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Patch Group %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/patch_group_test.go b/internal/service/ssm/patch_group_test.go index 666b2b7fe31..8c87da2bb58 100644 --- a/internal/service/ssm/patch_group_test.go +++ b/internal/service/ssm/patch_group_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -137,7 +137,7 @@ func testAccCheckPatchGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfssm.FindPatchGroupByTwoPartKey(ctx, conn, rs.Primary.Attributes["patch_group"], rs.Primary.Attributes["baseline_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/resource_data_sync.go b/internal/service/ssm/resource_data_sync.go index 7fb14f57d7b..d2a8a695cc4 100644 --- a/internal/service/ssm/resource_data_sync.go +++ b/internal/service/ssm/resource_data_sync.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -115,7 +116,7 @@ func resourceResourceDataSyncRead(ctx context.Context, d *schema.ResourceData, m syncItem, err := findResourceDataSyncByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Resource Data Sync (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssm/resource_data_sync_test.go b/internal/service/ssm/resource_data_sync_test.go index 1013d5bb262..4f5a6052032 100644 --- a/internal/service/ssm/resource_data_sync_test.go +++ b/internal/service/ssm/resource_data_sync_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func testAccCheckResourceDataSyncDestroy(ctx context.Context) resource.TestCheck _, err := tfssm.FindResourceDataSyncByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssm/service_setting.go b/internal/service/ssm/service_setting.go index f4a12d7b79f..451a43e822c 100644 --- a/internal/service/ssm/service_setting.go +++ b/internal/service/ssm/service_setting.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -99,7 +100,7 @@ func resourceServiceSettingRead(ctx context.Context, d *schema.ResourceData, met output, err := findServiceSettingByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSM Service Setting %s not found, removing from state", d.Id()) d.SetId("") return diags @@ -175,7 +176,7 @@ func statusServiceSetting(ctx context.Context, conn *ssm.Client, id string) sdkr return func() (any, string, error) { output, err := findServiceSettingByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ssm/service_setting_test.go b/internal/service/ssm/service_setting_test.go index bdb6cde2562..a9cc6691976 100644 --- a/internal/service/ssm/service_setting_test.go +++ b/internal/service/ssm/service_setting_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -154,7 +154,7 @@ func testAccCheckServiceSettingDestroy(ctx context.Context) resource.TestCheckFu output, err := tfssm.FindServiceSettingByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 7f23d98e927bc363795a23cfb8ac5651922cf852 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:07 -0800 Subject: [PATCH 199/227] `ssmcontacts` --- internal/service/ssmcontacts/contact.go | 4 ++-- internal/service/ssmcontacts/contact_channel.go | 4 ++-- internal/service/ssmcontacts/plan.go | 4 ++-- internal/service/ssmcontacts/rotation.go | 3 ++- internal/service/ssmcontacts/rotation_test.go | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/internal/service/ssmcontacts/contact.go b/internal/service/ssmcontacts/contact.go index b328273aeae..0b096defaab 100644 --- a/internal/service/ssmcontacts/contact.go +++ b/internal/service/ssmcontacts/contact.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +95,7 @@ func resourceContactRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := findContactByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSMContacts Contact (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssmcontacts/contact_channel.go b/internal/service/ssmcontacts/contact_channel.go index 83a9188c0d2..b764e6e4a99 100644 --- a/internal/service/ssmcontacts/contact_channel.go +++ b/internal/service/ssmcontacts/contact_channel.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -108,7 +108,7 @@ func resourceContactChannelRead(ctx context.Context, d *schema.ResourceData, met out, err := findContactChannelByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSMContacts ContactChannel (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssmcontacts/plan.go b/internal/service/ssmcontacts/plan.go index 4a39828cef6..430ff9fc05d 100644 --- a/internal/service/ssmcontacts/plan.go +++ b/internal/service/ssmcontacts/plan.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -133,7 +133,7 @@ func resourcePlanRead(ctx context.Context, d *schema.ResourceData, meta any) dia out, err := findContactByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSMContacts Plan (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssmcontacts/rotation.go b/internal/service/ssmcontacts/rotation.go index 87d7ea61037..af2d0ed6c60 100644 --- a/internal/service/ssmcontacts/rotation.go +++ b/internal/service/ssmcontacts/rotation.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -281,7 +282,7 @@ func (r *rotationResource) Read(ctx context.Context, request resource.ReadReques output, err := findRotationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } diff --git a/internal/service/ssmcontacts/rotation_test.go b/internal/service/ssmcontacts/rotation_test.go index e0ce42d8266..88d4d4b751b 100644 --- a/internal/service/ssmcontacts/rotation_test.go +++ b/internal/service/ssmcontacts/rotation_test.go @@ -24,8 +24,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssmcontacts "github.com/hashicorp/terraform-provider-aws/internal/service/ssmcontacts" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -462,7 +462,7 @@ func testAccCheckRotationDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfssmcontacts.FindRotationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From f49d4be61deffd3543df051aaf43bf7a78af7afc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:08 -0800 Subject: [PATCH 200/227] `ssmincidents` --- internal/service/ssmincidents/replication_set.go | 5 +++-- internal/service/ssmincidents/replication_set_test.go | 4 ++-- internal/service/ssmincidents/response_plan.go | 4 ++-- internal/service/ssmincidents/response_plan_test.go | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/service/ssmincidents/replication_set.go b/internal/service/ssmincidents/replication_set.go index 4e3410c2bd7..b8b8cd62abc 100644 --- a/internal/service/ssmincidents/replication_set.go +++ b/internal/service/ssmincidents/replication_set.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -178,7 +179,7 @@ func resourceReplicationSetRead(ctx context.Context, d *schema.ResourceData, met replicationSet, err := findReplicationSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSMIncidents Replication Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -296,7 +297,7 @@ func statusReplicationSet(ctx context.Context, conn *ssmincidents.Client, arn st return func() (any, string, error) { output, err := findReplicationSetByID(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ssmincidents/replication_set_test.go b/internal/service/ssmincidents/replication_set_test.go index ad61b2ea800..8873fa4ce24 100644 --- a/internal/service/ssmincidents/replication_set_test.go +++ b/internal/service/ssmincidents/replication_set_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssmincidents "github.com/hashicorp/terraform-provider-aws/internal/service/ssmincidents" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -333,7 +333,7 @@ func testAccCheckReplicationSetDestroy(ctx context.Context) resource.TestCheckFu _, err := tfssmincidents.FindReplicationSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssmincidents/response_plan.go b/internal/service/ssmincidents/response_plan.go index 604fd5287bc..2080a8ad2f2 100644 --- a/internal/service/ssmincidents/response_plan.go +++ b/internal/service/ssmincidents/response_plan.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -228,7 +228,7 @@ func resourceResponsePlanRead(ctx context.Context, d *schema.ResourceData, meta responsePlan, err := FindResponsePlanByID(ctx, client, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSMIncidents ResponsePlan (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssmincidents/response_plan_test.go b/internal/service/ssmincidents/response_plan_test.go index 537f59678f6..d7135225ff4 100644 --- a/internal/service/ssmincidents/response_plan_test.go +++ b/internal/service/ssmincidents/response_plan_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssmincidents "github.com/hashicorp/terraform-provider-aws/internal/service/ssmincidents" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -854,7 +854,7 @@ func testAccCheckResponsePlanDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfssmincidents.FindResponsePlanByID(ctx, client, resource.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 53ccfc0b6231f3069ef9ec019393fc8d9ca40a5d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:09 -0800 Subject: [PATCH 201/227] `ssoadmin` --- internal/service/ssoadmin/account_assignment.go | 9 +++++---- internal/service/ssoadmin/account_assignment_test.go | 4 ++-- internal/service/ssoadmin/application.go | 3 ++- internal/service/ssoadmin/application_access_scope.go | 3 ++- internal/service/ssoadmin/application_assignment.go | 3 ++- .../ssoadmin/application_assignment_configuration.go | 4 ++-- internal/service/ssoadmin/application_test.go | 4 ++-- .../ssoadmin/customer_managed_policy_attachment.go | 3 ++- .../ssoadmin/customer_managed_policy_attachment_test.go | 4 ++-- .../ssoadmin/instance_access_control_attributes.go | 3 ++- .../ssoadmin/instance_access_control_attributes_test.go | 4 ++-- internal/service/ssoadmin/managed_policy_attachment.go | 5 +++-- .../service/ssoadmin/managed_policy_attachment_test.go | 4 ++-- internal/service/ssoadmin/permission_set.go | 5 +++-- .../service/ssoadmin/permission_set_inline_policy.go | 3 ++- .../ssoadmin/permission_set_inline_policy_test.go | 4 ++-- internal/service/ssoadmin/permission_set_test.go | 4 ++-- .../service/ssoadmin/permissions_boundary_attachment.go | 3 ++- .../ssoadmin/permissions_boundary_attachment_test.go | 4 ++-- internal/service/ssoadmin/trusted_token_issuer.go | 3 ++- internal/service/ssoadmin/trusted_token_issuer_test.go | 4 ++-- 21 files changed, 47 insertions(+), 36 deletions(-) diff --git a/internal/service/ssoadmin/account_assignment.go b/internal/service/ssoadmin/account_assignment.go index 0227868ba3c..677f0f274a3 100644 --- a/internal/service/ssoadmin/account_assignment.go +++ b/internal/service/ssoadmin/account_assignment.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -104,7 +105,7 @@ func resourceAccountAssignmentCreate(ctx context.Context, d *schema.ResourceData if err == nil { return sdkdiag.AppendErrorf(diags, "creating SSO Account Assignment for %s (%s): already exists", principalType, principalID) - } else if !tfresource.NotFound(err) { + } else if !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "listing SSO Account Assignments for Account ID (%s) Permission Set (%s): %s", targetID, permissionSetARN, err) } @@ -150,7 +151,7 @@ func resourceAccountAssignmentRead(ctx context.Context, d *schema.ResourceData, accountAssignment, err := findAccountAssignmentByFivePartKey(ctx, conn, principalID, principalType, targetID, permissionSetARN, instanceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Account Assignment for Principal (%s) not found, removing from state", principalID) d.SetId("") return diags @@ -317,7 +318,7 @@ func statusAccountAssignmentCreation(ctx context.Context, conn *ssoadmin.Client, return func() (any, string, error) { output, err := findAccountAssignmentCreationStatus(ctx, conn, instanceARN, requestID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -359,7 +360,7 @@ func statusAccountAssignmentDeletion(ctx context.Context, conn *ssoadmin.Client, return func() (any, string, error) { output, err := findAccountAssignmentDeletionStatus(ctx, conn, instanceARN, requestID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ssoadmin/account_assignment_test.go b/internal/service/ssoadmin/account_assignment_test.go index 3b94087474a..0413052a74e 100644 --- a/internal/service/ssoadmin/account_assignment_test.go +++ b/internal/service/ssoadmin/account_assignment_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +162,7 @@ func testAccCheckAccountAssignmentDestroy(ctx context.Context) resource.TestChec _, err = tfssoadmin.FindAccountAssignmentByFivePartKey(ctx, conn, principalID, principalType, targetID, permissionSetARN, instanceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/application.go b/internal/service/ssoadmin/application.go index fcb809b594b..ac70b5a69b4 100644 --- a/internal/service/ssoadmin/application.go +++ b/internal/service/ssoadmin/application.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -202,7 +203,7 @@ func (r *applicationResource) Read(ctx context.Context, request resource.ReadReq output, err := findApplicationByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ssoadmin/application_access_scope.go b/internal/service/ssoadmin/application_access_scope.go index a0e9dbe0078..15817a419f5 100644 --- a/internal/service/ssoadmin/application_access_scope.go +++ b/internal/service/ssoadmin/application_access_scope.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -134,7 +135,7 @@ func (r *applicationAccessScopeResource) Read(ctx context.Context, req resource. } out, err := findApplicationAccessScopeByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/ssoadmin/application_assignment.go b/internal/service/ssoadmin/application_assignment.go index dd58e8f73c8..00995880343 100644 --- a/internal/service/ssoadmin/application_assignment.go +++ b/internal/service/ssoadmin/application_assignment.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +118,7 @@ func (r *applicationAssignmentResource) Read(ctx context.Context, req resource.R } out, err := findApplicationAssignmentByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/ssoadmin/application_assignment_configuration.go b/internal/service/ssoadmin/application_assignment_configuration.go index 2f185dbb593..58b8866f133 100644 --- a/internal/service/ssoadmin/application_assignment_configuration.go +++ b/internal/service/ssoadmin/application_assignment_configuration.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func (r *applicationAssignmentConfigurationResource) Read(ctx context.Context, r } out, err := findApplicationAssignmentConfigurationByID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/ssoadmin/application_test.go b/internal/service/ssoadmin/application_test.go index 020baa56dd8..5f42da36633 100644 --- a/internal/service/ssoadmin/application_test.go +++ b/internal/service/ssoadmin/application_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -302,7 +302,7 @@ func testAccCheckApplicationDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfssoadmin.FindApplicationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/customer_managed_policy_attachment.go b/internal/service/ssoadmin/customer_managed_policy_attachment.go index e6d47cf8cda..9240a49cc67 100644 --- a/internal/service/ssoadmin/customer_managed_policy_attachment.go +++ b/internal/service/ssoadmin/customer_managed_policy_attachment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -125,7 +126,7 @@ func resourceCustomerManagedPolicyAttachmentRead(ctx context.Context, d *schema. policy, err := findCustomerManagedPolicyByFourPartKey(ctx, conn, policyName, policyPath, permissionSetARN, instanceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Customer Managed Policy Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssoadmin/customer_managed_policy_attachment_test.go b/internal/service/ssoadmin/customer_managed_policy_attachment_test.go index 7409caed4e0..418262b567e 100644 --- a/internal/service/ssoadmin/customer_managed_policy_attachment_test.go +++ b/internal/service/ssoadmin/customer_managed_policy_attachment_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -196,7 +196,7 @@ func testAccCheckCustomerManagedPolicyAttachmentDestroy(ctx context.Context) res _, err = tfssoadmin.FindCustomerManagedPolicyByFourPartKey(ctx, conn, policyName, policyPath, permissionSetARN, instanceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/instance_access_control_attributes.go b/internal/service/ssoadmin/instance_access_control_attributes.go index be2ac224f4a..218e207c82a 100644 --- a/internal/service/ssoadmin/instance_access_control_attributes.go +++ b/internal/service/ssoadmin/instance_access_control_attributes.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -109,7 +110,7 @@ func resourceInstanceAccessControlAttributesRead(ctx context.Context, d *schema. output, err := findInstanceAttributeControlAttributesByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Instance Access Control Attributes %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssoadmin/instance_access_control_attributes_test.go b/internal/service/ssoadmin/instance_access_control_attributes_test.go index 3590cc33d1d..3410eb1859d 100644 --- a/internal/service/ssoadmin/instance_access_control_attributes_test.go +++ b/internal/service/ssoadmin/instance_access_control_attributes_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -150,7 +150,7 @@ func testAccCheckInstanceAccessControlAttributesDestroy(ctx context.Context) res _, err := tfssoadmin.FindInstanceAttributeControlAttributesByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/managed_policy_attachment.go b/internal/service/ssoadmin/managed_policy_attachment.go index 3cedcca5e96..3ab96f19585 100644 --- a/internal/service/ssoadmin/managed_policy_attachment.go +++ b/internal/service/ssoadmin/managed_policy_attachment.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -80,7 +81,7 @@ func resourceManagedPolicyAttachmentCreate(ctx context.Context, d *schema.Resour if err == nil { return sdkdiag.AppendErrorf(diags, "attaching Managed Policy (%s) to SSO Permission Set (%s): already attached", managedPolicyARN, permissionSetARN) - } else if !tfresource.NotFound(err) { + } else if !retry.NotFound(err) { return sdkdiag.AppendErrorf(diags, "reading SSO Managed Policy (%s) Attachment (%s): %s", managedPolicyARN, permissionSetARN, err) } @@ -117,7 +118,7 @@ func resourceManagedPolicyAttachmentRead(ctx context.Context, d *schema.Resource policy, err := findManagedPolicyByThreePartKey(ctx, conn, managedPolicyARN, permissionSetARN, instanceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Managed Policy Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssoadmin/managed_policy_attachment_test.go b/internal/service/ssoadmin/managed_policy_attachment_test.go index 03686f16102..a7f6919646d 100644 --- a/internal/service/ssoadmin/managed_policy_attachment_test.go +++ b/internal/service/ssoadmin/managed_policy_attachment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func testAccCheckManagedPolicyAttachmentDestroy(ctx context.Context) resource.Te _, err = tfssoadmin.FindManagedPolicyByThreePartKey(ctx, conn, managedPolicyARN, permissionSetARN, instanceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/permission_set.go b/internal/service/ssoadmin/permission_set.go index 6bbe0ec2a01..105d1ca3a57 100644 --- a/internal/service/ssoadmin/permission_set.go +++ b/internal/service/ssoadmin/permission_set.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -144,7 +145,7 @@ func resourcePermissionSetRead(ctx context.Context, d *schema.ResourceData, meta permissionSet, err := findPermissionSetByTwoPartKey(ctx, conn, permissionSetARN, instanceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Permission Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -337,7 +338,7 @@ func statusPermissionSetProvisioning(ctx context.Context, conn *ssoadmin.Client, return func() (any, string, error) { output, err := findPermissionSetProvisioningStatus(ctx, conn, instanceARN, requestID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/ssoadmin/permission_set_inline_policy.go b/internal/service/ssoadmin/permission_set_inline_policy.go index 9b404f9cb08..64a9f4950b7 100644 --- a/internal/service/ssoadmin/permission_set_inline_policy.go +++ b/internal/service/ssoadmin/permission_set_inline_policy.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -112,7 +113,7 @@ func resourcePermissionSetInlinePolicyRead(ctx context.Context, d *schema.Resour policy, err := findPermissionSetInlinePolicyByTwoPartKey(ctx, conn, permissionSetARN, instanceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Permission Set Inline Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssoadmin/permission_set_inline_policy_test.go b/internal/service/ssoadmin/permission_set_inline_policy_test.go index 3a31ae5562b..6809b8381ab 100644 --- a/internal/service/ssoadmin/permission_set_inline_policy_test.go +++ b/internal/service/ssoadmin/permission_set_inline_policy_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckPermissionSetInlinePolicyDestroy(ctx context.Context) resource. _, err = tfssoadmin.FindPermissionSetInlinePolicyByTwoPartKey(ctx, conn, permissionSetARN, instanceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/permission_set_test.go b/internal/service/ssoadmin/permission_set_test.go index 81de96de1ba..5f57a5eb4aa 100644 --- a/internal/service/ssoadmin/permission_set_test.go +++ b/internal/service/ssoadmin/permission_set_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -293,7 +293,7 @@ func testAccCheckPermissionSetDestroy(ctx context.Context) resource.TestCheckFun _, err = tfssoadmin.FindPermissionSetByTwoPartKey(ctx, conn, permissionSetARN, instanceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/permissions_boundary_attachment.go b/internal/service/ssoadmin/permissions_boundary_attachment.go index 583b5a5ca31..c8afc078a70 100644 --- a/internal/service/ssoadmin/permissions_boundary_attachment.go +++ b/internal/service/ssoadmin/permissions_boundary_attachment.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -139,7 +140,7 @@ func resourcePermissionsBoundaryAttachmentRead(ctx context.Context, d *schema.Re policy, err := findPermissionsBoundaryByTwoPartKey(ctx, conn, permissionSetARN, instanceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] SSO Permissions Boundary Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/ssoadmin/permissions_boundary_attachment_test.go b/internal/service/ssoadmin/permissions_boundary_attachment_test.go index 753741e0f03..1cd5ade503e 100644 --- a/internal/service/ssoadmin/permissions_boundary_attachment_test.go +++ b/internal/service/ssoadmin/permissions_boundary_attachment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -176,7 +176,7 @@ func testAccCheckPermissionsBoundaryAttachmentDestroy(ctx context.Context) resou _, err = tfssoadmin.FindPermissionsBoundaryByTwoPartKey(ctx, conn, permissionSetARN, instanceARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/ssoadmin/trusted_token_issuer.go b/internal/service/ssoadmin/trusted_token_issuer.go index aacb172086e..cb35be148c7 100644 --- a/internal/service/ssoadmin/trusted_token_issuer.go +++ b/internal/service/ssoadmin/trusted_token_issuer.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -169,7 +170,7 @@ func (r *trustedTokenIssuerResource) Read(ctx context.Context, request resource. output, err := findTrustedTokenIssuerByARN(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/ssoadmin/trusted_token_issuer_test.go b/internal/service/ssoadmin/trusted_token_issuer_test.go index 708989ca813..25235192ee3 100644 --- a/internal/service/ssoadmin/trusted_token_issuer_test.go +++ b/internal/service/ssoadmin/trusted_token_issuer_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -188,7 +188,7 @@ func testAccCheckTrustedTokenIssuerDestroy(ctx context.Context) resource.TestChe _, err := tfssoadmin.FindTrustedTokenIssuerByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From be5ef188bc75fb564128a6f7731e30de6a87378d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:09 -0800 Subject: [PATCH 202/227] `storagegateway` --- internal/service/storagegateway/cache.go | 5 +++-- internal/service/storagegateway/cached_iscsi_volume.go | 3 ++- .../service/storagegateway/cached_iscsi_volume_test.go | 4 ++-- internal/service/storagegateway/file_system_association.go | 5 +++-- .../service/storagegateway/file_system_association_test.go | 4 ++-- internal/service/storagegateway/gateway.go | 7 ++++--- internal/service/storagegateway/gateway_test.go | 4 ++-- internal/service/storagegateway/nfs_file_share.go | 5 +++-- internal/service/storagegateway/nfs_file_share_test.go | 4 ++-- internal/service/storagegateway/smb_file_share.go | 5 +++-- internal/service/storagegateway/smb_file_share_test.go | 4 ++-- internal/service/storagegateway/stored_iscsi_volume.go | 5 +++-- .../service/storagegateway/stored_iscsi_volume_test.go | 4 ++-- internal/service/storagegateway/tape_pool.go | 3 ++- internal/service/storagegateway/tape_pool_test.go | 4 ++-- internal/service/storagegateway/upload_buffer.go | 3 ++- internal/service/storagegateway/working_storage.go | 3 ++- 17 files changed, 41 insertions(+), 31 deletions(-) diff --git a/internal/service/storagegateway/cache.go b/internal/service/storagegateway/cache.go index 8508b908edb..34d1a0284bc 100644 --- a/internal/service/storagegateway/cache.go +++ b/internal/service/storagegateway/cache.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -84,7 +85,7 @@ func resourceCacheCreate(ctx context.Context, d *schema.ResourceData, meta any) }) switch { - case tfresource.NotFound(err): + case retry.NotFound(err): case err != nil: return sdkdiag.AppendErrorf(diags, "reading Storage Gateway local disk: %s", err) default: @@ -106,7 +107,7 @@ func resourceCacheRead(ctx context.Context, d *schema.ResourceData, meta any) di err = findCacheByTwoPartKey(ctx, conn, gatewayARN, diskID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Cache (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/storagegateway/cached_iscsi_volume.go b/internal/service/storagegateway/cached_iscsi_volume.go index 17489e02102..f67b764dd6c 100644 --- a/internal/service/storagegateway/cached_iscsi_volume.go +++ b/internal/service/storagegateway/cached_iscsi_volume.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -165,7 +166,7 @@ func resourceCachediSCSIVolumeRead(ctx context.Context, d *schema.ResourceData, volume, err := findCachediSCSIVolumeByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Cached iSCSI Volume (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/storagegateway/cached_iscsi_volume_test.go b/internal/service/storagegateway/cached_iscsi_volume_test.go index 725dc43d872..5d2e7b46b3d 100644 --- a/internal/service/storagegateway/cached_iscsi_volume_test.go +++ b/internal/service/storagegateway/cached_iscsi_volume_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -332,7 +332,7 @@ func testAccCheckCachediSCSIVolumeDestroy(ctx context.Context) resource.TestChec _, err := tfstoragegateway.FindCachediSCSIVolumeByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/file_system_association.go b/internal/service/storagegateway/file_system_association.go index bae48076db3..7819fc35f08 100644 --- a/internal/service/storagegateway/file_system_association.go +++ b/internal/service/storagegateway/file_system_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -154,7 +155,7 @@ func resourceFileSystemAssociationRead(ctx context.Context, d *schema.ResourceDa filesystem, err := findFileSystemAssociationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway File System Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -274,7 +275,7 @@ func statusFileSystemAssociation(ctx context.Context, conn *storagegateway.Clien return func() (any, string, error) { output, err := findFileSystemAssociationByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/storagegateway/file_system_association_test.go b/internal/service/storagegateway/file_system_association_test.go index e8add6349d2..e04baf47c09 100644 --- a/internal/service/storagegateway/file_system_association_test.go +++ b/internal/service/storagegateway/file_system_association_test.go @@ -15,9 +15,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -289,7 +289,7 @@ func testAccCheckFileSystemAssociationDestroy(ctx context.Context) resource.Test _, err := tfstoragegateway.FindFileSystemAssociationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/gateway.go b/internal/service/storagegateway/gateway.go index 753215f2c79..8e4ac29748b 100644 --- a/internal/service/storagegateway/gateway.go +++ b/internal/service/storagegateway/gateway.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types/nullable" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -484,7 +485,7 @@ func resourceGatewayRead(ctx context.Context, d *schema.ResourceData, meta any) outputDGI, err := findGatewayByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Gateway (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -928,7 +929,7 @@ func statusGatewayConnected(ctx context.Context, conn *storagegateway.Client, ga return func() (any, string, error) { output, err := findGatewayByARN(ctx, conn, gatewayARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } @@ -948,7 +949,7 @@ func statusGatewayJoinDomain(ctx context.Context, conn *storagegateway.Client, g return func() (any, string, error) { output, err := findSMBSettingsByARN(ctx, conn, gatewayARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/storagegateway/gateway_test.go b/internal/service/storagegateway/gateway_test.go index 8afdb7dcf28..4eeb7ce8706 100644 --- a/internal/service/storagegateway/gateway_test.go +++ b/internal/service/storagegateway/gateway_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -913,7 +913,7 @@ func testAccCheckGatewayDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfstoragegateway.FindGatewayByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/nfs_file_share.go b/internal/service/storagegateway/nfs_file_share.go index 7c0638c9f13..10687dbcd23 100644 --- a/internal/service/storagegateway/nfs_file_share.go +++ b/internal/service/storagegateway/nfs_file_share.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -293,7 +294,7 @@ func resourceNFSFileShareRead(ctx context.Context, d *schema.ResourceData, meta fileshare, err := findNFSFileShareByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway NFS File Share (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -437,7 +438,7 @@ func statusNFSFileShare(ctx context.Context, conn *storagegateway.Client, arn st return func() (any, string, error) { output, err := findNFSFileShareByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/storagegateway/nfs_file_share_test.go b/internal/service/storagegateway/nfs_file_share_test.go index b40d91befb5..43c46b8951a 100644 --- a/internal/service/storagegateway/nfs_file_share_test.go +++ b/internal/service/storagegateway/nfs_file_share_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -694,7 +694,7 @@ func testAccCheckNFSFileShareDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfstoragegateway.FindNFSFileShareByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/smb_file_share.go b/internal/service/storagegateway/smb_file_share.go index 7d3e9a78e58..f5b3fe06631 100644 --- a/internal/service/storagegateway/smb_file_share.go +++ b/internal/service/storagegateway/smb_file_share.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -308,7 +309,7 @@ func resourceSMBFileShareRead(ctx context.Context, d *schema.ResourceData, meta fileshare, err := findSMBFileShareByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway SMB File Share (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -508,7 +509,7 @@ func statusSMBFileShare(ctx context.Context, conn *storagegateway.Client, arn st return func() (any, string, error) { output, err := findSMBFileShareByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/storagegateway/smb_file_share_test.go b/internal/service/storagegateway/smb_file_share_test.go index 05ab88ea45e..88c6f202c2a 100644 --- a/internal/service/storagegateway/smb_file_share_test.go +++ b/internal/service/storagegateway/smb_file_share_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -956,7 +956,7 @@ func testAccCheckSMBFileShareDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfstoragegateway.FindSMBFileShareByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/stored_iscsi_volume.go b/internal/service/storagegateway/stored_iscsi_volume.go index 335e4662e06..56acd1fc4c6 100644 --- a/internal/service/storagegateway/stored_iscsi_volume.go +++ b/internal/service/storagegateway/stored_iscsi_volume.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -172,7 +173,7 @@ func resourceStorediSCSIVolumeRead(ctx context.Context, d *schema.ResourceData, volume, err := findStorediSCSIVolumeByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Stored iSCSI Volume (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -303,7 +304,7 @@ func statusStorediSCSIVolume(ctx context.Context, conn *storagegateway.Client, v return func() (any, string, error) { output, err := findStorediSCSIVolumeByARN(ctx, conn, volumeARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/storagegateway/stored_iscsi_volume_test.go b/internal/service/storagegateway/stored_iscsi_volume_test.go index ca65652ba9e..7318277aa69 100644 --- a/internal/service/storagegateway/stored_iscsi_volume_test.go +++ b/internal/service/storagegateway/stored_iscsi_volume_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -235,7 +235,7 @@ func testAccCheckStorediSCSIVolumeDestroy(ctx context.Context) resource.TestChec _, err := tfstoragegateway.FindStorediSCSIVolumeByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/tape_pool.go b/internal/service/storagegateway/tape_pool.go index 579f458e0e0..9f83f6f338e 100644 --- a/internal/service/storagegateway/tape_pool.go +++ b/internal/service/storagegateway/tape_pool.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -102,7 +103,7 @@ func resourceTapePoolRead(ctx context.Context, d *schema.ResourceData, meta any) pool, err := findTapePoolByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Tape Pool (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/storagegateway/tape_pool_test.go b/internal/service/storagegateway/tape_pool_test.go index a826ac4147c..da1e3effd52 100644 --- a/internal/service/storagegateway/tape_pool_test.go +++ b/internal/service/storagegateway/tape_pool_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -186,7 +186,7 @@ func testAccCheckTapePoolDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfstoragegateway.FindTapePoolByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/storagegateway/upload_buffer.go b/internal/service/storagegateway/upload_buffer.go index c9328981592..183fd419d1e 100644 --- a/internal/service/storagegateway/upload_buffer.go +++ b/internal/service/storagegateway/upload_buffer.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -117,7 +118,7 @@ func resourceUploadBufferRead(ctx context.Context, d *schema.ResourceData, meta foundDiskID, err := findUploadBufferDiskIDByTwoPartKey(ctx, conn, gatewayARN, diskID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Upload Buffer (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/storagegateway/working_storage.go b/internal/service/storagegateway/working_storage.go index a7545dda3f6..56f209ace70 100644 --- a/internal/service/storagegateway/working_storage.go +++ b/internal/service/storagegateway/working_storage.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -83,7 +84,7 @@ func resourceWorkingStorageRead(ctx context.Context, d *schema.ResourceData, met _, err = findWorkingStorageDiskIDByTwoPartKey(ctx, conn, gatewayARN, diskID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Storage Gateway Working Storage (%s) not found, removing from state", d.Id()) d.SetId("") return diags From f7ded390048ec5eba0c3f0e0eef869eb1cb6ab10 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:10 -0800 Subject: [PATCH 203/227] `synthetics` --- internal/service/synthetics/canary.go | 3 ++- internal/service/synthetics/canary_test.go | 4 ++-- internal/service/synthetics/group.go | 4 ++-- internal/service/synthetics/group_association.go | 4 ++-- internal/service/synthetics/group_association_test.go | 4 ++-- internal/service/synthetics/group_test.go | 4 ++-- internal/service/synthetics/status.go | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/internal/service/synthetics/canary.go b/internal/service/synthetics/canary.go index 1cc095dcb73..c0210371eb7 100644 --- a/internal/service/synthetics/canary.go +++ b/internal/service/synthetics/canary.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" tfio "github.com/hashicorp/terraform-provider-aws/internal/io" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -390,7 +391,7 @@ func resourceCanaryRead(ctx context.Context, d *schema.ResourceData, meta any) d canary, err := FindCanaryByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Synthetics Canary (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/synthetics/canary_test.go b/internal/service/synthetics/canary_test.go index 7c8bc6f0073..42f77323be2 100644 --- a/internal/service/synthetics/canary_test.go +++ b/internal/service/synthetics/canary_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsynthetics "github.com/hashicorp/terraform-provider-aws/internal/service/synthetics" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -815,7 +815,7 @@ func testAccCheckCanaryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsynthetics.FindCanaryByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/synthetics/group.go b/internal/service/synthetics/group.go index 30b72d17e2e..b33241df244 100644 --- a/internal/service/synthetics/group.go +++ b/internal/service/synthetics/group.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -84,7 +84,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di group, err := FindGroupByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Synthetics Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/synthetics/group_association.go b/internal/service/synthetics/group_association.go index 7a33a760e4e..c4f4d32c820 100644 --- a/internal/service/synthetics/group_association.go +++ b/internal/service/synthetics/group_association.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -94,7 +94,7 @@ func resourceGroupAssociationRead(ctx context.Context, d *schema.ResourceData, m group, err := FindAssociatedGroup(ctx, conn, canaryArn, groupName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Synthetics Group Association between canary (%s) and group (%s) not found, removing from state", canaryArn, groupName) d.SetId("") return diags diff --git a/internal/service/synthetics/group_association_test.go b/internal/service/synthetics/group_association_test.go index 25b1549278f..17edaef7295 100644 --- a/internal/service/synthetics/group_association_test.go +++ b/internal/service/synthetics/group_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsynthetics "github.com/hashicorp/terraform-provider-aws/internal/service/synthetics" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -122,7 +122,7 @@ func testAccCheckGroupAssociationDestroy(ctx context.Context) resource.TestCheck _, err = tfsynthetics.FindAssociatedGroup(ctx, conn, canaryArn, groupName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/synthetics/group_test.go b/internal/service/synthetics/group_test.go index b8c0d7cccc5..486723d9e61 100644 --- a/internal/service/synthetics/group_test.go +++ b/internal/service/synthetics/group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfsynthetics "github.com/hashicorp/terraform-provider-aws/internal/service/synthetics" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -155,7 +155,7 @@ func testAccCheckGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfsynthetics.FindGroupByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/synthetics/status.go b/internal/service/synthetics/status.go index 1e5fd7bd3c3..c0c4e3054a0 100644 --- a/internal/service/synthetics/status.go +++ b/internal/service/synthetics/status.go @@ -8,14 +8,14 @@ import ( "github.com/aws/aws-sdk-go-v2/service/synthetics" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/retry" ) func statusCanaryState(ctx context.Context, conn *synthetics.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { output, err := FindCanaryByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From f913d581eb58f72f2ec2c70ee2c8bb81d75e578d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:11 -0800 Subject: [PATCH 204/227] `timestreaminfluxdb` --- internal/service/timestreaminfluxdb/db_cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/timestreaminfluxdb/db_cluster.go b/internal/service/timestreaminfluxdb/db_cluster.go index d912899fe75..f83dd56be90 100644 --- a/internal/service/timestreaminfluxdb/db_cluster.go +++ b/internal/service/timestreaminfluxdb/db_cluster.go @@ -576,7 +576,7 @@ func isParameterGroupV3(ctx context.Context, conn *timestreaminfluxdb.Client, pa out, err := findDBParameterGroupByID(ctx, conn, parameterGroupID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, diags } From 0475b0edaa2e37d2fe6a0aa4cf8fe8c915cf809c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:12 -0800 Subject: [PATCH 205/227] `timestreamquery` --- internal/service/timestreamquery/scheduled_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/timestreamquery/scheduled_query.go b/internal/service/timestreamquery/scheduled_query.go index 421a54c2a79..c410210cb84 100644 --- a/internal/service/timestreamquery/scheduled_query.go +++ b/internal/service/timestreamquery/scheduled_query.go @@ -807,7 +807,7 @@ func waitScheduledQueryDeleted(ctx context.Context, conn *timestreamquery.Client func statusScheduledQuery(conn *timestreamquery.Client, arn string) retry.StateRefreshFunc { return func(ctx context.Context) (any, string, error) { out, err := findScheduledQueryByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } From 6be8bd2506fdfe9e64ad4a47174251c8949b0f55 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:13 -0800 Subject: [PATCH 206/227] `timestreamwrite` --- internal/service/timestreamwrite/database.go | 3 ++- internal/service/timestreamwrite/database_test.go | 4 ++-- internal/service/timestreamwrite/table.go | 3 ++- internal/service/timestreamwrite/table_test.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/service/timestreamwrite/database.go b/internal/service/timestreamwrite/database.go index 421b6c1b9df..6cf0df2aeea 100644 --- a/internal/service/timestreamwrite/database.go +++ b/internal/service/timestreamwrite/database.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -102,7 +103,7 @@ func resourceDatabaseRead(ctx context.Context, d *schema.ResourceData, meta any) db, err := findDatabaseByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Timestream Database %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/timestreamwrite/database_test.go b/internal/service/timestreamwrite/database_test.go index 6c090a24417..7f1cec47878 100644 --- a/internal/service/timestreamwrite/database_test.go +++ b/internal/service/timestreamwrite/database_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftimestreamwrite "github.com/hashicorp/terraform-provider-aws/internal/service/timestreamwrite" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -207,7 +207,7 @@ func testAccCheckDatabaseDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftimestreamwrite.FindDatabaseByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/timestreamwrite/table.go b/internal/service/timestreamwrite/table.go index 53d3832ae24..f267e6887b0 100644 --- a/internal/service/timestreamwrite/table.go +++ b/internal/service/timestreamwrite/table.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -225,7 +226,7 @@ func resourceTableRead(ctx context.Context, d *schema.ResourceData, meta any) di table, err := findTableByTwoPartKey(ctx, conn, databaseName, tableName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Timestream Table %s not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/timestreamwrite/table_test.go b/internal/service/timestreamwrite/table_test.go index 9131f68f84a..d15d4518b9a 100644 --- a/internal/service/timestreamwrite/table_test.go +++ b/internal/service/timestreamwrite/table_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftimestreamwrite "github.com/hashicorp/terraform-provider-aws/internal/service/timestreamwrite" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -381,7 +381,7 @@ func testAccCheckTableDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tftimestreamwrite.FindTableByTwoPartKey(ctx, conn, databaseName, tableName) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 1d06d6f6e98134079cb4dfa5df5029841f100f80 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:14 -0800 Subject: [PATCH 207/227] `transcribe` --- internal/service/transcribe/language_model.go | 5 +++-- internal/service/transcribe/language_model_test.go | 4 ++-- internal/service/transcribe/medical_vocabulary.go | 5 +++-- internal/service/transcribe/medical_vocabulary_test.go | 4 ++-- internal/service/transcribe/vocabulary.go | 5 +++-- internal/service/transcribe/vocabulary_filter.go | 3 ++- internal/service/transcribe/vocabulary_filter_test.go | 4 ++-- internal/service/transcribe/vocabulary_test.go | 4 ++-- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/internal/service/transcribe/language_model.go b/internal/service/transcribe/language_model.go index da4ea738ed0..7895e69d681 100644 --- a/internal/service/transcribe/language_model.go +++ b/internal/service/transcribe/language_model.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -153,7 +154,7 @@ func resourceLanguageModelRead(ctx context.Context, d *schema.ResourceData, meta out, err := FindLanguageModelByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transcribe LanguageModel (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -232,7 +233,7 @@ func waitLanguageModelCreated(ctx context.Context, conn *transcribe.Client, id s func statusLanguageModel(ctx context.Context, conn *transcribe.Client, name string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindLanguageModelByName(ctx, conn, name) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/transcribe/language_model_test.go b/internal/service/transcribe/language_model_test.go index cec871dcb79..ea7c8ee6b41 100644 --- a/internal/service/transcribe/language_model_test.go +++ b/internal/service/transcribe/language_model_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftranscribe "github.com/hashicorp/terraform-provider-aws/internal/service/transcribe" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -152,7 +152,7 @@ func testAccCheckLanguageModelDestroy(ctx context.Context) resource.TestCheckFun _, err := tftranscribe.FindLanguageModelByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transcribe/medical_vocabulary.go b/internal/service/transcribe/medical_vocabulary.go index 907e6d45e41..491c7fc4537 100644 --- a/internal/service/transcribe/medical_vocabulary.go +++ b/internal/service/transcribe/medical_vocabulary.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,7 +113,7 @@ func resourceMedicalVocabularyRead(ctx context.Context, d *schema.ResourceData, out, err := FindMedicalVocabularyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transcribe MedicalVocabulary (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -251,7 +252,7 @@ func waitMedicalVocabularyDeleted(ctx context.Context, conn *transcribe.Client, func statusMedicalVocabulary(ctx context.Context, conn *transcribe.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindMedicalVocabularyByName(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/transcribe/medical_vocabulary_test.go b/internal/service/transcribe/medical_vocabulary_test.go index 60abb90de31..6b2b10366ad 100644 --- a/internal/service/transcribe/medical_vocabulary_test.go +++ b/internal/service/transcribe/medical_vocabulary_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftranscribe "github.com/hashicorp/terraform-provider-aws/internal/service/transcribe" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func testAccCheckMedicalVocabularyDestroy(ctx context.Context) resource.TestChec _, err := tftranscribe.FindMedicalVocabularyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transcribe/vocabulary.go b/internal/service/transcribe/vocabulary.go index df58b4b7c6f..14583d20573 100644 --- a/internal/service/transcribe/vocabulary.go +++ b/internal/service/transcribe/vocabulary.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -131,7 +132,7 @@ func resourceVocabularyRead(ctx context.Context, d *schema.ResourceData, meta an out, err := FindVocabularyByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transcribe Vocabulary (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -283,7 +284,7 @@ func waitVocabularyDeleted(ctx context.Context, conn *transcribe.Client, id stri func statusVocabulary(ctx context.Context, conn *transcribe.Client, id string) sdkretry.StateRefreshFunc { return func() (any, string, error) { out, err := FindVocabularyByName(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/transcribe/vocabulary_filter.go b/internal/service/transcribe/vocabulary_filter.go index 2a1a18b4aca..ac4fce0c15d 100644 --- a/internal/service/transcribe/vocabulary_filter.go +++ b/internal/service/transcribe/vocabulary_filter.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func resourceVocabularyFilterRead(ctx context.Context, d *schema.ResourceData, m out, err := FindVocabularyFilterByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transcribe VocabularyFilter (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transcribe/vocabulary_filter_test.go b/internal/service/transcribe/vocabulary_filter_test.go index b0c44ddd677..896f36163fb 100644 --- a/internal/service/transcribe/vocabulary_filter_test.go +++ b/internal/service/transcribe/vocabulary_filter_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftranscribe "github.com/hashicorp/terraform-provider-aws/internal/service/transcribe" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -228,7 +228,7 @@ func testAccCheckVocabularyFilterDestroy(ctx context.Context) resource.TestCheck _, err := tftranscribe.FindVocabularyFilterByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transcribe/vocabulary_test.go b/internal/service/transcribe/vocabulary_test.go index 4869c20b864..208b38c8366 100644 --- a/internal/service/transcribe/vocabulary_test.go +++ b/internal/service/transcribe/vocabulary_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftranscribe "github.com/hashicorp/terraform-provider-aws/internal/service/transcribe" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -228,7 +228,7 @@ func testAccCheckVocabularyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftranscribe.FindVocabularyByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 74202bd232f138211cd48f4e84af93efa2b232df Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:16 -0800 Subject: [PATCH 208/227] `transfer` --- internal/service/transfer/access.go | 3 ++- internal/service/transfer/access_test.go | 4 ++-- internal/service/transfer/agreement.go | 3 ++- internal/service/transfer/agreement_test.go | 4 ++-- internal/service/transfer/certificate.go | 3 ++- internal/service/transfer/certificate_test.go | 4 ++-- internal/service/transfer/connector.go | 3 ++- internal/service/transfer/connector_test.go | 4 ++-- internal/service/transfer/host_key.go | 3 ++- internal/service/transfer/host_key_test.go | 4 ++-- internal/service/transfer/profile.go | 3 ++- internal/service/transfer/profile_test.go | 4 ++-- internal/service/transfer/server.go | 5 +++-- internal/service/transfer/server_test.go | 4 ++-- internal/service/transfer/ssh_key.go | 3 ++- internal/service/transfer/ssh_key_test.go | 4 ++-- internal/service/transfer/tag_gen.go | 4 ++-- internal/service/transfer/tag_gen_test.go | 4 ++-- internal/service/transfer/user.go | 3 ++- internal/service/transfer/user_test.go | 4 ++-- internal/service/transfer/web_app.go | 3 ++- internal/service/transfer/web_app_customization.go | 3 ++- internal/service/transfer/web_app_customization_test.go | 4 ++-- internal/service/transfer/web_app_test.go | 4 ++-- internal/service/transfer/workflow.go | 3 ++- internal/service/transfer/workflow_test.go | 4 ++-- 26 files changed, 53 insertions(+), 41 deletions(-) diff --git a/internal/service/transfer/access.go b/internal/service/transfer/access.go index c776402660b..d92810ca00c 100644 --- a/internal/service/transfer/access.go +++ b/internal/service/transfer/access.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -187,7 +188,7 @@ func resourceAccessRead(ctx context.Context, d *schema.ResourceData, meta any) d access, err := findAccessByTwoPartKey(ctx, conn, serverID, externalID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Access (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/access_test.go b/internal/service/transfer/access_test.go index 7fbc8dcf9f7..03b7bfa84ed 100644 --- a/internal/service/transfer/access_test.go +++ b/internal/service/transfer/access_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -201,7 +201,7 @@ func testAccCheckAccessDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindAccessByTwoPartKey(ctx, conn, rs.Primary.Attributes["server_id"], rs.Primary.Attributes[names.AttrExternalID]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/agreement.go b/internal/service/transfer/agreement.go index 5cbfc627b4b..c74bc56040c 100644 --- a/internal/service/transfer/agreement.go +++ b/internal/service/transfer/agreement.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -121,7 +122,7 @@ func resourceAgreementRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findAgreementByTwoPartKey(ctx, conn, serverID, agreementID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Agreement (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/agreement_test.go b/internal/service/transfer/agreement_test.go index cd5e4fcc493..847b53f7edd 100644 --- a/internal/service/transfer/agreement_test.go +++ b/internal/service/transfer/agreement_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -179,7 +179,7 @@ func testAccCheckAgreementDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindAgreementByTwoPartKey(ctx, conn, rs.Primary.Attributes["server_id"], rs.Primary.Attributes["agreement_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/certificate.go b/internal/service/transfer/certificate.go index 3581603da7e..f192662a831 100644 --- a/internal/service/transfer/certificate.go +++ b/internal/service/transfer/certificate.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -132,7 +133,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta a output, err := findCertificateByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/certificate_test.go b/internal/service/transfer/certificate_test.go index 2e08bae4042..41d4b91847f 100644 --- a/internal/service/transfer/certificate_test.go +++ b/internal/service/transfer/certificate_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -334,7 +334,7 @@ func testAccCheckCertificateDestroy(ctx context.Context) resource.TestCheckFunc _, err := tftransfer.FindCertificateByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/connector.go b/internal/service/transfer/connector.go index f780b2f6c6a..d0e3cde77c7 100644 --- a/internal/service/transfer/connector.go +++ b/internal/service/transfer/connector.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -187,7 +188,7 @@ func resourceConnectorRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findConnectorByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Connector (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/connector_test.go b/internal/service/transfer/connector_test.go index 2f4f4b85740..af7a35ff2c2 100644 --- a/internal/service/transfer/connector_test.go +++ b/internal/service/transfer/connector_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -246,7 +246,7 @@ func testAccCheckConnectorDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindConnectorByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/host_key.go b/internal/service/transfer/host_key.go index 331521453ba..358c91bf987 100644 --- a/internal/service/transfer/host_key.go +++ b/internal/service/transfer/host_key.go @@ -26,6 +26,7 @@ import ( fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" tfstringplanmodifier "github.com/hashicorp/terraform-provider-aws/internal/framework/planmodifiers/stringplanmodifier" "github.com/hashicorp/terraform-provider-aws/internal/framework/privatestate" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -174,7 +175,7 @@ func (r *hostKeyResource) Read(ctx context.Context, request resource.ReadRequest serverID, hostKeyID := fwflex.StringValueFromFramework(ctx, data.ServerID), fwflex.StringValueFromFramework(ctx, data.HostKeyID) out, err := findHostKeyByTwoPartKey(ctx, conn, serverID, hostKeyID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/transfer/host_key_test.go b/internal/service/transfer/host_key_test.go index 096a19a6a85..b1b9453ac2b 100644 --- a/internal/service/transfer/host_key_test.go +++ b/internal/service/transfer/host_key_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -403,7 +403,7 @@ func testAccCheckHostKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindHostKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes["server_id"], rs.Primary.Attributes["host_key_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/profile.go b/internal/service/transfer/profile.go index 4d316683800..d05ad314bbd 100644 --- a/internal/service/transfer/profile.go +++ b/internal/service/transfer/profile.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func resourceProfileRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findProfileByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Profile (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/profile_test.go b/internal/service/transfer/profile_test.go index df5edc7775f..75f11c90846 100644 --- a/internal/service/transfer/profile_test.go +++ b/internal/service/transfer/profile_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -205,7 +205,7 @@ func testAccCheckProfileDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindProfileByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/server.go b/internal/service/transfer/server.go index 3b9b6a81f1e..73523d40fa7 100644 --- a/internal/service/transfer/server.go +++ b/internal/service/transfer/server.go @@ -24,6 +24,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -475,7 +476,7 @@ func resourceServerRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findServerByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Server (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -924,7 +925,7 @@ func statusServer(ctx context.Context, conn *transfer.Client, id string) sdkretr return func() (any, string, error) { output, err := findServerByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 3a5cab9dd04..d6c64a7baef 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -1494,7 +1494,7 @@ func testAccCheckServerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindServerByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/ssh_key.go b/internal/service/transfer/ssh_key.go index 453449b1fc5..444adb1e647 100644 --- a/internal/service/transfer/ssh_key.go +++ b/internal/service/transfer/ssh_key.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -98,7 +99,7 @@ func resourceSSHKeyRead(ctx context.Context, d *schema.ResourceData, meta any) d user, sshKey, err := findUserSSHKeyByThreePartKey(ctx, conn, serverID, userName, sshKeyID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer SSH Key (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/ssh_key_test.go b/internal/service/transfer/ssh_key_test.go index cbf29f89081..27857070c19 100644 --- a/internal/service/transfer/ssh_key_test.go +++ b/internal/service/transfer/ssh_key_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +114,7 @@ func testAccCheckSSHKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, _, err := tftransfer.FindUserSSHKeyByThreePartKey(ctx, conn, rs.Primary.Attributes["server_id"], rs.Primary.Attributes[names.AttrUserName], rs.Primary.Attributes["ssh_key_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/tag_gen.go b/internal/service/transfer/tag_gen.go index d1b8b44fc80..7f5aaa5d02d 100644 --- a/internal/service/transfer/tag_gen.go +++ b/internal/service/transfer/tag_gen.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -74,7 +74,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, meta any) diag value, err := findTag(ctx, conn, identifier, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] %s resource (%s) tag (%s) not found, removing from state", names.Transfer, identifier, key) d.SetId("") return diags diff --git a/internal/service/transfer/tag_gen_test.go b/internal/service/transfer/tag_gen_test.go index 76b7a5b36c1..2a876ec6178 100644 --- a/internal/service/transfer/tag_gen_test.go +++ b/internal/service/transfer/tag_gen_test.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -32,7 +32,7 @@ func testAccCheckTagDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tftransfer.FindTag(ctx, conn, identifier, key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/user.go b/internal/service/transfer/user.go index 9b5e0761950..9607a6769f0 100644 --- a/internal/service/transfer/user.go +++ b/internal/service/transfer/user.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -188,7 +189,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta any) dia user, err := findUserByTwoPartKey(ctx, conn, serverID, userName) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer User (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/user_test.go b/internal/service/transfer/user_test.go index 084930e01ff..078398dd885 100644 --- a/internal/service/transfer/user_test.go +++ b/internal/service/transfer/user_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -338,7 +338,7 @@ func testAccCheckUserDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindUserByTwoPartKey(ctx, conn, rs.Primary.Attributes["server_id"], rs.Primary.Attributes[names.AttrUserName]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/transfer/web_app.go b/internal/service/transfer/web_app.go index 35f18302a03..fac88b267a6 100644 --- a/internal/service/transfer/web_app.go +++ b/internal/service/transfer/web_app.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -164,7 +165,7 @@ func (r *webAppResource) Read(ctx context.Context, request resource.ReadRequest, webAppID := fwflex.StringValueFromFramework(ctx, data.WebAppID) out, err := findWebAppByID(ctx, conn, webAppID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/transfer/web_app_customization.go b/internal/service/transfer/web_app_customization.go index 1e7bc5190ad..bb2b26887ce 100644 --- a/internal/service/transfer/web_app_customization.go +++ b/internal/service/transfer/web_app_customization.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" ) @@ -126,7 +127,7 @@ func (r *webAppCustomizationResource) Read(ctx context.Context, request resource webAppID := fwflex.StringValueFromFramework(ctx, data.WebAppID) out, err := findWebAppCustomizationByID(ctx, conn, webAppID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/transfer/web_app_customization_test.go b/internal/service/transfer/web_app_customization_test.go index 772c072c7fc..71e90fdcce0 100644 --- a/internal/service/transfer/web_app_customization_test.go +++ b/internal/service/transfer/web_app_customization_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -287,7 +287,7 @@ func testAccCheckWebAppCustomizationDestroy(ctx context.Context) resource.TestCh } _, err := tftransfer.FindWebAppCustomizationByID(ctx, conn, rs.Primary.Attributes["web_app_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/transfer/web_app_test.go b/internal/service/transfer/web_app_test.go index d8c25981623..741ed1994af 100644 --- a/internal/service/transfer/web_app_test.go +++ b/internal/service/transfer/web_app_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -314,7 +314,7 @@ func testAccCheckWebAppDestroy(ctx context.Context) resource.TestCheckFunc { } _, err := tftransfer.FindWebAppByID(ctx, conn, rs.Primary.Attributes["web_app_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } if err != nil { diff --git a/internal/service/transfer/workflow.go b/internal/service/transfer/workflow.go index 32db9140a12..55c2168c0f9 100644 --- a/internal/service/transfer/workflow.go +++ b/internal/service/transfer/workflow.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -718,7 +719,7 @@ func resourceWorkflowRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findWorkflowByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Transfer Workflow (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/transfer/workflow_test.go b/internal/service/transfer/workflow_test.go index d43b1178888..19132488bb2 100644 --- a/internal/service/transfer/workflow_test.go +++ b/internal/service/transfer/workflow_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -332,7 +332,7 @@ func testAccCheckWorkflowDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tftransfer.FindWorkflowByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 2089d2d709e3994d5467d8f6e072ff4f1d1cad7c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:17 -0800 Subject: [PATCH 209/227] `verifiedpermissions` --- internal/service/verifiedpermissions/identity_source.go | 3 ++- internal/service/verifiedpermissions/identity_source_test.go | 4 ++-- internal/service/verifiedpermissions/policy.go | 3 ++- internal/service/verifiedpermissions/policy_store.go | 3 ++- internal/service/verifiedpermissions/policy_store_test.go | 4 ++-- internal/service/verifiedpermissions/policy_template.go | 3 ++- internal/service/verifiedpermissions/policy_template_test.go | 4 ++-- internal/service/verifiedpermissions/schema.go | 3 ++- internal/service/verifiedpermissions/schema_test.go | 4 ++-- 9 files changed, 18 insertions(+), 13 deletions(-) diff --git a/internal/service/verifiedpermissions/identity_source.go b/internal/service/verifiedpermissions/identity_source.go index 6d0ef45aa79..80c5701a54b 100644 --- a/internal/service/verifiedpermissions/identity_source.go +++ b/internal/service/verifiedpermissions/identity_source.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -276,7 +277,7 @@ func (r *identitySourceResource) Read(ctx context.Context, request resource.Read output, err := findIdentitySourceByIDAndPolicyStoreID(ctx, conn, state.ID.ValueString(), state.PolicyStoreID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } diff --git a/internal/service/verifiedpermissions/identity_source_test.go b/internal/service/verifiedpermissions/identity_source_test.go index 3c8a72c7e0b..1c86f61dc14 100644 --- a/internal/service/verifiedpermissions/identity_source_test.go +++ b/internal/service/verifiedpermissions/identity_source_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfverifiedpermissions "github.com/hashicorp/terraform-provider-aws/internal/service/verifiedpermissions" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -443,7 +443,7 @@ func testAccCheckIdentitySourceDestroy(ctx context.Context) resource.TestCheckFu _, err := tfverifiedpermissions.FindIdentitySourceByIDAndPolicyStoreID(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["policy_store_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/verifiedpermissions/policy.go b/internal/service/verifiedpermissions/policy.go index 308461eb866..b2008cacda0 100644 --- a/internal/service/verifiedpermissions/policy.go +++ b/internal/service/verifiedpermissions/policy.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -341,7 +342,7 @@ func (r *policyResource) Read(ctx context.Context, req resource.ReadRequest, res } out, err := findPolicyByID(ctx, conn, rID[0], rID[1]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } diff --git a/internal/service/verifiedpermissions/policy_store.go b/internal/service/verifiedpermissions/policy_store.go index 3c7f16f0f83..13a09233495 100644 --- a/internal/service/verifiedpermissions/policy_store.go +++ b/internal/service/verifiedpermissions/policy_store.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -157,7 +158,7 @@ func (r *policyStoreResource) Read(ctx context.Context, request resource.ReadReq output, err := findPolicyStoreByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/verifiedpermissions/policy_store_test.go b/internal/service/verifiedpermissions/policy_store_test.go index f13bc7f8baa..6586b6e5518 100644 --- a/internal/service/verifiedpermissions/policy_store_test.go +++ b/internal/service/verifiedpermissions/policy_store_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfverifiedpermissions "github.com/hashicorp/terraform-provider-aws/internal/service/verifiedpermissions" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -233,7 +233,7 @@ func testAccCheckPolicyStoreDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfverifiedpermissions.FindPolicyStoreByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/verifiedpermissions/policy_template.go b/internal/service/verifiedpermissions/policy_template.go index 69522c19812..1c49806d570 100644 --- a/internal/service/verifiedpermissions/policy_template.go +++ b/internal/service/verifiedpermissions/policy_template.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -142,7 +143,7 @@ func (r *policyTemplateResource) Read(ctx context.Context, request resource.Read output, err := findPolicyTemplateByID(ctx, conn, policyStoreID, policyTemplateID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } diff --git a/internal/service/verifiedpermissions/policy_template_test.go b/internal/service/verifiedpermissions/policy_template_test.go index 80ae11707e8..aa486209783 100644 --- a/internal/service/verifiedpermissions/policy_template_test.go +++ b/internal/service/verifiedpermissions/policy_template_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfverifiedpermissions "github.com/hashicorp/terraform-provider-aws/internal/service/verifiedpermissions" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func testAccCheckPolicyTemplateDestroy(ctx context.Context) resource.TestCheckFu _, err = tfverifiedpermissions.FindPolicyTemplateByID(ctx, conn, policyStoreID, policyTemplateID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/verifiedpermissions/schema.go b/internal/service/verifiedpermissions/schema.go index ae08ae92972..01f3e5c10cd 100644 --- a/internal/service/verifiedpermissions/schema.go +++ b/internal/service/verifiedpermissions/schema.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -135,7 +136,7 @@ func (r *schemaResource) Read(ctx context.Context, request resource.ReadRequest, out, err := findSchemaByPolicyStoreID(ctx, conn, state.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.State.RemoveResource(ctx) return } diff --git a/internal/service/verifiedpermissions/schema_test.go b/internal/service/verifiedpermissions/schema_test.go index ba45cd0c1b2..8f0b0200e39 100644 --- a/internal/service/verifiedpermissions/schema_test.go +++ b/internal/service/verifiedpermissions/schema_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfverifiedpermissions "github.com/hashicorp/terraform-provider-aws/internal/service/verifiedpermissions" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func testAccCheckSchemaDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfverifiedpermissions.FindSchemaByPolicyStoreID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 43c2e5361faffc069b43cc9ba2fef7cfa71348f6 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:18 -0800 Subject: [PATCH 210/227] `vpclattice` --- internal/service/vpclattice/access_log_subscription.go | 3 ++- internal/service/vpclattice/access_log_subscription_test.go | 4 ++-- internal/service/vpclattice/auth_policy.go | 3 ++- internal/service/vpclattice/auth_policy_test.go | 4 ++-- internal/service/vpclattice/domain_verification.go | 3 ++- internal/service/vpclattice/domain_verification_test.go | 4 ++-- internal/service/vpclattice/listener.go | 3 ++- internal/service/vpclattice/listener_rule.go | 3 ++- internal/service/vpclattice/listener_rule_test.go | 4 ++-- internal/service/vpclattice/listener_test.go | 4 ++-- internal/service/vpclattice/resource_configuration.go | 5 +++-- internal/service/vpclattice/resource_configuration_test.go | 4 ++-- internal/service/vpclattice/resource_gateway.go | 5 +++-- internal/service/vpclattice/resource_gateway_test.go | 4 ++-- internal/service/vpclattice/resource_policy.go | 3 ++- internal/service/vpclattice/resource_policy_test.go | 4 ++-- internal/service/vpclattice/service.go | 5 +++-- internal/service/vpclattice/service_network.go | 3 ++- .../vpclattice/service_network_resource_association.go | 5 +++-- .../vpclattice/service_network_resource_association_test.go | 4 ++-- .../vpclattice/service_network_service_association.go | 5 +++-- .../vpclattice/service_network_service_association_test.go | 4 ++-- internal/service/vpclattice/service_network_test.go | 4 ++-- .../service/vpclattice/service_network_vpc_association.go | 5 +++-- .../vpclattice/service_network_vpc_association_test.go | 4 ++-- internal/service/vpclattice/service_test.go | 4 ++-- internal/service/vpclattice/target_group.go | 5 +++-- internal/service/vpclattice/target_group_attachment.go | 5 +++-- internal/service/vpclattice/target_group_attachment_test.go | 4 ++-- internal/service/vpclattice/target_group_test.go | 4 ++-- 30 files changed, 68 insertions(+), 53 deletions(-) diff --git a/internal/service/vpclattice/access_log_subscription.go b/internal/service/vpclattice/access_log_subscription.go index 57a3ccf8a94..a26812f7613 100644 --- a/internal/service/vpclattice/access_log_subscription.go +++ b/internal/service/vpclattice/access_log_subscription.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -106,7 +107,7 @@ func resourceAccessLogSubscriptionRead(ctx context.Context, d *schema.ResourceDa output, err := findAccessLogSubscriptionByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Access Log Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/vpclattice/access_log_subscription_test.go b/internal/service/vpclattice/access_log_subscription_test.go index 39e63132185..b76bd0fc555 100644 --- a/internal/service/vpclattice/access_log_subscription_test.go +++ b/internal/service/vpclattice/access_log_subscription_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -296,7 +296,7 @@ func testAccCheckAccessLogSubscriptionDestroy(ctx context.Context) resource.Test _, err := tfvpclattice.FindAccessLogSubscriptionByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/auth_policy.go b/internal/service/vpclattice/auth_policy.go index 262b53d1084..ff6ac0a3e7d 100644 --- a/internal/service/vpclattice/auth_policy.go +++ b/internal/service/vpclattice/auth_policy.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -89,7 +90,7 @@ func resourceAuthPolicyRead(ctx context.Context, d *schema.ResourceData, meta an output, err := findAuthPolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Auth Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/vpclattice/auth_policy_test.go b/internal/service/vpclattice/auth_policy_test.go index 98b4148a10b..17583fde0ad 100644 --- a/internal/service/vpclattice/auth_policy_test.go +++ b/internal/service/vpclattice/auth_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func testAccCheckAuthPolicyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfvpclattice.FindAuthPolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/domain_verification.go b/internal/service/vpclattice/domain_verification.go index 9ec5329bc98..79a9bbc4429 100644 --- a/internal/service/vpclattice/domain_verification.go +++ b/internal/service/vpclattice/domain_verification.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -148,7 +149,7 @@ func (r *domainVerificationResource) Read(ctx context.Context, request resource. output, err := findDomainVerificationByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/vpclattice/domain_verification_test.go b/internal/service/vpclattice/domain_verification_test.go index f38208d14c6..5841f4f0f27 100644 --- a/internal/service/vpclattice/domain_verification_test.go +++ b/internal/service/vpclattice/domain_verification_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -91,7 +91,7 @@ func testAccCheckDomainVerificationDestroy(ctx context.Context) resource.TestChe _, err := tfvpclattice.FindDomainVerificationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/listener.go b/internal/service/vpclattice/listener.go index 6f2723ae39f..0778c695bae 100644 --- a/internal/service/vpclattice/listener.go +++ b/internal/service/vpclattice/listener.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -197,7 +198,7 @@ func resourceListenerRead(ctx context.Context, d *schema.ResourceData, meta any) output, err := findListenerByTwoPartKey(ctx, conn, serviceID, listenerID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Listener (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/vpclattice/listener_rule.go b/internal/service/vpclattice/listener_rule.go index 3c9c19fb45f..4865f5fe420 100644 --- a/internal/service/vpclattice/listener_rule.go +++ b/internal/service/vpclattice/listener_rule.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -298,7 +299,7 @@ func resourceListenerRuleRead(ctx context.Context, d *schema.ResourceData, meta output, err := findListenerRuleByThreePartKey(ctx, conn, serviceID, listenerID, ruleID) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Listener Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/vpclattice/listener_rule_test.go b/internal/service/vpclattice/listener_rule_test.go index 21ed2b02960..3decc1ef619 100644 --- a/internal/service/vpclattice/listener_rule_test.go +++ b/internal/service/vpclattice/listener_rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -412,7 +412,7 @@ func testAccCheckListenerRuleDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfvpclattice.FindListenerRuleByThreePartKey(ctx, conn, rs.Primary.Attributes["service_identifier"], rs.Primary.Attributes["listener_identifier"], rs.Primary.Attributes["rule_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/listener_test.go b/internal/service/vpclattice/listener_test.go index 9f958494b02..03d0cccf07f 100644 --- a/internal/service/vpclattice/listener_test.go +++ b/internal/service/vpclattice/listener_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -484,7 +484,7 @@ func testAccCheckListenerDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfvpclattice.FindListenerByTwoPartKey(ctx, conn, rs.Primary.Attributes["service_identifier"], rs.Primary.Attributes["listener_id"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/resource_configuration.go b/internal/service/vpclattice/resource_configuration.go index 3637c64a14b..c3b428282d2 100644 --- a/internal/service/vpclattice/resource_configuration.go +++ b/internal/service/vpclattice/resource_configuration.go @@ -36,6 +36,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -310,7 +311,7 @@ func (r *resourceConfigurationResource) Read(ctx context.Context, request resour output, err := findResourceConfigurationByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -453,7 +454,7 @@ func statusResourceConfiguration(ctx context.Context, conn *vpclattice.Client, i return func() (any, string, error) { output, err := findResourceConfigurationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/resource_configuration_test.go b/internal/service/vpclattice/resource_configuration_test.go index 51a151f1cbc..90cb803edf9 100644 --- a/internal/service/vpclattice/resource_configuration_test.go +++ b/internal/service/vpclattice/resource_configuration_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -365,7 +365,7 @@ func testAccCheckResourceConfigurationDestroy(ctx context.Context) resource.Test _, err := tfvpclattice.FindResourceConfigurationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/resource_gateway.go b/internal/service/vpclattice/resource_gateway.go index 49349cb13a2..2f198b25c77 100644 --- a/internal/service/vpclattice/resource_gateway.go +++ b/internal/service/vpclattice/resource_gateway.go @@ -31,6 +31,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -194,7 +195,7 @@ func (r *resourceGatewayResource) Read(ctx context.Context, request resource.Rea output, err := findResourceGatewayByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -324,7 +325,7 @@ func statusResourceGateway(ctx context.Context, conn *vpclattice.Client, id stri return func() (any, string, error) { output, err := findResourceGatewayByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/resource_gateway_test.go b/internal/service/vpclattice/resource_gateway_test.go index 975798df5c0..d04d9d03031 100644 --- a/internal/service/vpclattice/resource_gateway_test.go +++ b/internal/service/vpclattice/resource_gateway_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -308,7 +308,7 @@ func testAccCheckResourceGatewayDestroy(ctx context.Context) resource.TestCheckF _, err := tfvpclattice.FindResourceGatewayByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/resource_policy.go b/internal/service/vpclattice/resource_policy.go index 938f98a52da..ac06119ea9b 100644 --- a/internal/service/vpclattice/resource_policy.go +++ b/internal/service/vpclattice/resource_policy.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -82,7 +83,7 @@ func resourceResourcePolicyRead(ctx context.Context, d *schema.ResourceData, met output, err := findResourcePolicyByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Resource Policy (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/vpclattice/resource_policy_test.go b/internal/service/vpclattice/resource_policy_test.go index efa50b5551c..61429f163da 100644 --- a/internal/service/vpclattice/resource_policy_test.go +++ b/internal/service/vpclattice/resource_policy_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -92,7 +92,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfvpclattice.FindResourcePolicyByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/service.go b/internal/service/vpclattice/service.go index 34d30219577..f8db3b42c92 100644 --- a/internal/service/vpclattice/service.go +++ b/internal/service/vpclattice/service.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -149,7 +150,7 @@ func resourceServiceRead(ctx context.Context, d *schema.ResourceData, meta any) out, err := findServiceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Service (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -266,7 +267,7 @@ func statusService(ctx context.Context, conn *vpclattice.Client, id string) sdkr return func() (any, string, error) { out, err := findServiceByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/service_network.go b/internal/service/vpclattice/service_network.go index c55b085afad..bad10148a8b 100644 --- a/internal/service/vpclattice/service_network.go +++ b/internal/service/vpclattice/service_network.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -94,7 +95,7 @@ func resourceServiceNetworkRead(ctx context.Context, d *schema.ResourceData, met output, err := findServiceNetworkByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Service Network (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/vpclattice/service_network_resource_association.go b/internal/service/vpclattice/service_network_resource_association.go index 5e5f8f61344..52da5f96de3 100644 --- a/internal/service/vpclattice/service_network_resource_association.go +++ b/internal/service/vpclattice/service_network_resource_association.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -140,7 +141,7 @@ func (r *serviceNetworkResourceAssociationResource) Read(ctx context.Context, re output, err := findServiceNetworkResourceAssociationByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) @@ -222,7 +223,7 @@ func statusServiceNetworkResourceAssociation(ctx context.Context, conn *vpclatti return func() (any, string, error) { output, err := findServiceNetworkResourceAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/service_network_resource_association_test.go b/internal/service/vpclattice/service_network_resource_association_test.go index a29c63ae5c6..f43b013e275 100644 --- a/internal/service/vpclattice/service_network_resource_association_test.go +++ b/internal/service/vpclattice/service_network_resource_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func testAccCheckServiceNetworkResourceAssociationDestroy(ctx context.Context) r } _, err := tfvpclattice.FindServiceNetworkResourceAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/service_network_service_association.go b/internal/service/vpclattice/service_network_service_association.go index 30be0bc1065..32ddaa530b0 100644 --- a/internal/service/vpclattice/service_network_service_association.go +++ b/internal/service/vpclattice/service_network_service_association.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -128,7 +129,7 @@ func resourceServiceNetworkServiceAssociationRead(ctx context.Context, d *schema output, err := findServiceNetworkServiceAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Service Network Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -218,7 +219,7 @@ func statusServiceNetworkServiceAssociation(ctx context.Context, conn *vpclattic return func() (any, string, error) { output, err := findServiceNetworkServiceAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/service_network_service_association_test.go b/internal/service/vpclattice/service_network_service_association_test.go index 5126471126f..2927e60cb0d 100644 --- a/internal/service/vpclattice/service_network_service_association_test.go +++ b/internal/service/vpclattice/service_network_service_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -173,7 +173,7 @@ func testAccCheckServiceNetworkServiceAssociationDestroy(ctx context.Context) re _, err := tfvpclattice.FindServiceNetworkServiceAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/service_network_test.go b/internal/service/vpclattice/service_network_test.go index 5ee2d8826a7..c761f5b9485 100644 --- a/internal/service/vpclattice/service_network_test.go +++ b/internal/service/vpclattice/service_network_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -240,7 +240,7 @@ func testAccCheckServiceNetworkDestroy(ctx context.Context) resource.TestCheckFu _, err := tfvpclattice.FindServiceNetworkByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/service_network_vpc_association.go b/internal/service/vpclattice/service_network_vpc_association.go index 391f82ee5e8..1682821d12d 100644 --- a/internal/service/vpclattice/service_network_vpc_association.go +++ b/internal/service/vpclattice/service_network_vpc_association.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -118,7 +119,7 @@ func resourceServiceNetworkVPCAssociationRead(ctx context.Context, d *schema.Res output, err := findServiceNetworkVPCAssociationByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPCLattice Service Network VPC Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -219,7 +220,7 @@ func statusServiceNetworkVPCAssociation(ctx context.Context, conn *vpclattice.Cl return func() (any, string, error) { output, err := findServiceNetworkVPCAssociationByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/service_network_vpc_association_test.go b/internal/service/vpclattice/service_network_vpc_association_test.go index 3b58722635b..dc64080e23c 100644 --- a/internal/service/vpclattice/service_network_vpc_association_test.go +++ b/internal/service/vpclattice/service_network_vpc_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -209,7 +209,7 @@ func testAccCheckServiceNetworkVPCAssociationDestroy(ctx context.Context) resour _, err := tfvpclattice.FindServiceNetworkVPCAssociationByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/service_test.go b/internal/service/vpclattice/service_test.go index adde558b212..57ed28271eb 100644 --- a/internal/service/vpclattice/service_test.go +++ b/internal/service/vpclattice/service_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -177,7 +177,7 @@ func testAccCheckServiceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfvpclattice.FindServiceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/target_group.go b/internal/service/vpclattice/target_group.go index a454b23249e..d192919c0d1 100644 --- a/internal/service/vpclattice/target_group.go +++ b/internal/service/vpclattice/target_group.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/sdkv2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -241,7 +242,7 @@ func resourceTargetGroupRead(ctx context.Context, d *schema.ResourceData, meta a out, err := findTargetGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Lattice Target Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -361,7 +362,7 @@ func statusTargetGroup(ctx context.Context, conn *vpclattice.Client, id string) return func() (any, string, error) { output, err := findTargetGroupByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/target_group_attachment.go b/internal/service/vpclattice/target_group_attachment.go index 47301b544dc..240001a0561 100644 --- a/internal/service/vpclattice/target_group_attachment.go +++ b/internal/service/vpclattice/target_group_attachment.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -113,7 +114,7 @@ func resourceTargetGroupAttachmentRead(ctx context.Context, d *schema.ResourceDa targetPort := aws.ToInt32(target.Port) output, err := findTargetByThreePartKey(ctx, conn, targetGroupID, targetID, targetPort) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] VPC Lattice Target Group Attachment (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -227,7 +228,7 @@ func statusTarget(ctx context.Context, conn *vpclattice.Client, targetGroupID, t return func() (any, string, error) { output, err := findTargetByThreePartKey(ctx, conn, targetGroupID, targetID, targetPort) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/vpclattice/target_group_attachment_test.go b/internal/service/vpclattice/target_group_attachment_test.go index be53cea58ca..a22b7bd3999 100644 --- a/internal/service/vpclattice/target_group_attachment_test.go +++ b/internal/service/vpclattice/target_group_attachment_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -172,7 +172,7 @@ func testAccCheckTargetGroupAttachmentDestroy(ctx context.Context) resource.Test _, err := tfvpclattice.FindTargetByThreePartKey(ctx, conn, rs.Primary.Attributes["target_group_identifier"], rs.Primary.Attributes["target.0.id"], flex.StringValueToInt32Value(rs.Primary.Attributes["target.0.port"])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/vpclattice/target_group_test.go b/internal/service/vpclattice/target_group_test.go index 999f79dd56a..ffbc3d48e13 100644 --- a/internal/service/vpclattice/target_group_test.go +++ b/internal/service/vpclattice/target_group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -356,7 +356,7 @@ func testAccCheckTargetGroupDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfvpclattice.FindTargetGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 188d87c6c3b6da539f82b9a444dd356f25b3e106 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:18 -0800 Subject: [PATCH 211/227] `waf` --- internal/service/waf/byte_match_set.go | 3 ++- internal/service/waf/byte_match_set_test.go | 4 ++-- internal/service/waf/geo_match_set.go | 3 ++- internal/service/waf/geo_match_set_test.go | 4 ++-- internal/service/waf/ipset.go | 3 ++- internal/service/waf/ipset_test.go | 4 ++-- internal/service/waf/rate_based_rule.go | 3 ++- internal/service/waf/rate_based_rule_test.go | 4 ++-- internal/service/waf/regex_match_set.go | 3 ++- internal/service/waf/regex_match_set_test.go | 4 ++-- internal/service/waf/regex_pattern_set.go | 3 ++- internal/service/waf/regex_pattern_set_test.go | 4 ++-- internal/service/waf/rule.go | 3 ++- internal/service/waf/rule_group.go | 3 ++- internal/service/waf/rule_group_test.go | 4 ++-- internal/service/waf/rule_test.go | 4 ++-- internal/service/waf/size_constraint_set.go | 3 ++- internal/service/waf/size_constraint_set_test.go | 4 ++-- internal/service/waf/sql_injection_match_set.go | 3 ++- internal/service/waf/sql_injection_match_set_test.go | 4 ++-- internal/service/waf/web_acl.go | 3 ++- internal/service/waf/web_acl_test.go | 4 ++-- internal/service/waf/xss_match_set.go | 3 ++- internal/service/waf/xss_match_set_test.go | 4 ++-- 24 files changed, 48 insertions(+), 36 deletions(-) diff --git a/internal/service/waf/byte_match_set.go b/internal/service/waf/byte_match_set.go index 90826f4a3eb..83db30fd5cd 100644 --- a/internal/service/waf/byte_match_set.go +++ b/internal/service/waf/byte_match_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -116,7 +117,7 @@ func resourceByteMatchSetRead(ctx context.Context, d *schema.ResourceData, meta byteMatchSet, err := findByteMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF ByteMatchSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/byte_match_set_test.go b/internal/service/waf/byte_match_set_test.go index f467575a1d0..74a1ad025f6 100644 --- a/internal/service/waf/byte_match_set_test.go +++ b/internal/service/waf/byte_match_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -258,7 +258,7 @@ func testAccCheckByteMatchSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfwaf.FindByteMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/geo_match_set.go b/internal/service/waf/geo_match_set.go index 7883840ab99..4941648ddea 100644 --- a/internal/service/waf/geo_match_set.go +++ b/internal/service/waf/geo_match_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -93,7 +94,7 @@ func resourceGeoMatchSetRead(ctx context.Context, d *schema.ResourceData, meta a geoMatchSet, err := findGeoMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF GeoMatchSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/geo_match_set_test.go b/internal/service/waf/geo_match_set_test.go index 0a8c74537fb..2fed0f9c985 100644 --- a/internal/service/waf/geo_match_set_test.go +++ b/internal/service/waf/geo_match_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -234,7 +234,7 @@ func testAccCheckGeoMatchSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfwaf.FindGeoMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/ipset.go b/internal/service/waf/ipset.go index d52ac942e6e..49bae19b1c2 100644 --- a/internal/service/waf/ipset.go +++ b/internal/service/waf/ipset.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -103,7 +104,7 @@ func resourceIPSetRead(ctx context.Context, d *schema.ResourceData, meta any) di ipSet, err := findIPSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF IPSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/ipset_test.go b/internal/service/waf/ipset_test.go index d980197ec80..24c4171c861 100644 --- a/internal/service/waf/ipset_test.go +++ b/internal/service/waf/ipset_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -282,7 +282,7 @@ func testAccCheckIPSetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwaf.FindIPSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/rate_based_rule.go b/internal/service/waf/rate_based_rule.go index 87fde59fd7d..3ce710ec49e 100644 --- a/internal/service/waf/rate_based_rule.go +++ b/internal/service/waf/rate_based_rule.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func resourceRateBasedRuleRead(ctx context.Context, d *schema.ResourceData, meta rule, err := findRateBasedRuleByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Rate Based Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/rate_based_rule_test.go b/internal/service/waf/rate_based_rule_test.go index 1efe1de981e..a6482e4aae1 100644 --- a/internal/service/waf/rate_based_rule_test.go +++ b/internal/service/waf/rate_based_rule_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -326,7 +326,7 @@ func testAccCheckRateBasedRuleDestroy(ctx context.Context) resource.TestCheckFun _, err := tfwaf.FindRateBasedRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/regex_match_set.go b/internal/service/waf/regex_match_set.go index c113054a200..489e860c765 100644 --- a/internal/service/waf/regex_match_set.go +++ b/internal/service/waf/regex_match_set.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -117,7 +118,7 @@ func resourceRegexMatchSetRead(ctx context.Context, d *schema.ResourceData, meta regexMatchSet, err := findRegexMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regex Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/regex_match_set_test.go b/internal/service/waf/regex_match_set_test.go index 13513ea1da1..b640f4d3a62 100644 --- a/internal/service/waf/regex_match_set_test.go +++ b/internal/service/waf/regex_match_set_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -240,7 +240,7 @@ func testAccCheckRegexMatchSetDestroy(ctx context.Context) resource.TestCheckFun _, err := tfwaf.FindRegexMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/regex_pattern_set.go b/internal/service/waf/regex_pattern_set.go index 3d0f48c1250..c526169b1b8 100644 --- a/internal/service/waf/regex_pattern_set.go +++ b/internal/service/waf/regex_pattern_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -83,7 +84,7 @@ func resourceRegexPatternSetRead(ctx context.Context, d *schema.ResourceData, me regexPatternSet, err := findRegexPatternSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regex Pattern Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/regex_pattern_set_test.go b/internal/service/waf/regex_pattern_set_test.go index 0b3ce7a2031..4c2229718a4 100644 --- a/internal/service/waf/regex_pattern_set_test.go +++ b/internal/service/waf/regex_pattern_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -194,7 +194,7 @@ func testAccCheckRegexPatternSetDestroy(ctx context.Context) resource.TestCheckF _, err := tfwaf.FindRegexPatternSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/rule.go b/internal/service/waf/rule.go index 15e0821c5d4..260fd9946fe 100644 --- a/internal/service/waf/rule.go +++ b/internal/service/waf/rule.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -122,7 +123,7 @@ func resourceRuleRead(ctx context.Context, d *schema.ResourceData, meta any) dia rule, err := findRuleByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/rule_group.go b/internal/service/waf/rule_group.go index f5b89e5cb66..ad47533aae3 100644 --- a/internal/service/waf/rule_group.go +++ b/internal/service/waf/rule_group.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -130,7 +131,7 @@ func resourceRuleGroupRead(ctx context.Context, d *schema.ResourceData, meta any ruleGroup, err := findRuleGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Rule Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/rule_group_test.go b/internal/service/waf/rule_group_test.go index dbded582a51..996796816c7 100644 --- a/internal/service/waf/rule_group_test.go +++ b/internal/service/waf/rule_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -315,7 +315,7 @@ func testAccCheckRuleGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwaf.FindRuleGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/rule_test.go b/internal/service/waf/rule_test.go index 70280c42226..5f47af6d1f4 100644 --- a/internal/service/waf/rule_test.go +++ b/internal/service/waf/rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -303,7 +303,7 @@ func testAccCheckRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwaf.FindRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/size_constraint_set.go b/internal/service/waf/size_constraint_set.go index e4ee7d09f6f..7908c80bb26 100644 --- a/internal/service/waf/size_constraint_set.go +++ b/internal/service/waf/size_constraint_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +115,7 @@ func resourceSizeConstraintSetRead(ctx context.Context, d *schema.ResourceData, sizeConstraintSet, err := findSizeConstraintSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Size Constraint Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/size_constraint_set_test.go b/internal/service/waf/size_constraint_set_test.go index f053e9463a4..51a5370b899 100644 --- a/internal/service/waf/size_constraint_set_test.go +++ b/internal/service/waf/size_constraint_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -240,7 +240,7 @@ func testAccCheckSizeConstraintSetDestroy(ctx context.Context) resource.TestChec _, err := tfwaf.FindSizeConstraintSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/sql_injection_match_set.go b/internal/service/waf/sql_injection_match_set.go index 9ee12d9f568..ff75329dfa8 100644 --- a/internal/service/waf/sql_injection_match_set.go +++ b/internal/service/waf/sql_injection_match_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +107,7 @@ func resourceSQLInjectionMatchSetRead(ctx context.Context, d *schema.ResourceDat sqlInjectionMatchSet, err := findSQLInjectionMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF SqlInjectionMatchSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/sql_injection_match_set_test.go b/internal/service/waf/sql_injection_match_set_test.go index 222c568d6f8..ac77538f778 100644 --- a/internal/service/waf/sql_injection_match_set_test.go +++ b/internal/service/waf/sql_injection_match_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -222,7 +222,7 @@ func testAccCheckSQLInjectionMatchSetDestroy(ctx context.Context) resource.TestC _, err := tfwaf.FindSQLInjectionMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/web_acl.go b/internal/service/waf/web_acl.go index c04dd77e42b..8c9338266d3 100644 --- a/internal/service/waf/web_acl.go +++ b/internal/service/waf/web_acl.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -220,7 +221,7 @@ func resourceWebACLRead(ctx context.Context, d *schema.ResourceData, meta any) d webACL, err := findWebACLByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Web ACL (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/web_acl_test.go b/internal/service/waf/web_acl_test.go index 5dda7c01ad2..5b24d54b759 100644 --- a/internal/service/waf/web_acl_test.go +++ b/internal/service/waf/web_acl_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -333,7 +333,7 @@ func testAccCheckWebACLDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwaf.FindWebACLByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/waf/xss_match_set.go b/internal/service/waf/xss_match_set.go index a273dee0a6f..d15cea8c50c 100644 --- a/internal/service/waf/xss_match_set.go +++ b/internal/service/waf/xss_match_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +116,7 @@ func resourceXSSMatchSetRead(ctx context.Context, d *schema.ResourceData, meta a xssMatchSet, err := findXSSMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF XSS Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/waf/xss_match_set_test.go b/internal/service/waf/xss_match_set_test.go index de19c871b34..b6299fce6d7 100644 --- a/internal/service/waf/xss_match_set_test.go +++ b/internal/service/waf/xss_match_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -246,7 +246,7 @@ func testAccCheckXSSMatchSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfwaf.FindXSSMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 5ecf17e9a1a24c386ec038ff0aad04785e9b99c5 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:20 -0800 Subject: [PATCH 212/227] `wafregional` --- internal/service/wafregional/byte_match_set.go | 3 ++- internal/service/wafregional/byte_match_set_test.go | 4 ++-- internal/service/wafregional/geo_match_set.go | 3 ++- internal/service/wafregional/geo_match_set_test.go | 4 ++-- internal/service/wafregional/ipset.go | 3 ++- internal/service/wafregional/ipset_test.go | 4 ++-- internal/service/wafregional/rate_based_rule.go | 3 ++- internal/service/wafregional/rate_based_rule_test.go | 4 ++-- internal/service/wafregional/regex_match_set.go | 3 ++- internal/service/wafregional/regex_match_set_test.go | 4 ++-- internal/service/wafregional/regex_pattern_set.go | 3 ++- internal/service/wafregional/regex_pattern_set_test.go | 4 ++-- internal/service/wafregional/rule.go | 3 ++- internal/service/wafregional/rule_group.go | 3 ++- internal/service/wafregional/rule_group_test.go | 4 ++-- internal/service/wafregional/rule_test.go | 4 ++-- internal/service/wafregional/size_constraint_set.go | 3 ++- internal/service/wafregional/size_constraint_set_test.go | 4 ++-- internal/service/wafregional/sql_injection_match_set.go | 3 ++- internal/service/wafregional/sql_injection_match_set_test.go | 4 ++-- internal/service/wafregional/web_acl.go | 3 ++- internal/service/wafregional/web_acl_association.go | 3 ++- internal/service/wafregional/web_acl_association_test.go | 4 ++-- internal/service/wafregional/web_acl_test.go | 4 ++-- internal/service/wafregional/xss_match_set.go | 3 ++- internal/service/wafregional/xss_match_set_test.go | 4 ++-- 26 files changed, 52 insertions(+), 39 deletions(-) diff --git a/internal/service/wafregional/byte_match_set.go b/internal/service/wafregional/byte_match_set.go index af7d6c64118..2670dc3ff81 100644 --- a/internal/service/wafregional/byte_match_set.go +++ b/internal/service/wafregional/byte_match_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +112,7 @@ func resourceByteMatchSetRead(ctx context.Context, d *schema.ResourceData, meta byteMatchSet, err := findByteMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Byte Set Match (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/byte_match_set_test.go b/internal/service/wafregional/byte_match_set_test.go index be8d5c32281..1edfad0bd23 100644 --- a/internal/service/wafregional/byte_match_set_test.go +++ b/internal/service/wafregional/byte_match_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -296,7 +296,7 @@ func testAccCheckByteMatchSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfwafregional.FindByteMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/geo_match_set.go b/internal/service/wafregional/geo_match_set.go index 70a9ba0a803..3c5caca9780 100644 --- a/internal/service/wafregional/geo_match_set.go +++ b/internal/service/wafregional/geo_match_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -90,7 +91,7 @@ func resourceGeoMatchSetRead(ctx context.Context, d *schema.ResourceData, meta a geoMatchSet, err := findGeoMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Geo Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/geo_match_set_test.go b/internal/service/wafregional/geo_match_set_test.go index cc3d451b260..7634a96dc3e 100644 --- a/internal/service/wafregional/geo_match_set_test.go +++ b/internal/service/wafregional/geo_match_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -258,7 +258,7 @@ func testAccCheckGeoMatchSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfwafregional.FindGeoMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/ipset.go b/internal/service/wafregional/ipset.go index d62ff82b1e7..6c7c2613650 100644 --- a/internal/service/wafregional/ipset.go +++ b/internal/service/wafregional/ipset.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -95,7 +96,7 @@ func resourceIPSetRead(ctx context.Context, d *schema.ResourceData, meta any) di ipSet, err := findIPSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional IPSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/ipset_test.go b/internal/service/wafregional/ipset_test.go index 409d54996fe..ae536b589a8 100644 --- a/internal/service/wafregional/ipset_test.go +++ b/internal/service/wafregional/ipset_test.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -254,7 +254,7 @@ func testAccCheckIPSetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafregional.FindIPSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/rate_based_rule.go b/internal/service/wafregional/rate_based_rule.go index 9b49101185f..16f31bbc096 100644 --- a/internal/service/wafregional/rate_based_rule.go +++ b/internal/service/wafregional/rate_based_rule.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -133,7 +134,7 @@ func resourceRateBasedRuleRead(ctx context.Context, d *schema.ResourceData, meta rule, err := findRateBasedRuleByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Rate Based Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/rate_based_rule_test.go b/internal/service/wafregional/rate_based_rule_test.go index 90201ad7488..43fe3293d8e 100644 --- a/internal/service/wafregional/rate_based_rule_test.go +++ b/internal/service/wafregional/rate_based_rule_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -297,7 +297,7 @@ func testAccCheckRateBasedRuleDestroy(ctx context.Context) resource.TestCheckFun _, err := tfwafregional.FindRateBasedRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/regex_match_set.go b/internal/service/wafregional/regex_match_set.go index 6c1cef3c8b9..6608ae3e2d8 100644 --- a/internal/service/wafregional/regex_match_set.go +++ b/internal/service/wafregional/regex_match_set.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -114,7 +115,7 @@ func resourceRegexMatchSetRead(ctx context.Context, d *schema.ResourceData, meta regexMatchSet, err := findRegexMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Regex Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/regex_match_set_test.go b/internal/service/wafregional/regex_match_set_test.go index 0d5015890c8..bd19cd3288f 100644 --- a/internal/service/wafregional/regex_match_set_test.go +++ b/internal/service/wafregional/regex_match_set_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -224,7 +224,7 @@ func testAccCheckRegexMatchSetDestroy(ctx context.Context) resource.TestCheckFun _, err := tfwafregional.FindRegexMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/regex_pattern_set.go b/internal/service/wafregional/regex_pattern_set.go index 985aee773fa..5959cc79188 100644 --- a/internal/service/wafregional/regex_pattern_set.go +++ b/internal/service/wafregional/regex_pattern_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -80,7 +81,7 @@ func resourceRegexPatternSetRead(ctx context.Context, d *schema.ResourceData, me regexPatternSet, err := findRegexPatternSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Regex Pattern Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/regex_pattern_set_test.go b/internal/service/wafregional/regex_pattern_set_test.go index 64f3bd9c92d..d974c6f31bc 100644 --- a/internal/service/wafregional/regex_pattern_set_test.go +++ b/internal/service/wafregional/regex_pattern_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -192,7 +192,7 @@ func testAccCheckRegexPatternSetDestroy(ctx context.Context) resource.TestCheckF _, err := tfwafregional.FindRegexPatternSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/rule.go b/internal/service/wafregional/rule.go index fb857d9d5af..61eb7d6542e 100644 --- a/internal/service/wafregional/rule.go +++ b/internal/service/wafregional/rule.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func resourceRuleRead(ctx context.Context, d *schema.ResourceData, meta any) dia rule, err := findRuleByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/rule_group.go b/internal/service/wafregional/rule_group.go index bdff83193a9..ce2384226cc 100644 --- a/internal/service/wafregional/rule_group.go +++ b/internal/service/wafregional/rule_group.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -132,7 +133,7 @@ func resourceRuleGroupRead(ctx context.Context, d *schema.ResourceData, meta any ruleGroup, err := findRuleGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Rule Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/rule_group_test.go b/internal/service/wafregional/rule_group_test.go index 33eb420f396..fb52124e909 100644 --- a/internal/service/wafregional/rule_group_test.go +++ b/internal/service/wafregional/rule_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -291,7 +291,7 @@ func testAccCheckRuleGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafregional.FindRuleGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/rule_test.go b/internal/service/wafregional/rule_test.go index 324e5aeca9d..bfe17968bc0 100644 --- a/internal/service/wafregional/rule_test.go +++ b/internal/service/wafregional/rule_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -277,7 +277,7 @@ func testAccCheckRuleDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafregional.FindRuleByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/size_constraint_set.go b/internal/service/wafregional/size_constraint_set.go index dec24e86736..8801c7aa956 100644 --- a/internal/service/wafregional/size_constraint_set.go +++ b/internal/service/wafregional/size_constraint_set.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -115,7 +116,7 @@ func resourceSizeConstraintSetRead(ctx context.Context, d *schema.ResourceData, sizeConstraintSet, err := findSizeConstraintSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Size Constraint Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/size_constraint_set_test.go b/internal/service/wafregional/size_constraint_set_test.go index 0a0d9519bf3..be089469ed2 100644 --- a/internal/service/wafregional/size_constraint_set_test.go +++ b/internal/service/wafregional/size_constraint_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -254,7 +254,7 @@ func testAccCheckSizeConstraintSetDestroy(ctx context.Context) resource.TestChec _, err := tfwafregional.FindSizeConstraintSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/sql_injection_match_set.go b/internal/service/wafregional/sql_injection_match_set.go index 7dc73cbfd96..b5127334367 100644 --- a/internal/service/wafregional/sql_injection_match_set.go +++ b/internal/service/wafregional/sql_injection_match_set.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -111,7 +112,7 @@ func resourceSQLInjectionMatchSetRead(ctx context.Context, d *schema.ResourceDat sqlInjectionMatchSet, err := findSQLInjectionMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional SQL Injection Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/sql_injection_match_set_test.go b/internal/service/wafregional/sql_injection_match_set_test.go index 1f93943a7d8..769ccb5511d 100644 --- a/internal/service/wafregional/sql_injection_match_set_test.go +++ b/internal/service/wafregional/sql_injection_match_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -236,7 +236,7 @@ func testAccCheckSQLInjectionMatchSetDestroy(ctx context.Context) resource.TestC _, err := tfwafregional.FindSQLInjectionMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/web_acl.go b/internal/service/wafregional/web_acl.go index ffcf5f349a1..ab2edaf9643 100644 --- a/internal/service/wafregional/web_acl.go +++ b/internal/service/wafregional/web_acl.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -233,7 +234,7 @@ func resourceWebACLRead(ctx context.Context, d *schema.ResourceData, meta any) d webACL, err := findWebACLByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional Web ACL (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/web_acl_association.go b/internal/service/wafregional/web_acl_association.go index b8279bfd907..a2ca3c99e51 100644 --- a/internal/service/wafregional/web_acl_association.go +++ b/internal/service/wafregional/web_acl_association.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -91,7 +92,7 @@ func resourceWebACLAssociationRead(ctx context.Context, d *schema.ResourceData, webACL, err := findWebACLByResourceARN(ctx, conn, resourceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional WebACL Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/web_acl_association_test.go b/internal/service/wafregional/web_acl_association_test.go index a2519901e11..40a4c855e2b 100644 --- a/internal/service/wafregional/web_acl_association_test.go +++ b/internal/service/wafregional/web_acl_association_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -132,7 +132,7 @@ func testAccCheckWebACLAssociationDestroy(ctx context.Context) resource.TestChec _, err := tfwafregional.FindWebACLByResourceARN(ctx, conn, rs.Primary.Attributes[names.AttrResourceARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/web_acl_test.go b/internal/service/wafregional/web_acl_test.go index 3a92d4b682e..a761fa19175 100644 --- a/internal/service/wafregional/web_acl_test.go +++ b/internal/service/wafregional/web_acl_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -436,7 +436,7 @@ func testAccCheckWebACLDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafregional.FindWebACLByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafregional/xss_match_set.go b/internal/service/wafregional/xss_match_set.go index daf3d469393..7c02618e3bb 100644 --- a/internal/service/wafregional/xss_match_set.go +++ b/internal/service/wafregional/xss_match_set.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -112,7 +113,7 @@ func resourceXSSMatchSetRead(ctx context.Context, d *schema.ResourceData, meta a xssMatchSet, err := findXSSMatchSetByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAF Regional XSS Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafregional/xss_match_set_test.go b/internal/service/wafregional/xss_match_set_test.go index 2424d76bcf9..bf5c4f8053d 100644 --- a/internal/service/wafregional/xss_match_set_test.go +++ b/internal/service/wafregional/xss_match_set_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -248,7 +248,7 @@ func testAccCheckXSSMatchSetDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfwafregional.FindXSSMatchSetByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From b1750b8d63d1d89069af0c067ff369e285b869e0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:22 -0800 Subject: [PATCH 213/227] `wafv2` --- internal/service/wafv2/api_key.go | 3 ++- internal/service/wafv2/api_key_test.go | 4 ++-- internal/service/wafv2/ip_set.go | 3 ++- internal/service/wafv2/ip_set_test.go | 4 ++-- internal/service/wafv2/regex_pattern_set.go | 3 ++- internal/service/wafv2/regex_pattern_set_test.go | 4 ++-- internal/service/wafv2/rule_group.go | 3 ++- internal/service/wafv2/rule_group_test.go | 4 ++-- internal/service/wafv2/web_acl.go | 3 ++- internal/service/wafv2/web_acl_association.go | 3 ++- internal/service/wafv2/web_acl_association_test.go | 4 ++-- internal/service/wafv2/web_acl_logging_configuration.go | 3 ++- internal/service/wafv2/web_acl_logging_configuration_test.go | 4 ++-- internal/service/wafv2/web_acl_rule_group_association_test.go | 4 ++-- internal/service/wafv2/web_acl_test.go | 4 ++-- 15 files changed, 30 insertions(+), 23 deletions(-) diff --git a/internal/service/wafv2/api_key.go b/internal/service/wafv2/api_key.go index e9643a859da..6e1faa5a8c0 100644 --- a/internal/service/wafv2/api_key.go +++ b/internal/service/wafv2/api_key.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -126,7 +127,7 @@ func (r *apiKeyResource) Read(ctx context.Context, request resource.ReadRequest, output, err := findAPIKeyByTwoPartKey(ctx, conn, data.APIKey.ValueString(), data.Scope.ValueEnum()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/wafv2/api_key_test.go b/internal/service/wafv2/api_key_test.go index 7508b268c1e..46dae269eaa 100644 --- a/internal/service/wafv2/api_key_test.go +++ b/internal/service/wafv2/api_key_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -162,7 +162,7 @@ func testAccCheckAPIKeyDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafv2.FindAPIKeyByTwoPartKey(ctx, conn, rs.Primary.Attributes["api_key"], awstypes.Scope(rs.Primary.Attributes[names.AttrScope])) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafv2/ip_set.go b/internal/service/wafv2/ip_set.go index 8dfd0e8d2df..b4790c8786b 100644 --- a/internal/service/wafv2/ip_set.go +++ b/internal/service/wafv2/ip_set.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -180,7 +181,7 @@ func resourceIPSetRead(ctx context.Context, d *schema.ResourceData, meta any) di output, err := findIPSetByThreePartKey(ctx, conn, d.Id(), d.Get(names.AttrName).(string), d.Get(names.AttrScope).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAFv2 IPSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafv2/ip_set_test.go b/internal/service/wafv2/ip_set_test.go index 00832487dbd..5484d6d4e7f 100644 --- a/internal/service/wafv2/ip_set_test.go +++ b/internal/service/wafv2/ip_set_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -383,7 +383,7 @@ func testAccCheckIPSetDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafv2.FindIPSetByThreePartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes[names.AttrScope]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafv2/regex_pattern_set.go b/internal/service/wafv2/regex_pattern_set.go index 215c8027e4c..24f73ba14e9 100644 --- a/internal/service/wafv2/regex_pattern_set.go +++ b/internal/service/wafv2/regex_pattern_set.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -158,7 +159,7 @@ func resourceRegexPatternSetRead(ctx context.Context, d *schema.ResourceData, me output, err := findRegexPatternSetByThreePartKey(ctx, conn, d.Id(), d.Get(names.AttrName).(string), d.Get(names.AttrScope).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAFv2 RegexPatternSet (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafv2/regex_pattern_set_test.go b/internal/service/wafv2/regex_pattern_set_test.go index 3504c2f90ba..0aa23b835f9 100644 --- a/internal/service/wafv2/regex_pattern_set_test.go +++ b/internal/service/wafv2/regex_pattern_set_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -292,7 +292,7 @@ func testAccCheckRegexPatternSetDestroy(ctx context.Context) resource.TestCheckF _, err := tfwafv2.FindRegexPatternSetByThreePartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes[names.AttrScope]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafv2/rule_group.go b/internal/service/wafv2/rule_group.go index a8a4e169a54..165a05a47d6 100644 --- a/internal/service/wafv2/rule_group.go +++ b/internal/service/wafv2/rule_group.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -217,7 +218,7 @@ func resourceRuleGroupRead(ctx context.Context, d *schema.ResourceData, meta any output, err := findRuleGroupByThreePartKey(ctx, conn, d.Id(), d.Get(names.AttrName).(string), d.Get(names.AttrScope).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAFv2 RuleGroup (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafv2/rule_group_test.go b/internal/service/wafv2/rule_group_test.go index eefb718991d..fff503105f0 100644 --- a/internal/service/wafv2/rule_group_test.go +++ b/internal/service/wafv2/rule_group_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -2644,7 +2644,7 @@ func testAccCheckRuleGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafv2.FindRuleGroupByThreePartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes[names.AttrScope]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafv2/web_acl.go b/internal/service/wafv2/web_acl.go index 34ab2a9595d..77d7104f0d0 100644 --- a/internal/service/wafv2/web_acl.go +++ b/internal/service/wafv2/web_acl.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -327,7 +328,7 @@ func resourceWebACLRead(ctx context.Context, d *schema.ResourceData, meta any) d output, err := findWebACLByThreePartKey(ctx, conn, d.Id(), d.Get(names.AttrName).(string), d.Get(names.AttrScope).(string)) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAFv2 WebACL (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafv2/web_acl_association.go b/internal/service/wafv2/web_acl_association.go index 9ac2aefac07..655214618c1 100644 --- a/internal/service/wafv2/web_acl_association.go +++ b/internal/service/wafv2/web_acl_association.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -101,7 +102,7 @@ func resourceWebACLAssociationRead(ctx context.Context, d *schema.ResourceData, resourceARN := parts[1] webACL, err := findWebACLByResourceARN(ctx, conn, resourceARN) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAFv2 WebACL Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafv2/web_acl_association_test.go b/internal/service/wafv2/web_acl_association_test.go index 30e9f95c7df..14289fe05bf 100644 --- a/internal/service/wafv2/web_acl_association_test.go +++ b/internal/service/wafv2/web_acl_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -89,7 +89,7 @@ func testAccCheckWebACLAssociationDestroy(ctx context.Context) resource.TestChec _, err := tfwafv2.FindWebACLByResourceARN(ctx, conn, rs.Primary.Attributes[names.AttrResourceARN]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafv2/web_acl_logging_configuration.go b/internal/service/wafv2/web_acl_logging_configuration.go index e684ebe6907..423546a899a 100644 --- a/internal/service/wafv2/web_acl_logging_configuration.go +++ b/internal/service/wafv2/web_acl_logging_configuration.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -218,7 +219,7 @@ func resourceWebACLLoggingConfigurationRead(ctx context.Context, d *schema.Resou loggingConfig, err := findLoggingConfigurationByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WAFv2 WebACL Logging Configuration (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/wafv2/web_acl_logging_configuration_test.go b/internal/service/wafv2/web_acl_logging_configuration_test.go index e104bce2f7d..e0f4e0b7212 100644 --- a/internal/service/wafv2/web_acl_logging_configuration_test.go +++ b/internal/service/wafv2/web_acl_logging_configuration_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -630,7 +630,7 @@ func testAccCheckWebACLLoggingConfigurationDestroy(ctx context.Context) resource _, err := tfwafv2.FindLoggingConfigurationByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/wafv2/web_acl_rule_group_association_test.go b/internal/service/wafv2/web_acl_rule_group_association_test.go index b87471a9da8..ff28c402396 100644 --- a/internal/service/wafv2/web_acl_rule_group_association_test.go +++ b/internal/service/wafv2/web_acl_rule_group_association_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -601,7 +601,7 @@ func testAccCheckWebACLRuleGroupAssociationDestroy(ctx context.Context) resource // Get the Web ACL webACL, err := tfwafv2.FindWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) - if tfresource.NotFound(err) { + if retry.NotFound(err) { // Web ACL is gone, so the association is definitely destroyed continue } diff --git a/internal/service/wafv2/web_acl_test.go b/internal/service/wafv2/web_acl_test.go index ca5d3d0dbeb..02462f9a30a 100644 --- a/internal/service/wafv2/web_acl_test.go +++ b/internal/service/wafv2/web_acl_test.go @@ -20,8 +20,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -3890,7 +3890,7 @@ func testAccCheckWebACLDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfwafv2.FindWebACLByThreePartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes[names.AttrName], rs.Primary.Attributes[names.AttrScope]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 9d2aee1bd468e947c8b331f7f356aeeac185d7cb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:23 -0800 Subject: [PATCH 214/227] `workspaces` --- internal/service/workspaces/connection_alias.go | 5 +++-- internal/service/workspaces/connection_alias_test.go | 4 ++-- internal/service/workspaces/directory.go | 5 +++-- internal/service/workspaces/directory_test.go | 4 ++-- internal/service/workspaces/ip_group.go | 3 ++- internal/service/workspaces/ip_group_test.go | 4 ++-- internal/service/workspaces/workspace.go | 5 +++-- internal/service/workspaces/workspace_test.go | 4 ++-- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/internal/service/workspaces/connection_alias.go b/internal/service/workspaces/connection_alias.go index 9f50e1f31a4..cd2fd0c59ee 100644 --- a/internal/service/workspaces/connection_alias.go +++ b/internal/service/workspaces/connection_alias.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -132,7 +133,7 @@ func (r *connectionAliasResource) Read(ctx context.Context, request resource.Rea alias, err := findConnectionAliasByID(ctx, conn, data.ID.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return @@ -225,7 +226,7 @@ func statusConnectionAlias(ctx context.Context, conn *workspaces.Client, id stri return func() (any, string, error) { output, err := findConnectionAliasByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/workspaces/connection_alias_test.go b/internal/service/workspaces/connection_alias_test.go index 38a53076928..4ed1f121b55 100644 --- a/internal/service/workspaces/connection_alias_test.go +++ b/internal/service/workspaces/connection_alias_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -146,7 +146,7 @@ func testAccCheckConnectionAliasDestroy(ctx context.Context) resource.TestCheckF _, err := tfworkspaces.FindConnectionAliasByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil } diff --git a/internal/service/workspaces/directory.go b/internal/service/workspaces/directory.go index b16a5425cdd..3c92022bae4 100644 --- a/internal/service/workspaces/directory.go +++ b/internal/service/workspaces/directory.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" inttypes "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -492,7 +493,7 @@ func resourceDirectoryRead(ctx context.Context, d *schema.ResourceData, meta any directory, err := findDirectoryByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WorkSpaces Directory (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -751,7 +752,7 @@ func statusDirectory(ctx context.Context, conn *workspaces.Client, id string) sd return func() (any, string, error) { output, err := findDirectoryByID(ctx, conn, id) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/workspaces/directory_test.go b/internal/service/workspaces/directory_test.go index f87cedf7a28..66d82b86426 100644 --- a/internal/service/workspaces/directory_test.go +++ b/internal/service/workspaces/directory_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -580,7 +580,7 @@ func testAccCheckDirectoryDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfworkspaces.FindDirectoryByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspaces/ip_group.go b/internal/service/workspaces/ip_group.go index 6776df43fe0..51b2f640c28 100644 --- a/internal/service/workspaces/ip_group.go +++ b/internal/service/workspaces/ip_group.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -97,7 +98,7 @@ func resourceIPGroupRead(ctx context.Context, d *schema.ResourceData, meta any) ipGroup, err := findIPGroupByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WorkSpaces IP Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/workspaces/ip_group_test.go b/internal/service/workspaces/ip_group_test.go index 9737603d92a..65360c08fbd 100644 --- a/internal/service/workspaces/ip_group_test.go +++ b/internal/service/workspaces/ip_group_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -185,7 +185,7 @@ func testAccCheckIPGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfworkspaces.FindIPGroupByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspaces/workspace.go b/internal/service/workspaces/workspace.go index a34f6d7c4e6..8ab3cb0c231 100644 --- a/internal/service/workspaces/workspace.go +++ b/internal/service/workspaces/workspace.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -199,7 +200,7 @@ func resourceWorkspaceRead(ctx context.Context, d *schema.ResourceData, meta any workspace, err := findWorkspaceByID(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] WorkSpaces Workspace (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -389,7 +390,7 @@ func statusWorkspace(ctx context.Context, conn *workspaces.Client, workspaceID s return func() (any, string, error) { output, err := findWorkspaceByID(ctx, conn, workspaceID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/workspaces/workspace_test.go b/internal/service/workspaces/workspace_test.go index efd7a0f6ea4..8d1751825ce 100644 --- a/internal/service/workspaces/workspace_test.go +++ b/internal/service/workspaces/workspace_test.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -399,7 +399,7 @@ func testAccCheckWorkspaceDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfworkspaces.FindWorkspaceByID(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 6155255ebff1c57adad4a9caaa94cd29898b1127 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:25 -0800 Subject: [PATCH 215/227] `workspacesweb` --- internal/service/workspacesweb/browser_settings.go | 3 ++- .../workspacesweb/browser_settings_association_test.go | 4 ++-- internal/service/workspacesweb/browser_settings_test.go | 4 ++-- internal/service/workspacesweb/data_protection_settings.go | 3 ++- .../data_protection_settings_association_test.go | 4 ++-- .../service/workspacesweb/data_protection_settings_test.go | 4 ++-- internal/service/workspacesweb/ip_access_settings.go | 3 ++- .../workspacesweb/ip_access_settings_association_test.go | 4 ++-- internal/service/workspacesweb/ip_access_settings_test.go | 4 ++-- internal/service/workspacesweb/network_settings.go | 3 ++- .../workspacesweb/network_settings_association_test.go | 4 ++-- internal/service/workspacesweb/network_settings_test.go | 4 ++-- internal/service/workspacesweb/portal_test.go | 4 ++-- internal/service/workspacesweb/session_logger.go | 3 ++- .../service/workspacesweb/session_logger_association_test.go | 4 ++-- internal/service/workspacesweb/session_logger_test.go | 4 ++-- internal/service/workspacesweb/trust_store.go | 3 ++- .../service/workspacesweb/trust_store_association_test.go | 4 ++-- internal/service/workspacesweb/trust_store_test.go | 4 ++-- .../service/workspacesweb/user_access_logging_settings.go | 3 ++- .../user_access_logging_settings_association_test.go | 4 ++-- .../workspacesweb/user_access_logging_settings_test.go | 4 ++-- internal/service/workspacesweb/user_settings.go | 3 ++- .../service/workspacesweb/user_settings_association_test.go | 4 ++-- internal/service/workspacesweb/user_settings_test.go | 4 ++-- 25 files changed, 50 insertions(+), 42 deletions(-) diff --git a/internal/service/workspacesweb/browser_settings.go b/internal/service/workspacesweb/browser_settings.go index 2832e68aa82..ec564d3bf5f 100644 --- a/internal/service/workspacesweb/browser_settings.go +++ b/internal/service/workspacesweb/browser_settings.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -139,7 +140,7 @@ func (r *browserSettingsResource) Read(ctx context.Context, request resource.Rea conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findBrowserSettingsByARN(ctx, conn, data.BrowserSettingsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/browser_settings_association_test.go b/internal/service/workspacesweb/browser_settings_association_test.go index e4850625d04..03aa61a48e8 100644 --- a/internal/service/workspacesweb/browser_settings_association_test.go +++ b/internal/service/workspacesweb/browser_settings_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -120,7 +120,7 @@ func testAccCheckBrowserSettingsAssociationDestroy(ctx context.Context) resource browserSettings, err := tfworkspacesweb.FindBrowserSettingsByARN(ctx, conn, rs.Primary.Attributes["browser_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/browser_settings_test.go b/internal/service/workspacesweb/browser_settings_test.go index c85175e14cf..c7c818d8447 100644 --- a/internal/service/workspacesweb/browser_settings_test.go +++ b/internal/service/workspacesweb/browser_settings_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -343,7 +343,7 @@ func testAccCheckBrowserSettingsDestroy(ctx context.Context) resource.TestCheckF _, err := tfworkspacesweb.FindBrowserSettingsByARN(ctx, conn, rs.Primary.Attributes["browser_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/data_protection_settings.go b/internal/service/workspacesweb/data_protection_settings.go index 6bf98569711..55aefa0d4be 100644 --- a/internal/service/workspacesweb/data_protection_settings.go +++ b/internal/service/workspacesweb/data_protection_settings.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -263,7 +264,7 @@ func (r *dataProtectionSettingsResource) Read(ctx context.Context, request resou conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findDataProtectionSettingsByARN(ctx, conn, data.DataProtectionSettingsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/data_protection_settings_association_test.go b/internal/service/workspacesweb/data_protection_settings_association_test.go index 951bf87fac4..5eaf368f9eb 100644 --- a/internal/service/workspacesweb/data_protection_settings_association_test.go +++ b/internal/service/workspacesweb/data_protection_settings_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckDataProtectionSettingsAssociationDestroy(ctx context.Context) r dataProtectionSettings, err := tfworkspacesweb.FindDataProtectionSettingsByARN(ctx, conn, rs.Primary.Attributes["data_protection_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/data_protection_settings_test.go b/internal/service/workspacesweb/data_protection_settings_test.go index 95fc199b322..4a1701d7229 100644 --- a/internal/service/workspacesweb/data_protection_settings_test.go +++ b/internal/service/workspacesweb/data_protection_settings_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -327,7 +327,7 @@ func testAccCheckDataProtectionSettingsDestroy(ctx context.Context) resource.Tes _, err := tfworkspacesweb.FindDataProtectionSettingsByARN(ctx, conn, rs.Primary.Attributes["data_protection_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/ip_access_settings.go b/internal/service/workspacesweb/ip_access_settings.go index 35c314be729..f89eb150a6d 100644 --- a/internal/service/workspacesweb/ip_access_settings.go +++ b/internal/service/workspacesweb/ip_access_settings.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -174,7 +175,7 @@ func (r *ipAccessSettingsResource) Read(ctx context.Context, request resource.Re conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findIPAccessSettingsByARN(ctx, conn, data.IPAccessSettingsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/ip_access_settings_association_test.go b/internal/service/workspacesweb/ip_access_settings_association_test.go index a83269cbdc2..19ce06440f4 100644 --- a/internal/service/workspacesweb/ip_access_settings_association_test.go +++ b/internal/service/workspacesweb/ip_access_settings_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckIPAccessSettingsAssociationDestroy(ctx context.Context) resourc ipAccessSettings, err := tfworkspacesweb.FindIPAccessSettingsByARN(ctx, conn, rs.Primary.Attributes["ip_access_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/ip_access_settings_test.go b/internal/service/workspacesweb/ip_access_settings_test.go index c10ef4d3487..61c524b194a 100644 --- a/internal/service/workspacesweb/ip_access_settings_test.go +++ b/internal/service/workspacesweb/ip_access_settings_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -268,7 +268,7 @@ func testAccCheckIPAccessSettingsDestroy(ctx context.Context) resource.TestCheck _, err := tfworkspacesweb.FindIPAccessSettingsByARN(ctx, conn, rs.Primary.Attributes["ip_access_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/network_settings.go b/internal/service/workspacesweb/network_settings.go index 9cddc9a5f26..3652f7e84e3 100644 --- a/internal/service/workspacesweb/network_settings.go +++ b/internal/service/workspacesweb/network_settings.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -140,7 +141,7 @@ func (r *networkSettingsResource) Read(ctx context.Context, request resource.Rea conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findNetworkSettingsByARN(ctx, conn, data.NetworkSettingsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/network_settings_association_test.go b/internal/service/workspacesweb/network_settings_association_test.go index ac780eba9f8..1f72e75265e 100644 --- a/internal/service/workspacesweb/network_settings_association_test.go +++ b/internal/service/workspacesweb/network_settings_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckNetworkSettingsAssociationDestroy(ctx context.Context) resource networkSettings, err := tfworkspacesweb.FindNetworkSettingsByARN(ctx, conn, rs.Primary.Attributes["network_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/network_settings_test.go b/internal/service/workspacesweb/network_settings_test.go index 575e753a0b2..b309dceab21 100644 --- a/internal/service/workspacesweb/network_settings_test.go +++ b/internal/service/workspacesweb/network_settings_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -175,7 +175,7 @@ func testAccCheckNetworkSettingsDestroy(ctx context.Context) resource.TestCheckF _, err := tfworkspacesweb.FindNetworkSettingsByARN(ctx, conn, rs.Primary.Attributes["network_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/portal_test.go b/internal/service/workspacesweb/portal_test.go index 68986eb12d3..853ba961927 100644 --- a/internal/service/workspacesweb/portal_test.go +++ b/internal/service/workspacesweb/portal_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -183,7 +183,7 @@ func testAccCheckPortalDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfworkspacesweb.FindPortalByARN(ctx, conn, rs.Primary.Attributes["portal_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/session_logger.go b/internal/service/workspacesweb/session_logger.go index d3abf07a4ed..450d23f8142 100644 --- a/internal/service/workspacesweb/session_logger.go +++ b/internal/service/workspacesweb/session_logger.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -216,7 +217,7 @@ func (r *sessionLoggerResource) Read(ctx context.Context, request resource.ReadR output, err := findSessionLoggerByARN(ctx, conn, data.SessionLoggerARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/session_logger_association_test.go b/internal/service/workspacesweb/session_logger_association_test.go index f34474e7a16..57742fd491a 100644 --- a/internal/service/workspacesweb/session_logger_association_test.go +++ b/internal/service/workspacesweb/session_logger_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckSessionLoggerAssociationDestroy(ctx context.Context) resource.T sessionLogger, err := tfworkspacesweb.FindSessionLoggerByARN(ctx, conn, rs.Primary.Attributes["session_logger_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/session_logger_test.go b/internal/service/workspacesweb/session_logger_test.go index 024aca7bfeb..75a02315ea9 100644 --- a/internal/service/workspacesweb/session_logger_test.go +++ b/internal/service/workspacesweb/session_logger_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -237,7 +237,7 @@ func testAccCheckSessionLoggerDestroy(ctx context.Context) resource.TestCheckFun _, err := tfworkspacesweb.FindSessionLoggerByARN(ctx, conn, rs.Primary.Attributes["session_logger_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/trust_store.go b/internal/service/workspacesweb/trust_store.go index ab9a1d859e9..9b83a7fd46b 100644 --- a/internal/service/workspacesweb/trust_store.go +++ b/internal/service/workspacesweb/trust_store.go @@ -32,6 +32,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -182,7 +183,7 @@ func (r *trustStoreResource) Read(ctx context.Context, request resource.ReadRequ conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findTrustStoreByARN(ctx, conn, data.TrustStoreARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/trust_store_association_test.go b/internal/service/workspacesweb/trust_store_association_test.go index 3e7d6330986..0ab66e14e6c 100644 --- a/internal/service/workspacesweb/trust_store_association_test.go +++ b/internal/service/workspacesweb/trust_store_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckTrustStoreAssociationDestroy(ctx context.Context) resource.Test trustStore, err := tfworkspacesweb.FindTrustStoreByARN(ctx, conn, rs.Primary.Attributes["trust_store_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/trust_store_test.go b/internal/service/workspacesweb/trust_store_test.go index 4b4bae7e743..9f660e349a5 100644 --- a/internal/service/workspacesweb/trust_store_test.go +++ b/internal/service/workspacesweb/trust_store_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -224,7 +224,7 @@ func testAccCheckTrustStoreDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfworkspacesweb.FindTrustStoreByARN(ctx, conn, rs.Primary.Attributes["trust_store_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/user_access_logging_settings.go b/internal/service/workspacesweb/user_access_logging_settings.go index a8c1b6cb8eb..09f3aabcf49 100644 --- a/internal/service/workspacesweb/user_access_logging_settings.go +++ b/internal/service/workspacesweb/user_access_logging_settings.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -122,7 +123,7 @@ func (r *userAccessLoggingSettingsResource) Read(ctx context.Context, request re conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findUserAccessLoggingSettingsByARN(ctx, conn, data.UserAccessLoggingSettingsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/user_access_logging_settings_association_test.go b/internal/service/workspacesweb/user_access_logging_settings_association_test.go index 8fd7d7ad9c3..fcdfb139ca4 100644 --- a/internal/service/workspacesweb/user_access_logging_settings_association_test.go +++ b/internal/service/workspacesweb/user_access_logging_settings_association_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -109,7 +109,7 @@ func testAccCheckUserAccessLoggingSettingsAssociationDestroy(ctx context.Context userAccessLoggingSettings, err := tfworkspacesweb.FindUserAccessLoggingSettingsByARN(ctx, conn, rs.Primary.Attributes["user_access_logging_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/user_access_logging_settings_test.go b/internal/service/workspacesweb/user_access_logging_settings_test.go index 2dd786b534f..9f315bc625b 100644 --- a/internal/service/workspacesweb/user_access_logging_settings_test.go +++ b/internal/service/workspacesweb/user_access_logging_settings_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -138,7 +138,7 @@ func testAccCheckUserAccessLoggingSettingsDestroy(ctx context.Context) resource. _, err := tfworkspacesweb.FindUserAccessLoggingSettingsByARN(ctx, conn, rs.Primary.Attributes["user_access_logging_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/user_settings.go b/internal/service/workspacesweb/user_settings.go index 061e4f18029..2df6d4a1298 100644 --- a/internal/service/workspacesweb/user_settings.go +++ b/internal/service/workspacesweb/user_settings.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -248,7 +249,7 @@ func (r *userSettingsResource) Read(ctx context.Context, request resource.ReadRe conn := r.Meta().WorkSpacesWebClient(ctx) output, err := findUserSettingsByARN(ctx, conn, data.UserSettingsARN.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) return diff --git a/internal/service/workspacesweb/user_settings_association_test.go b/internal/service/workspacesweb/user_settings_association_test.go index 075e0a8de31..7b94b7f3fa8 100644 --- a/internal/service/workspacesweb/user_settings_association_test.go +++ b/internal/service/workspacesweb/user_settings_association_test.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -106,7 +106,7 @@ func testAccCheckUserSettingsAssociationDestroy(ctx context.Context) resource.Te userSettings, err := tfworkspacesweb.FindUserSettingsByARN(ctx, conn, rs.Primary.Attributes["user_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/workspacesweb/user_settings_test.go b/internal/service/workspacesweb/user_settings_test.go index cdfe00d65ed..55e23123fd7 100644 --- a/internal/service/workspacesweb/user_settings_test.go +++ b/internal/service/workspacesweb/user_settings_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfstatecheck "github.com/hashicorp/terraform-provider-aws/internal/acctest/statecheck" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfworkspacesweb "github.com/hashicorp/terraform-provider-aws/internal/service/workspacesweb" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -621,7 +621,7 @@ func testAccCheckUserSettingsDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfworkspacesweb.FindUserSettingsByARN(ctx, conn, rs.Primary.Attributes["user_settings_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 968835b7687a8b32c4f6689b8c5154d9a84e5522 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 16:34:28 -0800 Subject: [PATCH 216/227] `xray` --- internal/service/xray/encryption_config.go | 5 +++-- internal/service/xray/group.go | 3 ++- internal/service/xray/group_test.go | 4 ++-- internal/service/xray/resource_policy.go | 5 +++-- internal/service/xray/resource_policy_test.go | 4 ++-- internal/service/xray/sampling_rule.go | 4 ++-- internal/service/xray/sampling_rule_test.go | 4 ++-- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/internal/service/xray/encryption_config.go b/internal/service/xray/encryption_config.go index e441397062c..7db3acf23e0 100644 --- a/internal/service/xray/encryption_config.go +++ b/internal/service/xray/encryption_config.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/enum" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" @@ -83,7 +84,7 @@ func resourceEncryptionConfigRead(ctx context.Context, d *schema.ResourceData, m config, err := findEncryptionConfig(ctx, conn) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] XRay Encryption Config (%s) not found, removing from state", d.Id()) d.SetId("") return diags @@ -119,7 +120,7 @@ func statusEncryptionConfig(ctx context.Context, conn *xray.Client) sdkretry.Sta return func() (any, string, error) { output, err := findEncryptionConfig(ctx, conn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return nil, "", nil } diff --git a/internal/service/xray/group.go b/internal/service/xray/group.go index a36e467cbca..d7cc0959b92 100644 --- a/internal/service/xray/group.go +++ b/internal/service/xray/group.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -104,7 +105,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta any) di group, err := findGroupByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] XRay Group (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/xray/group_test.go b/internal/service/xray/group_test.go index ef72943c929..97a60386157 100644 --- a/internal/service/xray/group_test.go +++ b/internal/service/xray/group_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfxray "github.com/hashicorp/terraform-provider-aws/internal/service/xray" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -160,7 +160,7 @@ func testAccCheckGroupDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfxray.FindGroupByARN(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/xray/resource_policy.go b/internal/service/xray/resource_policy.go index 47555534778..51f7360e1c6 100644 --- a/internal/service/xray/resource_policy.go +++ b/internal/service/xray/resource_policy.go @@ -21,6 +21,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/framework" fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -121,7 +122,7 @@ func (r *resourcePolicyResource) Read(ctx context.Context, req resource.ReadRequ } out, err := findResourcePolicyByName(ctx, conn, state.PolicyName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { resp.State.RemoveResource(ctx) return } @@ -147,7 +148,7 @@ func (r *resourcePolicyResource) Delete(ctx context.Context, req resource.Delete } policy, err := findResourcePolicyByName(ctx, conn, state.PolicyName.ValueString()) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } if err != nil { diff --git a/internal/service/xray/resource_policy_test.go b/internal/service/xray/resource_policy_test.go index f82db588d8e..05ad5b96092 100644 --- a/internal/service/xray/resource_policy_test.go +++ b/internal/service/xray/resource_policy_test.go @@ -16,8 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfxray "github.com/hashicorp/terraform-provider-aws/internal/service/xray" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -96,7 +96,7 @@ func testAccCheckResourcePolicyDestroy(ctx context.Context) resource.TestCheckFu _, err := tfxray.FindResourcePolicyByName(ctx, conn, rs.Primary.Attributes["policy_name"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/xray/sampling_rule.go b/internal/service/xray/sampling_rule.go index 5e3d832e8e2..59d5f68ce31 100644 --- a/internal/service/xray/sampling_rule.go +++ b/internal/service/xray/sampling_rule.go @@ -18,8 +18,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -156,7 +156,7 @@ func resourceSamplingRuleRead(ctx context.Context, d *schema.ResourceData, meta samplingRule, err := findSamplingRuleByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] XRay Sampling Rule (%s) not found, removing from state", d.Id()) d.SetId("") return diags diff --git a/internal/service/xray/sampling_rule_test.go b/internal/service/xray/sampling_rule_test.go index f096064a9f6..58a24cb3855 100644 --- a/internal/service/xray/sampling_rule_test.go +++ b/internal/service/xray/sampling_rule_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfxray "github.com/hashicorp/terraform-provider-aws/internal/service/xray" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -179,7 +179,7 @@ func testAccCheckSamplingRuleDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfxray.FindSamplingRuleByName(ctx, conn, rs.Primary.ID) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a1d25553b28f7e0d88d546db5d9926b45f59ba43 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 17:00:51 -0800 Subject: [PATCH 217/227] Updates tag resource generation --- internal/generate/tagresource/resource.tmpl | 4 ++-- internal/generate/tagresource/tests.tmpl | 4 ++-- .../generate/tags/templates/wait_tags_propagated_body.gtpl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/generate/tagresource/resource.tmpl b/internal/generate/tagresource/resource.tmpl index 20150c55c10..5e5289986bc 100644 --- a/internal/generate/tagresource/resource.tmpl +++ b/internal/generate/tagresource/resource.tmpl @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -78,7 +78,7 @@ func resourceTagRead(ctx context.Context, d *schema.ResourceData, meta any) diag value, err := {{ .GetTagFunc }}(ctx, conn, identifier, key) - if !d.IsNewResource() && tfresource.NotFound(err) { + if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] %s resource (%s) tag (%s) not found, removing from state", names.{{ .AWSServiceUpper }}, identifier, key) d.SetId("") return diags diff --git a/internal/generate/tagresource/tests.tmpl b/internal/generate/tagresource/tests.tmpl index 6e20e99089d..69ff56b9aba 100644 --- a/internal/generate/tagresource/tests.tmpl +++ b/internal/generate/tagresource/tests.tmpl @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" tf{{ .ServicePackage }} "github.com/hashicorp/terraform-provider-aws/internal/service/{{ .ServicePackage }}" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -32,7 +32,7 @@ func testAccCheckTagDestroy(ctx context.Context) resource.TestCheckFunc { _, err = tf{{ .ServicePackage }}.{{ .GetTagFunc | FirstUpper }}(ctx, conn, identifier, key) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/generate/tags/templates/wait_tags_propagated_body.gtpl b/internal/generate/tags/templates/wait_tags_propagated_body.gtpl index 82c8a68b534..dc4ed17843c 100644 --- a/internal/generate/tags/templates/wait_tags_propagated_body.gtpl +++ b/internal/generate/tags/templates/wait_tags_propagated_body.gtpl @@ -9,7 +9,7 @@ func {{ .WaitTagsPropagatedFunc }}(ctx context.Context, conn {{ .ClientType }}, checkFunc := func(ctx context.Context) (bool, error) { output, err := {{ .ListTagsFunc }}(ctx, conn, id, optFns...) - if tfresource.NotFound(err) { + if retry.NotFound(err) { return false, nil } From 888f989d4609b9486d57d0a5125a81578c70ea9d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 17:08:52 -0800 Subject: [PATCH 218/227] Updates Semgrep checks for error checking patterns --- .ci/.semgrep.yml | 2 +- .ci/semgrep/errors/error-checks.go | 25 ++++++++++--------- .ci/semgrep/errors/error-checks.yml | 38 ++++++++++++++--------------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.ci/.semgrep.yml b/.ci/.semgrep.yml index 818b0792bed..c116e4a3eca 100644 --- a/.ci/.semgrep.yml +++ b/.ci/.semgrep.yml @@ -207,7 +207,7 @@ rules: - id: is-not-found-error languages: [go] - message: Check for retry.NotFoundError errors with tfresource.NotFound() + message: Check for retry.NotFoundError errors with retry.NotFound() paths: include: - "/internal" diff --git a/.ci/semgrep/errors/error-checks.go b/.ci/semgrep/errors/error-checks.go index d2a615b2a43..87b2f3077b0 100644 --- a/.ci/semgrep/errors/error-checks.go +++ b/.ci/semgrep/errors/error-checks.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" + "github.com/hashicorp/terraform-provider-aws/internal/retry" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -13,7 +14,7 @@ func test1() { _, err := call() // ruleid: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -24,7 +25,7 @@ func test2() { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -40,7 +41,7 @@ func test3() { if err != nil { // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } return @@ -55,7 +56,7 @@ func test4() { if err == nil { return // ok: notfound-without-err-checks - } else if tfresource.NotFound(err) { + } else if retry.NotFound(err) { return } else { return @@ -66,7 +67,7 @@ func test5() { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } else if err != nil { return @@ -79,7 +80,7 @@ func test6() error { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -91,7 +92,7 @@ func test7() { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } } @@ -103,7 +104,7 @@ func test8() { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } @@ -123,7 +124,7 @@ func test9() { if err != nil { // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } else { return @@ -137,7 +138,7 @@ func test10() { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } else if err != nil { return @@ -151,7 +152,7 @@ func test11() { tfresource.RetryWhen(ctx, 1*time.Second, nil, func(err error) (bool error) { // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return true, err } @@ -163,7 +164,7 @@ func test12() { _, err := call() // ok: notfound-without-err-checks - if tfresource.NotFound(err) { + if retry.NotFound(err) { return } diff --git a/.ci/semgrep/errors/error-checks.yml b/.ci/semgrep/errors/error-checks.yml index 7ac00c74159..f778beda473 100644 --- a/.ci/semgrep/errors/error-checks.yml +++ b/.ci/semgrep/errors/error-checks.yml @@ -1,25 +1,25 @@ rules: - id: notfound-without-err-checks languages: [go] - message: When checking for tfresource.NotFound() errors, typically other error conditions should be checked. + message: When checking for retry.NotFound() errors, typically other error conditions should be checked. patterns: - pattern: | - if tfresource.NotFound($ERR) { ... } + if retry.NotFound($ERR) { ... } - pattern-not-inside: | - if tfresource.NotFound($ERR) { ... } + if retry.NotFound($ERR) { ... } if $ERR != nil { ... } - pattern-not-inside: | - if tfresource.NotFound($ERR) { ... } + if retry.NotFound($ERR) { ... } if $FUNC($ERR, ...) { ... } if $ERR != nil { ... } - pattern-not-inside: | if err != nil { - if tfresource.NotFound($ERR) { ... } + if retry.NotFound($ERR) { ... } return ... } - pattern-not-inside: | if err != nil { - if tfresource.NotFound($ERR) { + if retry.NotFound($ERR) { ... } else { ... @@ -28,11 +28,11 @@ rules: - pattern-not-inside: | if err == nil { ... - } else if tfresource.NotFound($ERR) { + } else if retry.NotFound($ERR) { ... } else { ... } - pattern-not-inside: | - if tfresource.NotFound($ERR) { + if retry.NotFound($ERR) { ... } else if err != nil { ... @@ -40,16 +40,16 @@ rules: ... } - pattern-not-inside: | - if tfresource.NotFound($ERR) { + if retry.NotFound($ERR) { ... } return $ERR - pattern-not-inside: | - if tfresource.NotFound($ERR) { + if retry.NotFound($ERR) { continue } - pattern-not-inside: | - if tfresource.NotFound($ERR) { + if retry.NotFound($ERR) { ... } else if err != nil { ... @@ -60,16 +60,16 @@ rules: - id: isnewresource-notfound-without-err-checks languages: [go] - message: When checking for !d.IsNewResource() && tfresource.NotFound() errors, typically other error conditions should be checked. + message: When checking for !d.IsNewResource() && retry.NotFound() errors, typically other error conditions should be checked. patterns: - pattern: | - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } - pattern-not-inside: | - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } if $ERR != nil { ... } # e.g. internal/service/dms/s3_endpoint.go - pattern-not-inside: | - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } if $ERR == nil && ... { ... err = ... @@ -78,7 +78,7 @@ rules: if $ERR != nil { ... } # e.g., internal/service/neptune/cluster.go - pattern-not-inside: | - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } if $ERR != nil && ... { ... } for ... = backoff.NewRetryLoop(...); ...; { ... @@ -86,18 +86,18 @@ rules: if $ERR != nil { ... } # e.g. internal/service/quicksight/analysis.go - pattern-not-inside: | - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } if !d.IsNewResource() && ... { ... } if $ERR != nil { ... } # e.g. internal/service/sagemaker/app.go - pattern-not-inside: | if err != nil { - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } return ... } # e.g. internal/service/storagegateway/gateway.go - pattern-not-inside: | - if !d.IsNewResource() && tfresource.NotFound($ERR) { ... } + if !d.IsNewResource() && retry.NotFound($ERR) { ... } if isGatewayNotConnectedErr(err) { ... } From dd32075c9d2fb38c20783ac5363bf32be7fc6f0d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 17:17:29 -0800 Subject: [PATCH 219/227] Removes `tfresource.NotFound` --- internal/tfresource/errors.go | 9 ------ internal/tfresource/errors_test.go | 45 ------------------------------ 2 files changed, 54 deletions(-) diff --git a/internal/tfresource/errors.go b/internal/tfresource/errors.go index bac461c584a..c288996612a 100644 --- a/internal/tfresource/errors.go +++ b/internal/tfresource/errors.go @@ -9,15 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/retry" ) -// NotFound returns true if the error represents a "resource not found" condition. -// Specifically, NotFound returns true if the error or a wrapped error is of type -// retry.NotFoundError. -// -// Deprecated: NotFound is an alias to a function of the same name in internal/retry -// which handles both Plugin SDK V2 and internal error types. For net-new usage, -// prefer calling retry.NotFound directly. -var NotFound = retry.NotFound - // TimedOut returns true if the error represents a "wait timed out" condition. // Specifically, TimedOut returns true if the error matches all these conditions: // - err is of type retry.TimeoutError diff --git a/internal/tfresource/errors_test.go b/internal/tfresource/errors_test.go index 70e4ecd45cf..3df83bfa77e 100644 --- a/internal/tfresource/errors_test.go +++ b/internal/tfresource/errors_test.go @@ -13,51 +13,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) -func TestNotFound(t *testing.T) { - t.Parallel() - - testCases := []struct { - Name string - Err error - Expected bool - }{ - { - Name: "nil error", - Err: nil, - }, - { - Name: "other error", - Err: errors.New("test"), - }, - { - Name: "not found error", - Err: &sdkretry.NotFoundError{LastError: errors.New("test")}, - Expected: true, - }, - { - Name: "wrapped other error", - Err: fmt.Errorf("test: %w", errors.New("test")), - }, - { - Name: "wrapped not found error", - Err: fmt.Errorf("test: %w", &sdkretry.NotFoundError{LastError: errors.New("test")}), - Expected: true, - }, - } - - for _, testCase := range testCases { - t.Run(testCase.Name, func(t *testing.T) { - t.Parallel() - - got := tfresource.NotFound(testCase.Err) - - if got != testCase.Expected { - t.Errorf("got %t, expected %t", got, testCase.Expected) - } - }) - } -} - func TestTimedOut(t *testing.T) { t.Parallel() From ea3b6721f4cb1ebf792bf54ed9c2096f7749f3eb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 17:23:14 -0800 Subject: [PATCH 220/227] Adds general Semgrep rule and removes task-specific rules --- .ci/semgrep/retry/retry.yml | 9 +++++++++ .ci/semgrep/smarterr/enforce.yml | 18 ------------------ internal/vcr/.semgrep-vcr.yml | 12 ------------ 3 files changed, 9 insertions(+), 30 deletions(-) create mode 100644 .ci/semgrep/retry/retry.yml diff --git a/.ci/semgrep/retry/retry.yml b/.ci/semgrep/retry/retry.yml new file mode 100644 index 00000000000..96d7e86d0d9 --- /dev/null +++ b/.ci/semgrep/retry/retry.yml @@ -0,0 +1,9 @@ +rules: + - id: internal-retry-notfound + languages: [go] + message: "Prefer retry.NotFound to tfresource.NotFound" + pattern: | + tfresource.NotFound($ERR) + fix: | + retry.NotFound($ERR) + severity: ERROR diff --git a/.ci/semgrep/smarterr/enforce.yml b/.ci/semgrep/smarterr/enforce.yml index 2c422200f45..a5e0b1813b0 100644 --- a/.ci/semgrep/smarterr/enforce.yml +++ b/.ci/semgrep/smarterr/enforce.yml @@ -188,24 +188,6 @@ rules: exclude: - "*_test.go" - - id: go-no-tfresource-notfound - languages: [go] - message: Use intretry.NotFound instead of tfresource.NotFound (migrate to smarterr). - severity: ERROR - patterns: - - pattern: | - tfresource.NotFound($ERR) - - pattern-not-inside: | - intretry.NotFound(...) - paths: - include: - - "/internal/service/appsync/" - - "/internal/service/bedrockagentcore/" - - "/internal/service/cloudwatch/" - - "/internal/service/invoicing/" - exclude: - - "*_test.go" - - id: go-no-bare-assertsinglevalueresult languages: [go] message: Wrap tfresource.AssertSingleValueResult with smarterr.Assert (migrate to smarterr). diff --git a/internal/vcr/.semgrep-vcr.yml b/internal/vcr/.semgrep-vcr.yml index fce1cb9c410..9926c1483f2 100644 --- a/internal/vcr/.semgrep-vcr.yml +++ b/internal/vcr/.semgrep-vcr.yml @@ -222,18 +222,6 @@ rules: include: - "**/*.go" - - id: internal-retry-notfound - languages: [go] - message: "Use retry.NotFound to replace the deprecated tfresource alias" - severity: WARNING - pattern: | - tfresource.NotFound($ERR) - fix: | - retry.NotFound($ERR) - paths: - include: - - "**/*.go" - - id: internal-retry-timedout languages: [go] message: "Use retry.TimedOut to replace the deprecated tfresource alias" From f7ddf532db889542748ce0d55c3a242e95cd03e3 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 17:23:34 -0800 Subject: [PATCH 221/227] Updates documentation --- docs/running-and-writing-acceptance-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/running-and-writing-acceptance-tests.md b/docs/running-and-writing-acceptance-tests.md index 989eea5b821..28b424e4ce0 100644 --- a/docs/running-and-writing-acceptance-tests.md +++ b/docs/running-and-writing-acceptance-tests.md @@ -777,7 +777,7 @@ If this test does fail, the fix for this is generally adding error handling imme ```go output, err := conn.GetThing(input) -if !d.IsNewResource() && tfresource.NotFound(err) { +if !d.IsNewResource() && retry.NotFound(err) { log.Printf("[WARN] Example Thing (%s) not found, removing from state", d.Id()) d.SetId("") return nil From d3c79e3c7e18c946f8a3b76a44a46e9363ead7bc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 28 Nov 2025 17:36:12 -0800 Subject: [PATCH 222/227] Missed change --- internal/tfresource/not_found_error.go | 3 ++- internal/tfresource/retry.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/tfresource/not_found_error.go b/internal/tfresource/not_found_error.go index 9bc03361fff..261b7565c01 100644 --- a/internal/tfresource/not_found_error.go +++ b/internal/tfresource/not_found_error.go @@ -9,6 +9,7 @@ import ( "iter" sdkretry "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" "github.com/hashicorp/terraform-provider-aws/internal/types/option" ) @@ -87,7 +88,7 @@ func (e *TooManyResultsError) As(target any) bool { // SingularDataSourceFindError returns a standard error message for a singular data source's non-nil resource find error. func SingularDataSourceFindError(resourceType string, err error) error { - if NotFound(err) { + if retry.NotFound(err) { if errors.Is(err, &TooManyResultsError{}) { return fmt.Errorf("multiple %[1]ss matched; use additional constraints to reduce matches to a single %[1]s", resourceType) } diff --git a/internal/tfresource/retry.go b/internal/tfresource/retry.go index 3ebd030f7ed..b577bc0e059 100644 --- a/internal/tfresource/retry.go +++ b/internal/tfresource/retry.go @@ -141,7 +141,7 @@ func RetryWhenNotFound[T any](ctx context.Context, timeout time.Duration, f func // RetryWhenNewResourceNotFound retries the specified function when it returns a retry.NotFoundError and `isNewResource` is true. func RetryWhenNewResourceNotFound[T any](ctx context.Context, timeout time.Duration, f func(context.Context) (T, error), isNewResource bool) (T, error) { return retry.Op(f).If(func(_ T, err error) (bool, error) { - if isNewResource && NotFound(err) { + if isNewResource && retry.NotFound(err) { return true, err } From c727ee3db856456b7765a3c9afdc12098e0ea2d8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 1 Dec 2025 20:30:27 -0800 Subject: [PATCH 223/227] Semgrep fixes --- .../wafv2/web_acl_rule_group_association.go | 20 +++++++++---------- internal/tfresource/not_found_error.go | 8 ++++---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/internal/service/wafv2/web_acl_rule_group_association.go b/internal/service/wafv2/web_acl_rule_group_association.go index a21361204a9..51fd20d80a6 100644 --- a/internal/service/wafv2/web_acl_rule_group_association.go +++ b/internal/service/wafv2/web_acl_rule_group_association.go @@ -669,13 +669,12 @@ func (r *resourceWebACLRuleGroupAssociation) Read(ctx context.Context, req resou // Get the Web ACL and check if the rule group is associated webACL, err := findWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if retry.NotFound(err) { + resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + resp.State.RemoveResource(ctx) + return + } if err != nil { - if retry.NotFound(err) { - resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) - resp.State.RemoveResource(ctx) - return - } - resp.Diagnostics.AddError( "Reading WAFv2 Web ACL Rule Group Association", fmt.Sprintf("Error reading Web ACL: %s", err), @@ -992,12 +991,11 @@ func (r *resourceWebACLRuleGroupAssociation) Delete(ctx context.Context, req res // Get the Web ACL webACL, err := findWebACLByThreePartKey(ctx, conn, webACLID, webACLName, webACLScope) + if retry.NotFound(err) { + // Web ACL is already gone, nothing to do + return + } if err != nil { - if retry.NotFound(err) { - // Web ACL is already gone, nothing to do - return - } - resp.Diagnostics.AddError( create.ProblemStandardMessage(names.WAFV2, create.ErrActionDeleting, ResNameWebACLRuleGroupAssociation, state.RuleName.String(), err), err.Error(), diff --git a/internal/tfresource/not_found_error.go b/internal/tfresource/not_found_error.go index 261b7565c01..5c6fe6c0f2e 100644 --- a/internal/tfresource/not_found_error.go +++ b/internal/tfresource/not_found_error.go @@ -88,11 +88,11 @@ func (e *TooManyResultsError) As(target any) bool { // SingularDataSourceFindError returns a standard error message for a singular data source's non-nil resource find error. func SingularDataSourceFindError(resourceType string, err error) error { - if retry.NotFound(err) { - if errors.Is(err, &TooManyResultsError{}) { - return fmt.Errorf("multiple %[1]ss matched; use additional constraints to reduce matches to a single %[1]s", resourceType) - } + if errors.Is(err, &TooManyResultsError{}) { + return fmt.Errorf("multiple %[1]ss matched; use additional constraints to reduce matches to a single %[1]s", resourceType) + } + if retry.NotFound(err) { // nosemgrep:ci.semgrep.errors.notfound-without-err-checks return fmt.Errorf("no matching %[1]s found", resourceType) } From 908dd52f8d5c01a1a9d5bfc410e81019261f0306 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 1 Dec 2025 20:55:15 -0800 Subject: [PATCH 224/227] Restores definition of `tfresource.NotFound` --- internal/tfresource/errors.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/tfresource/errors.go b/internal/tfresource/errors.go index c288996612a..bac461c584a 100644 --- a/internal/tfresource/errors.go +++ b/internal/tfresource/errors.go @@ -9,6 +9,15 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/retry" ) +// NotFound returns true if the error represents a "resource not found" condition. +// Specifically, NotFound returns true if the error or a wrapped error is of type +// retry.NotFoundError. +// +// Deprecated: NotFound is an alias to a function of the same name in internal/retry +// which handles both Plugin SDK V2 and internal error types. For net-new usage, +// prefer calling retry.NotFound directly. +var NotFound = retry.NotFound + // TimedOut returns true if the error represents a "wait timed out" condition. // Specifically, TimedOut returns true if the error matches all these conditions: // - err is of type retry.TimeoutError From ab8caa484fa5384eebdb9da08e112d554ea0f172 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 2 Dec 2025 17:12:17 -0800 Subject: [PATCH 225/227] `s3tables` --- internal/service/s3tables/table_bucket_replication.go | 2 +- internal/service/s3tables/table_bucket_replication_test.go | 2 +- internal/service/s3tables/table_replication.go | 2 +- internal/service/s3tables/table_replication_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/s3tables/table_bucket_replication.go b/internal/service/s3tables/table_bucket_replication.go index 6e1d71c02ee..271840c0995 100644 --- a/internal/service/s3tables/table_bucket_replication.go +++ b/internal/service/s3tables/table_bucket_replication.go @@ -140,7 +140,7 @@ func (r *tableBucketReplicationResource) Read(ctx context.Context, request resou tableBucketARN := fwflex.StringValueFromFramework(ctx, data.TableBucketARN) output, err := findTableBucketReplicationByARN(ctx, conn, tableBucketARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3tables/table_bucket_replication_test.go b/internal/service/s3tables/table_bucket_replication_test.go index 9086e516e21..bb0f2f262dd 100644 --- a/internal/service/s3tables/table_bucket_replication_test.go +++ b/internal/service/s3tables/table_bucket_replication_test.go @@ -145,7 +145,7 @@ func testAccCheckTableBucketReplicationDestroy(ctx context.Context) resource.Tes _, err := tfs3tables.FindTableBucketReplicationByARN(ctx, conn, rs.Primary.Attributes["table_bucket_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3tables/table_replication.go b/internal/service/s3tables/table_replication.go index 185cdfb18e8..72bf38b39c7 100644 --- a/internal/service/s3tables/table_replication.go +++ b/internal/service/s3tables/table_replication.go @@ -140,7 +140,7 @@ func (r *tableReplicationResource) Read(ctx context.Context, request resource.Re tableARN := fwflex.StringValueFromFramework(ctx, data.TableARN) output, err := findTableReplicationByARN(ctx, conn, tableARN) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3tables/table_replication_test.go b/internal/service/s3tables/table_replication_test.go index fa59b8a9b45..0ceac1b2b00 100644 --- a/internal/service/s3tables/table_replication_test.go +++ b/internal/service/s3tables/table_replication_test.go @@ -145,7 +145,7 @@ func testAccCheckTableReplicationDestroy(ctx context.Context) resource.TestCheck _, err := tfs3tables.FindTableReplicationByARN(ctx, conn, rs.Primary.Attributes["table_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From 780ec03b5d93b507b8cd8c4f8d4007df7393f0d2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 2 Dec 2025 17:12:41 -0800 Subject: [PATCH 226/227] `s3vectors` --- internal/service/s3vectors/index.go | 2 +- internal/service/s3vectors/index_test.go | 2 +- internal/service/s3vectors/vector_bucket.go | 2 +- internal/service/s3vectors/vector_bucket_policy.go | 2 +- internal/service/s3vectors/vector_bucket_policy_test.go | 2 +- internal/service/s3vectors/vector_bucket_test.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/s3vectors/index.go b/internal/service/s3vectors/index.go index 7479ac316e3..c8281803921 100644 --- a/internal/service/s3vectors/index.go +++ b/internal/service/s3vectors/index.go @@ -154,7 +154,7 @@ func (r *indexResource) Read(ctx context.Context, request resource.ReadRequest, arn := fwflex.StringValueFromFramework(ctx, data.IndexARN) output, err := findIndexByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3vectors/index_test.go b/internal/service/s3vectors/index_test.go index 62fd5311eb0..ec9e0d1de6c 100644 --- a/internal/service/s3vectors/index_test.go +++ b/internal/service/s3vectors/index_test.go @@ -153,7 +153,7 @@ func testAccCheckIndexDestroy(ctx context.Context) resource.TestCheckFunc { _, err := tfs3vectors.FindIndexByARN(ctx, conn, rs.Primary.Attributes["index_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3vectors/vector_bucket.go b/internal/service/s3vectors/vector_bucket.go index fb533e61078..109a7a6964e 100644 --- a/internal/service/s3vectors/vector_bucket.go +++ b/internal/service/s3vectors/vector_bucket.go @@ -145,7 +145,7 @@ func (r *vectorBucketResource) Read(ctx context.Context, request resource.ReadRe arn := fwflex.StringValueFromFramework(ctx, data.VectorBucketARN) output, err := findVectorBucketByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3vectors/vector_bucket_policy.go b/internal/service/s3vectors/vector_bucket_policy.go index f15813d704a..2a076bf1f63 100644 --- a/internal/service/s3vectors/vector_bucket_policy.go +++ b/internal/service/s3vectors/vector_bucket_policy.go @@ -96,7 +96,7 @@ func (r *vectorBucketPolicyResource) Read(ctx context.Context, request resource. arn := fwflex.StringValueFromFramework(ctx, data.VectorBucketARN) output, err := findVectorBucketPolicyByARN(ctx, conn, arn) - if tfresource.NotFound(err) { + if retry.NotFound(err) { response.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) response.State.RemoveResource(ctx) diff --git a/internal/service/s3vectors/vector_bucket_policy_test.go b/internal/service/s3vectors/vector_bucket_policy_test.go index 1d76f4c859e..33d0c7ae6ca 100644 --- a/internal/service/s3vectors/vector_bucket_policy_test.go +++ b/internal/service/s3vectors/vector_bucket_policy_test.go @@ -110,7 +110,7 @@ func testAccCheckVectorBucketPolicyDestroy(ctx context.Context) resource.TestChe _, err := tfs3vectors.FindVectorBucketPolicyByARN(ctx, conn, rs.Primary.Attributes["vector_bucket_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } diff --git a/internal/service/s3vectors/vector_bucket_test.go b/internal/service/s3vectors/vector_bucket_test.go index c5f42906416..c33c3d55f5d 100644 --- a/internal/service/s3vectors/vector_bucket_test.go +++ b/internal/service/s3vectors/vector_bucket_test.go @@ -275,7 +275,7 @@ func testAccCheckVectorBucketDestroy(ctx context.Context) resource.TestCheckFunc _, err := tfs3vectors.FindVectorBucketByARN(ctx, conn, rs.Primary.Attributes["vector_bucket_arn"]) - if tfresource.NotFound(err) { + if retry.NotFound(err) { continue } From a324843f8bafec40ab29a809cf70b0e533b7570b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 2 Dec 2025 17:55:42 -0800 Subject: [PATCH 227/227] Fixes imports --- internal/service/s3tables/table_bucket_replication_test.go | 2 +- internal/service/s3tables/table_replication_test.go | 2 +- internal/service/s3vectors/index_test.go | 2 +- internal/service/s3vectors/vector_bucket_policy_test.go | 2 +- internal/service/s3vectors/vector_bucket_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/s3tables/table_bucket_replication_test.go b/internal/service/s3tables/table_bucket_replication_test.go index bb0f2f262dd..f887c421b68 100644 --- a/internal/service/s3tables/table_bucket_replication_test.go +++ b/internal/service/s3tables/table_bucket_replication_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/s3tables/table_replication_test.go b/internal/service/s3tables/table_replication_test.go index 0ceac1b2b00..246c23cb073 100644 --- a/internal/service/s3tables/table_replication_test.go +++ b/internal/service/s3tables/table_replication_test.go @@ -15,8 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3tables "github.com/hashicorp/terraform-provider-aws/internal/service/s3tables" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/s3vectors/index_test.go b/internal/service/s3vectors/index_test.go index ec9e0d1de6c..43390d3b2e0 100644 --- a/internal/service/s3vectors/index_test.go +++ b/internal/service/s3vectors/index_test.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3vectors "github.com/hashicorp/terraform-provider-aws/internal/service/s3vectors" tfsmithy "github.com/hashicorp/terraform-provider-aws/internal/smithy" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/s3vectors/vector_bucket_policy_test.go b/internal/service/s3vectors/vector_bucket_policy_test.go index 33d0c7ae6ca..97950285a61 100644 --- a/internal/service/s3vectors/vector_bucket_policy_test.go +++ b/internal/service/s3vectors/vector_bucket_policy_test.go @@ -19,8 +19,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3vectors "github.com/hashicorp/terraform-provider-aws/internal/service/s3vectors" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/s3vectors/vector_bucket_test.go b/internal/service/s3vectors/vector_bucket_test.go index c33c3d55f5d..f2fa815659a 100644 --- a/internal/service/s3vectors/vector_bucket_test.go +++ b/internal/service/s3vectors/vector_bucket_test.go @@ -22,8 +22,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfknownvalue "github.com/hashicorp/terraform-provider-aws/internal/acctest/knownvalue" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/retry" tfs3vectors "github.com/hashicorp/terraform-provider-aws/internal/service/s3vectors" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" )