diff --git a/.ci/.semgrep.yml b/.ci/.semgrep.yml index 818b0792bede..c116e4a3ecad 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 d2a615b2a436..87b2f3077b09 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 7ac00c741592..f778beda4736 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) { ... } diff --git a/.ci/semgrep/retry/retry.yml b/.ci/semgrep/retry/retry.yml new file mode 100644 index 000000000000..96d7e86d0d96 --- /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 2c422200f454..a5e0b1813b0b 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/docs/running-and-writing-acceptance-tests.md b/docs/running-and-writing-acceptance-tests.md index 989eea5b8213..28b424e4ce0f 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 diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index 0b6c418f5e8d..a019856b76e8 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) } diff --git a/internal/generate/tagresource/resource.tmpl b/internal/generate/tagresource/resource.tmpl index 20150c55c103..5e5289986bc3 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 6e20e99089dc..69ff56b9aba5 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 82c8a68b5343..dc4ed17843c2 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 } diff --git a/internal/provider/interceptors/htags.go b/internal/provider/interceptors/htags.go index 3572e6018e3d..551cc92e5544 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 } } diff --git a/internal/service/acm/certificate.go b/internal/service/acm/certificate.go index 793ee6ac30bf..a52a88fe18e7 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 6e0d6f88ca97..59e5517b2745 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 3b79a60221af..3ad51be7bdc0 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 d421e22c4993..cf267fae3dba 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 } diff --git a/internal/service/acmpca/certificate.go b/internal/service/acmpca/certificate.go index 7031144f65ae..91a4f0a1892c 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 c53a92d7d2a9..6efe5f485852 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 9c235c458d8a..3bde06bf0fa3 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 a45edd9fc5d5..a4453c4babcf 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 a26934a1fc32..408247f40bbe 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 5129c40c5352..7277657097e3 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 e7a2f88f0adc..21f080abdaf1 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 3ca2b8e36300..869bdd4bb780 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 55fb2752325d..237dcd858a07 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 } diff --git a/internal/service/amp/alert_manager_definition.go b/internal/service/amp/alert_manager_definition.go index 9dd15e1a2906..9e1c796870ed 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 c0c419b698f3..d5ac69bbf911 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 a662b35a83d9..7c6433259261 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 aee3d0ba105d..c89a18027ea0 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 54286e7b3e08..105ce928d0fd 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 cf807d195386..3c5f9d53bb58 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 d3a08695fe51..cd5999a752de 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 234768d60a3b..31ba50f41240 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 b90ae33601a6..641b254bc461 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 d2641734e20d..2286acdd29e0 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 c7ff8a247c15..fcf9bbaec556 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 76fecd2d3886..4f7ddacbc549 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 } diff --git a/internal/service/amplify/app.go b/internal/service/amplify/app.go index e814c8ce5401..8405ece3feb4 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 e18c961af83d..a618c632d0b0 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 b1e994bad538..48766553de17 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 956d407f9bbf..431c5931ef5b 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 986cdefe5f98..8b235f9ea704 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 c0a228b614dc..cd51a1aff575 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 27dc60709c5a..cb832077e111 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 d87ac5efbb4f..9cd671dc80b5 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 12593f9cfc3c..fe3f906284c4 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 99101697f0db..c18635f281e4 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 } diff --git a/internal/service/apigateway/account.go b/internal/service/apigateway/account.go index 8777942cdec9..46d42deda4f1 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 5d2de70420eb..47340aed3ebc 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 a0e86a47592c..9d1a42d2f164 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 63f1dfa45793..82ec59626009 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 819625199077..98b95d44730c 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 02593c2ec617..aca6afefbcd7 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 241111943f81..9e50a9709938 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 9e8b82d4e22d..6ed6766c4098 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 d2b465714fc0..4d965404a0d1 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 a5b6cdfecad8..9d2b91cb6826 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 e81038aeed76..78ff9f33603f 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 408748a7e7d8..a06ef2a95e94 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 94470348c261..638d4b6cabff 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 d56aa243efd3..1a0bf92197dc 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 805e71e8b424..50b24b5fcece 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 a835a613d108..1f9a41d82d0b 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 fcee8c97e939..2ae3a11fc4c3 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 55634dccc53a..caff5dc145a4 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 b149955e1279..420f81decc71 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 85ac0f594548..9cbe9007b553 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 3e2c9d1992c9..7f24bf39b608 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 34d686ba26ac..5d87d2125b55 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 f9aad0050d0c..d60d516ebc8d 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 2d3636ebcd60..7797773ec5f2 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 4fa68447567c..a3350bd7b41e 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 67e8fbb2d9d6..aa2c3232ee59 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 1843fda713d4..514f33741b0f 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 21adf52f7a93..1f9e5bb25900 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 048adbb4c0fd..a6370a401e3e 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 4d6107b471fc..026b51487a34 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 b9b2eaa04147..a6971eea5ece 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 c7ae8bbc77a1..f17d0a4ad50b 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 c96058b2a0b8..a178bd07602f 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 e99afbde94f1..98889637c044 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 84ee46799ec4..06154b8471ea 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 40cd4c014fa2..6728c1cef3cf 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 8aaee377bc55..675fe2a117c0 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 0af540f7aed0..8dabd5afb6aa 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 3d70e74ef447..67e9e21ba24c 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 d53e18ffcc39..178195de0da3 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 c56309b8ef2b..f84ebbc017b5 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 bb04ee7d9396..47f7968bbc5c 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 7ddf723d4880..f60d8a7f7c37 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 1599468bc025..0995c141bc82 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 95d0ccca3bab..31a121b26914 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 fe958a3f364c..391023fde9f1 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 f8e700d3275a..7d40dc47d3d6 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 e98486005c77..0f74a77cd836 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 84134e21fad6..cf39e43958f4 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 9765f4440f2f..5cc9af146e2c 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 } diff --git a/internal/service/apigatewayv2/api.go b/internal/service/apigatewayv2/api.go index 41bf8068f6d3..c7b7778bce22 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 49107692d520..4c2714204ed7 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 68efe0579e5b..d92493276591 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 4a9807bb02d6..1a773bba131c 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 ab8b1061225b..15574177c787 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 957d9a8f24f7..379f1be6b685 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 2aaa5ad04e38..0858c7a94521 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 991fff979e65..f36a009208d8 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 b0b795f89b10..60286051730d 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 2c9f94edd0c8..8b7cd27214ef 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 85c7fffc07d6..dd45aaa736de 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 92bc14cc5e1c..69b13c7a6f49 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 c916aba0d2ac..facdc7e98c6b 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 1c6d41726301..672af160ad5f 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 e18b779c4eb8..b6e200bec528 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 4e7054f94bf2..b5e817d32dee 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 b656ef90088c..3f1d01128b80 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 dbe4855f20c3..89d1ab749fa0 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 1ae1732180a7..dbaf43b7ad34 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 23b76be1659a..5fe4d96a53e4 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 9948d2ce2121..7bddc471d0a0 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 80ee809914ce..48063c3f79c1 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 8d22a23987c0..63466ebab6a8 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 cb1816e0a8d9..52411f40a8c6 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 } diff --git a/internal/service/appautoscaling/policy.go b/internal/service/appautoscaling/policy.go index a32c82d53201..184f5eec1e30 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 b33215f24488..a88fc39e8114 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 d1dcd3a15b44..f0e61c282d44 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 76cba5620294..4f203ab67ac1 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 781e3f6a7b66..05f0d111450b 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 a5b86ef6f4ed..88d0e31866f2 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 } diff --git a/internal/service/appconfig/application.go b/internal/service/appconfig/application.go index ff5765acbdbe..678120662d11 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 630372f62477..76208c3f96ec 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 4dc36cfe0b98..93caf22bca36 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 da6d045d8126..7637165b2c42 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 cd67e9391871..2c86d5459263 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 6ccb8fdf4c8e..9cf5e4bf19ab 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 ccadf32bf4ce..bde1737f0802 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 9fbc2041d4e3..493ab62dfac2 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 fd60abf6d443..0c6fda850807 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 4796d5c2357a..f09c8e517bf5 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 193e44bc4ad6..4e3a0e587091 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 d9186b06763f..6451a105e52c 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 bbc245ab9ba8..38233a2bc99c 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 5d3e5d0f965e..d10a268b7556 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 066d63284926..4a3186c93c17 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 } diff --git a/internal/service/appfabric/app_authorization.go b/internal/service/appfabric/app_authorization.go index f05eab8182ac..a56358934366 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 e8fd925bd300..65e6a96b84fb 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 f926e3cbe6d0..51cca682cb81 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 50846bf623b3..702e2add66a4 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 19f098a9beb8..92b17f085b0e 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 5fd893877215..4570a6b83d7f 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 3fb2fc36836b..1453160e3962 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 b0651df2165f..c17d42aaeec6 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 769b952e2b1b..686ea3343cfd 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 } diff --git a/internal/service/appflow/connector_profile.go b/internal/service/appflow/connector_profile.go index 989a45dabbb9..22fae34ff9e8 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 4091371978f8..277da6f87162 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 e44285030d2d..4358bdf71e98 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 8476ad7610bf..67e7fb405b25 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 } diff --git a/internal/service/applicationinsights/application.go b/internal/service/applicationinsights/application.go index 689a2d70e801..3c313ad6cbad 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 7bc028b4a1bc..1a51ebd36e15 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 } diff --git a/internal/service/appmesh/gateway_route.go b/internal/service/appmesh/gateway_route.go index e7b5bcd94c11..293e3b69b746 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 e3f58685ea15..a8ba0da78d0c 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 71843540e825..b280fadaad34 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 2f9184b4f615..80cbf60870ea 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 01322aea6b99..c72aae031ed9 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 6ac09bb5343c..508f829c3ff0 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 e750fc88bb2d..20908fa005e2 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 8f4fd2395771..80d5dd596f51 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 29ac0121ba90..b63e3f41249b 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 a4e2364a5019..94047e5cdc08 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 bc79230e2fdb..c48baa3c34c3 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 b773f835c59d..5bdc5232eb51 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 12d434bedfdc..cb66c1c207c7 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 e3fed27749c0..406732dabde9 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 } diff --git a/internal/service/apprunner/auto_scaling_configuration_version.go b/internal/service/apprunner/auto_scaling_configuration_version.go index dcc916744997..80f122d98fb9 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 845bc7df6163..46667b6cebf5 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 38fd3be9902b..a058b7edca79 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 17332533d425..a94449164c49 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 5e653bbc5b19..3495e0162db1 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 38b780e0ab2a..f8e9589c6b8a 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 30b42d35771a..b60fcf448f61 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 f718b9ed520c..9c5f3a86f3e6 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 b4af70ebe1a2..5630ab4eb49d 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 adbd2df01283..955eaf915305 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 e70c27743557..fb53397e59cb 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 9bfc9a51adfd..623ff42bc8f7 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 1cb017e31369..fec5f2627a45 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 f2839134458e..e801f8b9506f 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 47eabe6fe96a..ae21be4f37a0 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 db17da6f5646..9ab1757ccbc4 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 } diff --git a/internal/service/appstream/directory_config.go b/internal/service/appstream/directory_config.go index e6396b181693..824bc33e5f14 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 56d526956447..773845f9b4d1 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 d637f86ec757..a5cf53b3a7fa 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 046ea505772b..6c343d1bcb3a 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 82e846b5bc82..9fb94f435297 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 12ed20d01e36..cec86e33801a 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 a7d94bb5b436..7b32a8a11eef 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 d96e052d5a4a..40c1ccc57a3e 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 168368dc7dc8..b54d7efd2af7 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 061eb667c58d..ffa4143be010 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 2af0e65ed7e4..f60192b77b72 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 5e2e9c1e6e54..1a5d3785b862 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 37f1b9dc8b15..7c73aba3e6f5 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 255cebe38f9a..1ce4b13c448a 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 } diff --git a/internal/service/appsync/api_cache_test.go b/internal/service/appsync/api_cache_test.go index 0e73cb9b59e1..aa07a6016e5b 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 b73316748578..b7ea5308b1d2 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 a85bc4355973..b3505635d497 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 37ae0c7fd1e4..2b5f734e6fee 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 cdee0bef6892..1adc8fa89f1d 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 f7a1b6d1c89e..786c252465d0 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 36710ed83f79..3cb803926b76 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 9162e44053fe..64b99deddca6 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 66273a3400b3..fb7668908116 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 91074bc76f50..2639bd7ab3f0 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 95d46fe4e13b..4e17525b79fa 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 05c7ce1acf20..179f72362369 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 } diff --git a/internal/service/athena/capacity_reservation.go b/internal/service/athena/capacity_reservation.go index 79a2f22680eb..73352e93c264 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 b52290195730..dae0e8c671e9 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 ce3108652cc6..805b2a39121b 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 e84079e72a20..697965c52140 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 680acf92ee1c..1581faef7942 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 8facb035dd5f..1613d0597607 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 14a12582a088..418089ce0f67 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 278aacae2d22..a5e678e4c9ad 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 095f43d94a24..f86d845cd9d5 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 ea832d17e210..1cdb615b7519 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 bde87b893808..a0cb63f50999 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 153fe5677fff..e2b190929b69 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 } diff --git a/internal/service/auditmanager/account_registration.go b/internal/service/auditmanager/account_registration.go index 8fbc4c786e98..3ce8bab126d5 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 5de711518bd6..cb16a0552307 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 ba1b32858b36..4abb1e565924 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 cd9c76e32fa7..c915127eb54c 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 e227587f3f0e..c5b7d32d2dcc 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 a28ab29b3dab..75ac8e065750 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 098dc6871067..ae206e102568 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 7204adbbab4e..f2915eca773c 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 3ccef121ed87..5517460b6882 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 f62d4c6b0656..7bffb623699c 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 48c219a251d9..b9590b8c51bb 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 7b2d5b731b05..76c553f008a5 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 c553c95ade25..53b96d2898b0 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 3d8b4479be17..befc6f5bceaf 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 b11f71cc68fb..659ab85ae370 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 } diff --git a/internal/service/autoscaling/attachment.go b/internal/service/autoscaling/attachment.go index 5377073cbf86..97e958493851 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 4896d59ac72c..8ffd60a4086f 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 d0fced0aa32f..e54d24057c84 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 722c4a976bba..dfd2766456e1 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 e118c5a797a9..5ce6a48b7034 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 fef7b79d75e1..eb4e369d1903 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 26dd2a313074..7b46f2863cc8 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 3161ab693ec1..8112f8eb4d84 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 ac48e22768b4..ff1eab2790c4 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 e76791ba9d23..7df50aa79c99 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 71a453a1fcef..7c4eb617a588 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 4d5bc624c8ef..345a7c65f50e 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 b65eef022a84..3f577999f3ab 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 5013691cf4e9..93ca49828d44 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 8857886edf77..0ad87b2e45e3 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 f8b0cd09f66e..f29c10eaa5ae 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 5ab767bf46a7..d5559dfc045a 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 91cce0067a1a..ea074ba36ad5 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 } diff --git a/internal/service/autoscalingplans/scaling_plan.go b/internal/service/autoscalingplans/scaling_plan.go index 4f5cce5acc20..579d12bf8325 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 } diff --git a/internal/service/backup/framework.go b/internal/service/backup/framework.go index 1376ec3c3c62..00c5b5a607d9 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 fc44915baea8..ccda35d6d941 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 ebc1cec6e7f9..e13b9e21c0d0 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 17b6bd1eeb05..3344eb79ae5e 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 204f6704581b..2da60cbc43c4 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 2f83a975726a..78ed08632df3 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 b07777dd5612..4fa965d6a6a2 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 a8ced1b41983..dbb3cf549823 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 2ec94f0c8034..78ac921c6dc2 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 0b9db52ebfbd..1e4c02091a9c 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 acc790dfcee8..603d9f5bb987 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 dcd02c01c735..3a527f152c01 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 c2830bf5f451..305eb1785313 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 150eec5d062c..e25a3a7c93fa 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 d61f04a1176b..2a3ab0a947ed 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 806cd54319ed..c23443614a1d 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 64da38eada9f..3107eb1a73ef 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 ba8966899caf..de0ee8b819e7 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 273404d71aaa..231e1b0668ce 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 42873bf02dff..61e0975df353 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 df1afc3212b4..1adcd3f9ff61 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 652fbd90c200..da3739f52c07 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 bcf52ec9c355..a7f4603c5e07 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 95781ae35d21..84fe1504c629 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 } diff --git a/internal/service/batch/compute_environment.go b/internal/service/batch/compute_environment.go index aaf0f995e50e..9bdbce09f404 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 cc426e6f1f82..e09648eaf3ab 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 a6d86aaaa26b..5537c6ef566d 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 b30d45c4787d..fa6da586f396 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 6f00d6f98bb4..1e8352556371 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 b3d0ebaf2e4f..b8b40d2076c9 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 67cb1e6dcd02..f2af9437584c 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 253053b09277..af1eea8ee6ce 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 } diff --git a/internal/service/bcmdataexports/export.go b/internal/service/bcmdataexports/export.go index c545041ade65..dbe78072fa5f 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 } diff --git a/internal/service/bedrock/custom_model.go b/internal/service/bedrock/custom_model.go index 7da7d8006732..ed0a99111791 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 981a866909ba..c0db84c5d301 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 c9e16ae4e846..c897efffa519 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 c177970d0c0d..f19947bb9cf0 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 4faeccf83e5f..33cfcb81577d 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 b9ec1a3b1865..2280c8fcbe41 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 5188485f9973..7d2d95c074ec 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 bf07002341ff..15d7ff8dfd94 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 2e1900cd5448..f4276479321b 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 37ad56eff2b1..dee644e492ac 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 } diff --git a/internal/service/bedrockagent/agent.go b/internal/service/bedrockagent/agent.go index 16d29bd4397f..ed1ce1dbe30f 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 8600d13d968b..75f3add9294c 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 9133e0f0411e..ad23c20d6e1f 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 c417f1b11b6c..62d6e90af8fa 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 67c2ad0df4a7..8641e8c0c267 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 497a96cf3163..8fad6d2990e9 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 89759ca50217..b2292e02f98f 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 f65a21b2df7a..854c237a72a3 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 7aa1b457fa34..961913cbd848 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 34f72b3a9944..cb23846f7cc0 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 4f4569bf1ae1..e2c0fef68908 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 8c88b8d51085..e694c7e8905d 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 a54a95599909..81a0bbd6eaab 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 54500184949e..b1b3edc6a45d 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 aeadc04032ad..313decd4803c 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 b12b4f9ecae4..f28a9785c485 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 7f1e8f653ad8..5ce292e1ef5b 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 d175636e75b4..75a2004be08c 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 } diff --git a/internal/service/bedrockagentcore/agent_runtime_endpoint_test.go b/internal/service/bedrockagentcore/agent_runtime_endpoint_test.go index 3c9b1444cef3..4765e2cd4773 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 b528d07cf826..75e60ad5ad08 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 { diff --git a/internal/service/billing/view_test.go b/internal/service/billing/view_test.go index ddb4f4fb25b7..7e9b7e15e649 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 { diff --git a/internal/service/budgets/budget.go b/internal/service/budgets/budget.go index b5e255e2f977..44b9ce515da8 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 96335a6c1ac7..1d8d7adebd71 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 241176263a7d..fb760f827daa 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 01a6c01b6be7..0b652d3f04a9 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 } diff --git a/internal/service/ce/anomaly_monitor.go b/internal/service/ce/anomaly_monitor.go index 9d9509c9ebc3..c8720b1ae31e 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 1f7ea05c9704..42eaa93792d9 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 eedfe59a6191..bb572b926475 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 cf30fb8ba6ec..b6c85a7bc2e9 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 825a97f994ae..532e0c6f5a15 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 a63c1cfdb1a5..4a3c7bcbd1f9 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 909dfe354ba2..c0be6d148612 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 } diff --git a/internal/service/chatbot/slack_channel_configuration.go b/internal/service/chatbot/slack_channel_configuration.go index 790432ce68b8..3beeb63106ae 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 d461a18c1af7..f1eb1270811a 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 4ee97872a70f..2b6fa40dc422 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 cd89d6321391..a2ff82b60e82 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 } diff --git a/internal/service/chime/find.go b/internal/service/chime/find.go index 6f11cc98ca40..e1a688803d8a 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 7c86a99082da..5c888c5a6ba3 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 2e160f2ab7da..d6133b83c824 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 9e6beb3a5142..fb3f71a3efc2 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 76b13f7972bb..2a1530289b63 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 2754be9c3483..8897cc6192cc 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 933fd75bda87..4f5e5d636991 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 d18a8caad580..44e73195b5fc 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 11ab294d4d86..89897b69d9ec 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 dd27e479932d..e417bc2d1a50 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 } diff --git a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration.go index d1bb9418e782..0359041e4712 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 diff --git a/internal/service/chimesdkvoice/find.go b/internal/service/chimesdkvoice/find.go index 35e85cc97737..2ce273c256d7 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 d0aaeade834d..03cb25efe716 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 cdc7f8e146e8..fdea8471df0d 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 e833e1a267e5..d3ab57b5507b 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 6350b0620c81..00242e925979 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 fb7b753f7f8d..1ee695b6e631 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 diff --git a/internal/service/cleanrooms/collaboration.go b/internal/service/cleanrooms/collaboration.go index aeeb769b664a..dbd108c22de0 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 000491d2d170..f8660af4503c 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 e319f72d9343..3d47468a240a 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 diff --git a/internal/service/cloud9/environment_ec2.go b/internal/service/cloud9/environment_ec2.go index 1defef0a0ae8..20c69545a211 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 b002e41f2328..3ccf9bc54373 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 47f79438bcbf..9970747693f1 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 eabadb70d6f7..113222e7c722 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 } diff --git a/internal/service/cloudcontrol/resource.go b/internal/service/cloudcontrol/resource.go index d5c1725b6c1f..df0fb0269758 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 } diff --git a/internal/service/cloudformation/change_set.go b/internal/service/cloudformation/change_set.go index 8872b84f3127..30bb75a3e9f1 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 c6bfcc6c6f8f..5168feb10d5d 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 dd4064f279c9..3e6738332ba5 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 f062397fed05..0dc585fe9770 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 b7dc005f00d6..acd56a298af5 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 4b920c94be1f..9dbcf95167b4 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 7bcb7f582185..3326e378dd55 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 652bc4cb145c..211c3d726cbc 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 4ffd05bed99f..25513bfd424a 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 de3b509e6e84..8137269cf081 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 9005ff74c687..411ea8755c0d 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 } diff --git a/internal/service/cloudfront/cache_policy.go b/internal/service/cloudfront/cache_policy.go index cdd80b95d961..444ef331d982 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 5d4dbb478349..e38b98d80d0c 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 aae90a97d16a..84e0afc86c27 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 e65ad5ddd1a8..f5886df98159 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 760ed9891f51..59ce3abcbb0d 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 719336f1cf47..38db66837295 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 e5a0f5b1f19e..6fe3d4af571a 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 35d28ae5951c..0350ce3ef58b 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 35e7d569105e..00610c9a9cac 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 91887785975a..f7856cb950b2 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 0058cd68b757..eed3f522c8a3 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 6e5685f669e8..64b022087a26 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 d2afffea1e0d..0677e724e106 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 b21f6028d72d..5e7e8227496d 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 3f84d0d54fae..1eefffb92e36 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 09ce475e606b..bc418a412c90 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 a0bf4114b5ca..41275134ac8a 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 77be04fc0f25..8641dedda012 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 381986407593..7c2db5bd17d4 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 6d016ab55bd4..d335132d22eb 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 0b9d8002bf08..74a09b37b692 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 832c03a9ab0b..26ab91889e55 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 9b23e8172b12..88dcbed8ab42 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 bbc150486ff3..dd6724e9b28f 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 16182d959bc0..42f8b616803e 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 b4c46ea3e081..ede74137c963 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 b04b819b80fe..a003219564c5 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 03e00875c19b..a60790c28cd0 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 88946c05fbd4..6e01ec281eaf 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 07b1bd727a1d..2c3a1d525f3a 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 8a64df68b5f2..0e71dac56c0b 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 6539abba9d43..201830fa2904 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 e4112ae3a662..62aa49e533be 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 } diff --git a/internal/service/cloudfrontkeyvaluestore/key.go b/internal/service/cloudfrontkeyvaluestore/key.go index 4ad2770286fd..615bf3e07931 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 e7c523bee545..2c7b05b01b38 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 67592e89973b..976e73b977e3 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 6a6b3dc14f49..a001e932e390 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 } diff --git a/internal/service/cloudhsmv2/cluster.go b/internal/service/cloudhsmv2/cluster.go index 6a41fd142cac..ace81a995a65 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 0a54d818d097..6b762cb1df65 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 b72eec901c65..5548427c14a9 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 1e1bbe612ae1..b43b501b21f1 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 } diff --git a/internal/service/cloudsearch/domain.go b/internal/service/cloudsearch/domain.go index 74d73761fdbc..e5f4d6c942cf 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 c5128e68b5a8..212eaa55f65f 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 } diff --git a/internal/service/cloudtrail/event_data_store.go b/internal/service/cloudtrail/event_data_store.go index b027bc774338..8690d2e43cf0 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 bd5e17acd504..fd452195d97d 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 cdf7be2beed4..3463e060f9ad 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 506b0bf49fb0..776a7c0abd7a 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 cc62dfc02830..af4f5f8c81aa 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 63cf3c0992f6..f9950c845b4a 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 01d30ff137b1..217adc5b9a1d 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 } diff --git a/internal/service/cloudwatch/composite_alarm_test.go b/internal/service/cloudwatch/composite_alarm_test.go index d4867c0c3921..f0e33dc1738c 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 b6a16ea233bb..ca46cdd38a87 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 6125a9ad984b..558add975f3b 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 d226179f9fb1..b745acac097a 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 7c25a3351f5b..d8d1fb760d0a 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 90214599fd06..b1a6cb67a75a 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 } diff --git a/internal/service/codeartifact/domain.go b/internal/service/codeartifact/domain.go index b1134dd509ab..9ccb4d6762ed 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 4c6cf9ff3654..82e9db78737a 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 9ecb7c2bf8c2..260ddadff71f 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 2f45226bfeff..13edd17670eb 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 e7267a5328b0..33d2789b438e 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 fe0901c07824..68ab987fda09 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 69fd4555d8b4..5e2dc325caad 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 46c21c4e1c16..f7853f422290 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 } diff --git a/internal/service/codebuild/fleet.go b/internal/service/codebuild/fleet.go index faea198e92c7..5795fdaa49cd 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 eae708711332..f35717cb892d 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 350491fe94bc..7e1e5d639e37 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 c82458eac16c..75a91e0ca086 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 5c7200e43c5d..30117015a510 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 448ca86fa5c3..b3d0527776e3 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 3fa289f9d649..1a58dac2e817 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 692ce2336554..9927833690cc 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 7e92b0b97f33..dd04ca8a3619 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 be00996b17c5..a37acd083d2a 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 ef04463f6b93..ae719d7438dc 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 f4d0aef640d5..4bbc11c1ee6f 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 } diff --git a/internal/service/codecatalyst/dev_environment.go b/internal/service/codecatalyst/dev_environment.go index 5cac9f9df506..2a5369745afb 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 6b5b6217a021..982dbc12fef2 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 453d027a9adc..605378718f03 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 diff --git a/internal/service/codecommit/approval_rule_template.go b/internal/service/codecommit/approval_rule_template.go index 06fd2beb6e05..263dfcb8deac 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 cce7685d9e3a..96807ccacb27 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 9b425cf936f1..4b36e844e544 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 f5390d4c7b9c..ca9ef7a728f0 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 e969b8f0cc15..312dea12e4dd 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 ac8bca83d675..e3cbd4f7d9b2 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 2c3d3cf1b3bf..303f3e566731 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 0d3db3316694..49df609b8984 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 } diff --git a/internal/service/codeconnections/connection.go b/internal/service/codeconnections/connection.go index 2b0fff4a8278..c5c5e9698921 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 c582fb5c3c8e..23e451d5d8b7 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 361fc4d06a69..b3eac587a2bd 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 69e7fec75dfd..81cb06dd7676 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 } diff --git a/internal/service/codeguruprofiler/profiling_group.go b/internal/service/codeguruprofiler/profiling_group.go index 1e55b5ea9832..a42ae96f1fcb 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 9a40eece7bbb..492bcdbc541f 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 f18644ad5cd9..c5c88dbc8089 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 } diff --git a/internal/service/codegurureviewer/repository_association.go b/internal/service/codegurureviewer/repository_association.go index 00f24b79a37d..c2ed25571e0f 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 24ed8807d51e..562877476e8e 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 } diff --git a/internal/service/codepipeline/codepipeline.go b/internal/service/codepipeline/codepipeline.go index 77a70795a778..abc0b0227c07 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 6b9a90203446..f19b67cd5573 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 1d00d32667c7..db6f880adac2 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 418b66129848..569257e90710 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 50fea3577799..3c685f926a69 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 2369f5b7a4f5..632ddd081397 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 } diff --git a/internal/service/codestarconnections/connection.go b/internal/service/codestarconnections/connection.go index 489673f2d041..a8f75001d3ed 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 bb0d4d297e73..92b8019aa07f 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 9ef3cdac0d5f..08ec334d154b 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 00a215d84746..c0955019824b 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 } diff --git a/internal/service/codestarnotifications/notification_rule.go b/internal/service/codestarnotifications/notification_rule.go index 3d3e3ed79638..3c1a83c27195 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 7e492a5d6d06..e52782056667 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 } diff --git a/internal/service/cognitoidp/identity_provider.go b/internal/service/cognitoidp/identity_provider.go index d1eb852c2970..34e9ba1cbdb6 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 1c492ac599a3..3c68ba6a0d0f 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 e768e7dc5f96..bfa5803acb0f 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 1992f717f959..749cd5f73d0c 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 0c1a76bd1b8d..93d9c8a66a6c 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 930f86030d8c..0c94037a5018 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 a6a1b5c6d829..a9b599a3a23b 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 a5af2268be18..a3b1069dc4c0 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 ff9f369d66cb..b9fafb064660 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 648b322eae6c..dca11114de13 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 ce3b56f9cfa4..9ebb28db47fc 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 7820a3e9298b..f03b6063e79f 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 fb596fb35884..420bb6496633 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 4e2cecd3abbe..487cf8c8702c 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 4195e70c7563..af58051bfccf 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 c180c0e8961b..561870386bd8 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 dfe6fd76a981..52efc05179a3 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 635908824a9a..cbb3f890eace 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 3fcc585d0dfa..dc1195bcabb1 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 0b9072f97b14..18e6f8daeff6 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 869878e394a1..ded5e85db4f5 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 69b01afccfe8..beb64330968d 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 4fe00f8e7101..8e7ee3eb45e1 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 62796a48f341..bb1ca26eeac4 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 } diff --git a/internal/service/comprehend/document_classifier.go b/internal/service/comprehend/document_classifier.go index 4de5658d33f1..f2d4c2df8a53 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 1ce69f157719..314149478e8b 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 } diff --git a/internal/service/computeoptimizer/enrollment_status.go b/internal/service/computeoptimizer/enrollment_status.go index dcaffdbb060e..52e6c7807de8 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 086d13cb0a62..5778c0065962 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 50a0e60bb0af..b77731643a5c 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 } diff --git a/internal/service/configservice/aggregate_authorization.go b/internal/service/configservice/aggregate_authorization.go index 7a696d3e0e79..a35d75b42530 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 aa69d5cfeba7..1cdc30eef991 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 c0bd8054b831..d8b4538ab12d 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 d3f37f8de514..c31271b43f44 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 47f79e98e502..643b8d68875a 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 77be0d648ca9..18ef31c22db6 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 8a655834db9a..f537859cb493 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 b4cd503a5766..b1e08dbd3267 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 980963bc6e36..cdb712560efb 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 85f4194f3085..f254d677fd00 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 32f312b5617a..8a7f017163e5 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 4f9eaf9790b5..2ceacb30dc3d 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 41262e30465c..04c913a1e50c 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 f184a60bfc4b..0d9cd54117bf 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 b36ce8df54c7..0f39f2a7ba29 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 d585123ef3cf..df9c91297ef2 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 1df7c31ef966..dc0b9327b508 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 087416ae44f7..7e3b743ce599 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 c224bc88a303..74734e95eee4 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 c509d7f1585c..9584d17d61d1 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 69a2d4bbb5fd..3246984019fc 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 6d087ac3954c..aad5bb1b93dc 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 391e21c2ade8..c8222033e860 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 c6828c217328..a734bb5e84f3 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 b809a4c75272..fadd176d5348 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 06dfcd5b448d..e355720c7664 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 } diff --git a/internal/service/connect/bot_association.go b/internal/service/connect/bot_association.go index 4f1761d50b06..ccd2f714d757 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 be47e9f0b003..a1aff49903d3 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 803c1cb4a840..7b558e58adb5 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 3285059fb63c..b94941d41bff 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 ce919711e04a..aa19b60460c8 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 9051d660a205..72454d3d8725 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 089bc7e517dd..e030bb419078 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 f0f8b69d49ce..aa9638876d66 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 36344a51b9e0..df0832edb9dd 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 49127a480d28..cf9e7cbe3796 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 1439357609c9..862a84cccae1 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 011406f390e5..30a340370b7a 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 85cfbbb201b6..cf2a52603343 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 09acc392b2c4..20b81bf4886b 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 1ff895a5afdd..25bb67b1bce1 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 e04088a6437b..fef185c62325 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 025958f11180..942fe2c45d99 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 acf917b965c9..c62215b0bee3 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 c58a4e0ac89b..d40778147fab 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 92bbda7ea256..a5d825a3fdc4 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 7fbf8d39b99c..4346cc1816f6 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 a71f4791f4c9..42cfc354f0b7 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 05d7dc2cf6a0..c210ede35020 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 cb20b539e61b..00434461144c 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 9d9fc9f500fe..1149d001b68a 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 5865b6ec28de..21d8d81cc80a 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 b41c717bc594..b7e5ebd306a6 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 c6724e2ed57c..19c4087d7da0 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 4f207e3dc62d..4fa894ecc6fe 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 6fe3a4b5d6ac..915353315008 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 648665c8eba0..4ad96ccdb3d4 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 2f7196dc307c..86512a2df58b 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 f6bba6d6dd8f..a434b54b771c 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 4004a2e74d73..e26a9161a3c4 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 } diff --git a/internal/service/controltower/control.go b/internal/service/controltower/control.go index dcd1b1ee55d1..f6c7ca1054e4 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 cc0bc14d10b2..40fad291917b 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 08bc87f089a7..45fb50835382 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 91e737eaeff1..a4357b36ee31 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 53094da84eec..865230cde60e 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 } diff --git a/internal/service/cur/report_definition.go b/internal/service/cur/report_definition.go index cdf4e26ea48c..0a05e8d173e2 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 5850f912be72..cf8976ce5165 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 } diff --git a/internal/service/dataexchange/data_set.go b/internal/service/dataexchange/data_set.go index 060947259a31..f2703bf35d1f 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 1ff3199986c4..263ed803b536 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 55374a6629ca..01ebb7bf5cfa 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 7713f2e5696f..0b3a671da110 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 fb9443a5fb0b..30752d2ea6c0 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 b9e238f9dfe6..c81c1be89a42 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 1ad139d83473..f3121a629870 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 } diff --git a/internal/service/datasync/agent.go b/internal/service/datasync/agent.go index 524eaa34b46a..9b383b9d0cd2 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 274fb0100498..3c0d6cd9df44 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 b1f63c1cd628..5c33aac1f4c4 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 23f16cfa7a69..d0ed1ae6c218 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 45a0a9dba7fe..55e7822af55d 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 4a5fa8cb3cc5..7b1942ed037f 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 058bf5bc0a49..c28fb3cc4400 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 62eb4eaaddcc..7017288a65c1 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 b51a28aa3b9a..d46ac65c9d69 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 967a1fd6fa64..5120b933db49 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 4509e7a4518b..3179b86fa98e 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 9a34184cce59..773fe67c34f2 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 8a02f0094d03..df63e4c13d1e 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 cdc9b1d55352..251ea6d85eb2 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 df4e07f4b2b4..655d255a9be7 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 0bbae7c75f14..e58b87ce833d 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 5e60dfdc5de6..8715d45668f1 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 e0675c481a77..c1737f1b2bf1 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 dc276140f2d3..595b66c5a8e1 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 c4753a51df04..3e529529e79b 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 0bdc397e913c..84db114d0263 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 92921db00e17..f31159fb223c 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 53315f059876..575c5bc52836 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 a61a192f24d8..d31efa0b8061 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 a181007d1cf2..0b842c2a08d5 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 c7cd82c63abf..8db065de750f 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 } diff --git a/internal/service/datazone/asset_type.go b/internal/service/datazone/asset_type.go index 2a0a8d24f890..a94ec4610de5 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 89a4b96f0758..3ccd79819051 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 265e336bbe48..8207bd507b9d 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 78c3f78c44a0..b4d53a468e6b 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 024b95cd5969..71778f998e5d 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 7263d669bf78..e738f6a1bf1f 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 da5d7d11b604..46424c319a0a 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 52e39d310697..cf4fc5a8a49a 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 b05d88d60d67..7f2456d49863 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 20bb3c8ff6c1..35af0c6512aa 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 bfc8f5a5cac1..3a1a6ce53915 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 541c76972489..20ccf537f592 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 1204084e7972..60eca0d7763d 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 2a3978acc417..73d4d550b516 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 } diff --git a/internal/service/deploy/app.go b/internal/service/deploy/app.go index c22024194020..f045bdefbcf1 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 7bb62327f0ef..d60f7c278016 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 974e32df17df..95c18f75e63e 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 17e5868b249f..d3d184421fa2 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 8734bcb3f8a8..bb2571a3aa3d 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 14900762c928..3771d9ffeb60 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 } diff --git a/internal/service/detective/graph.go b/internal/service/detective/graph.go index 33cfb29343e1..ec623cc4c1e4 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 0e8c3b01d230..f35e29c78c3b 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 1e2ff2522f9a..b4b97bf73332 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 6084b063443a..e217ebe8f7b7 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 c33dc289be90..429171c7c8ea 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 ba10e9ecae0f..c32358b20ca3 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 1ff4a110814a..a3d67b23071b 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 c45d9dc2cdc1..cc798a580de0 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 } diff --git a/internal/service/devicefarm/device_pool.go b/internal/service/devicefarm/device_pool.go index 0e1732c9edc7..54f407c76470 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 795fa78b58b5..58a0d0dbff03 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 9ab5bf29b94e..b92fc8ad29e4 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 86944a065a74..50796594fa49 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 b935ddfcffc6..92656460aabf 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 b03d4fe0801d..c036641bb886 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 0fc847d78bc4..ebfe7d65c55c 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 314089739788..34de4cef4cf3 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 5137693824fe..9fb88da59c14 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 a486d9d6388a..55ffafff996c 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 83c9e067c90e..f85adaa0a0f8 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 796866cc7ed8..1f47e807a2c2 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 } diff --git a/internal/service/devopsguru/event_sources_config.go b/internal/service/devopsguru/event_sources_config.go index cc0d7ab19044..2a7a13a78c8a 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 fd30067d57e6..7b6e9e4579f3 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 07b6499d1aeb..342c13970b40 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 aba224f5f205..cb41b0582031 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 { diff --git a/internal/service/directconnect/bgp_peer.go b/internal/service/directconnect/bgp_peer.go index 042522a6c89b..f4392aca8e9d 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 bd765db9025f..d7a3eec8b3bb 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 b37de094a398..2b6c125f8dd2 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 8c17606381a7..4328a4837259 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 69d998595955..b31186a1b1c4 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 ab3f06758547..b5528bc4fb64 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 6e2a22cf3017..403f747c2f8a 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 3e0a11dd19c8..3f31d8c2cc49 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 f1a9a9cd26d8..c61b75c525f5 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 b3046a688507..68dbf6e7d28b 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 dd985d66f5d5..a0e83b145638 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 3abcf11dc7a4..3c05b5a183bb 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 5d00a4051750..077847fe9155 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 ac74e5f7e721..74faa24b940e 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 7650e9c46195..b7b720a0f7ed 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 2aff8fa6673d..bcccf57ab595 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 7dfff70fcd2a..345dc2ec944c 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 17afd52a344f..2f1b2f30ccde 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 5cd83a2bf9d2..27bc16ca71d6 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 782c7ef5a9bc..636de9ec79b9 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 fd304580375e..b5af676e4432 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 11272cd85124..b5bd35f19976 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 d05f21872583..9803d63ca004 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 8097ceeb12ac..8ff802266865 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 063d6f8a12b4..18528330abec 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 a96cf2a4e977..855318eb4314 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 3dfa3cb51d20..b2b99d98d17b 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 a8d90c4167eb..0f4dd3c52684 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 5a4824b68d37..a97bedc32ba8 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 1f49e7137ea5..f5e0e5397323 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 } diff --git a/internal/service/dms/certificate.go b/internal/service/dms/certificate.go index 991a55439ef9..4aa60a8ade89 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 796aadbc4fba..c8b705c95d30 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 0b3d468cbd9f..bb324e08c9d9 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 3a8b580520b6..04018a105e36 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 f4dc516ba21f..1aed508d2879 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 210f7f0ccead..c9b5aee35db8 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 a1127c0e10ac..945f05fb3302 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 d5224187b678..d00b6f9d728d 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 b7088a2e7e43..9e011bc23ecd 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 5d1b9847a108..8b9e6a79d0e4 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 91a9fa585994..5a7344219a7d 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 ef3999c12169..0c107213bcb6 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 843910ed855b..b94a91e173eb 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 e7347031b0be..6a8c05e9c22e 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 97b430cf4b68..6a711381c702 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 diff --git a/internal/service/docdb/cluster.go b/internal/service/docdb/cluster.go index 0383ddc1ff11..3b5dbbd8067c 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 880539f2f4d5..e26612005bfe 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 b46a805fbb51..2c774a038b9c 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 2ad012700141..e8811c037c21 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 5c18b0672e7b..ba897a2b1e58 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 7c42f524a7a4..552d4023a9d8 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 9c175b1add15..bf5cae25c98a 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 eb0b03d4eab5..7ce188f07adc 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 cb0e2477e945..2e039ad03faa 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 6fefa1d9d0a1..65ba73f60c49 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 05fbec643a28..38aba3c6af45 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 293d532f5406..9f0a1129e2a6 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 379a21a64f7e..77d36fb390cb 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 9680266528b8..6c691d2c02d0 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 e4e65dcfca76..b9f2c9f9b443 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 } diff --git a/internal/service/docdbelastic/cluster.go b/internal/service/docdbelastic/cluster.go index 6a4f5f5a9262..b7dda433a396 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 11b3846abfee..0a70fb020973 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 } diff --git a/internal/service/drs/replication_configuration_template.go b/internal/service/drs/replication_configuration_template.go index 6a769c5cff9c..0ca48b25a4c6 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 2bfd647e3449..d6529176b3e9 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 { diff --git a/internal/service/ds/conditional_forwarder.go b/internal/service/ds/conditional_forwarder.go index e08411368b8d..3c3e16075b7b 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 baf56b96064d..76ff35a91d04 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 6a17273c1685..46a5802a728f 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 38beebfac26f..34900fb7d55b 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 b5c088a553f9..79b8e3325dd8 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 7034ca5cd9ef..437ef5d4a011 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 644d297772b1..34313448a20f 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 fd5b079520c7..1ea186ab7c48 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 236475d3e0f8..49ec2019be7b 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 01b7e3528116..adb446ee6016 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 448464035750..02e8e2ea9a6b 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 606a7e19dd7e..cebbc5e165cd 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 ecd6eb7dfcce..329e69a1a5b2 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 3d5179f96707..bf82b7c1442c 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 dbd5bf8e43a8..6e8ff9d5107e 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 } diff --git a/internal/service/dsql/cluster.go b/internal/service/dsql/cluster.go index 516d91476d30..2ea55b326e9a 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 3389b1d1e396..225b48973302 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 f7455ffc7458..ca8a54065c46 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 } diff --git a/internal/service/dynamodb/contributor_insights.go b/internal/service/dynamodb/contributor_insights.go index c8bd0abfe708..9408ad044976 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 831a28d1d007..352ac1345e0a 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 cf311055f897..d567237b04f7 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 92954a5a5a40..eee57a09e9b0 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 4c662b75b5c7..9433ed6d9230 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 02c234d35a18..b4bc93ad756d 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 d1bee21250f1..0c0558eb7e16 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 c8be381c039f..2b522db74d8e 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 2a0fbd90f168..1da316a8279e 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 542cdc0a6064..35e493691e94 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 7295fccd9cc8..80d5cae7d1ed 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 80b3671903f5..877f05cdb8b2 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 4e0d23a2574e..003d92846588 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 a14bb59cffef..280e3bbbdb99 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 52a477ae4deb..84dad5f46079 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 9c1c50609a07..3f2fe9e0609f 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 9d509056da99..bcbe73cee59b 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 9dde766bdb9b..ca6d4dcf8adf 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 2285eda2d8fe..86fc7be26ba5 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 16cc83dadf4f..3f554033aa0c 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 } diff --git a/internal/service/ec2/ebs_fast_snapshot_restore.go b/internal/service/ec2/ebs_fast_snapshot_restore.go index 4e96301a6273..37d59ff54bfd 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 7ef4c892dd89..3a29ac6d18b9 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 09d6ae27148a..601d22052a0f 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 6269c140cc4c..3761c111150d 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 2dbcd9090e8b..11f4b824b500 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 ea5e63331d5e..432865bcc441 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 c359fa8a03ea..da0a2969071c 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 ed3bc026f983..f0609aed650e 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 9e456432d843..0e9c5ad90005 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 0e497c3296ec..cd3471bfcd5b 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 76988e0f2989..0a094715c220 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 eda41506c2f9..5dc77e24b155 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 b6c95db82447..939542d1a14d 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 c77b32b0a352..3e86fc02fe08 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 e742c0b52ebd..f433b4eec2b3 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 4704b5f1e5f3..c650d422d559 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 fec353f98ff2..6a1136800d36 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 171e200ebd0a..5132a1975304 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 9e6298966f8a..0db11f4876d2 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 02ce772d5041..4c3ebb476738 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 b5b19b0f4c6b..ce73bb7d1338 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 8dbfdcde180a..3dbe2de35868 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 b5b3b5d08cdb..bbe428dfe7de 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 7e9d9ed50696..84c36450ab89 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 5d72e075d826..92a4a3d6b36e 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 dedf9d151851..7ef5da0ecc0b 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 e3924bf22982..fce7a0cc24f5 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 c4643e812723..81191adea987 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 735f1bc6c32e..2d06fbd334b1 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 a4810767952d..a8e852e104ce 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 e5a3f31479a3..e34eb5be8360 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 cbd059872187..748bc96e8be5 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 a9445d0cb4c8..c078faf8299f 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 6ca54b7b12a6..e9b558bd352a 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 0d9c6cd0b1b5..d5d14a7eb47d 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 109f198ba9b4..02b15ebf4cda 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 8347f4ee2b1c..1c9a53d924c8 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 311648d42e06..34a127095835 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 92b4059066f7..9d18d9f31d33 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 8a352776ea12..b03d36b0534e 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 63370f54150b..2509b0cf4dd0 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 b376dbac5bff..523d8b3cf53e 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 ed43eb216929..fcc7473f4d2f 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 e90787efed99..e3004b4c11a1 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 2b9928c705c3..695dae309cd4 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 9aaba95d27ec..c6b76e808a40 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 b2762e1c2453..a9ffd81901f5 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 8895ba94b98f..bc8ef63cba68 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 6dde3c6e464b..211f8312d43f 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 88f8da4f8b99..9c7d14911596 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 9519d9fdbe67..9d6ba84b33b2 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 fa157f32ee65..0240424b55aa 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 b7d9e1875c2a..83f2230f959e 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 9048a6c9d03d..d8dfddc32113 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 927163038190..7a84aa476262 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 7d7bb84fc61a..62ac03a0a307 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 68c9214242a0..ba5f273dacdc 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 016b5d705432..fc6521cd75a5 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 bc02932e4263..aa86a4db2d37 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 379e83ed60bf..d1da840beccc 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 0c86ef009943..b1336c02daaf 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 0a761d5d81fb..dc44c702ab67 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 3e07d4e97024..8e7637d29560 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 9bf281c828b5..f85e8949fa6d 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 70bf37981277..2033512d2bb6 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 1be9098af2cf..3c07c0ccbae5 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 63057c2ef831..93eca36b79e5 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 1b6fd44e48e3..95698fe0b356 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 a0605e688a7f..0298498069d3 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 caa661ab51eb..ed0e0f213887 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 0f5f4d2f6817..5cf6c88fbe06 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 2e8421c8a1e9..ed83e3f30ba4 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 3776380b6d80..9ec8864a0a88 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 4f9f4e129634..cfe94d5ed956 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 89396d327056..4f1ab2a43d18 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 103276e8259e..c8ef7c8039d9 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 44eb3a50302a..21627ea863fc 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 ba6598932594..bc4d231af8cf 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 c3c6846d8a5d..3e749b933ad5 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 561a7f826e00..24c114b39f24 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 8973af086e9e..ccadda155510 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 3ceacb773405..317ce449d2c9 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 b10dbca92a23..0d975ce7cdb4 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 01745b561aea..7f6ab9684cd8 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 e5f0243eb089..b670581cb706 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 206e856beec0..b3333fb2641b 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 b9eaa3524660..8b359acd7c43 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 c0d306c0d545..7eb78d06338c 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 6eb706e5cd18..0209d13e6dda 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 252c0160466c..a1fdd8734b59 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 9127862709ff..bf30a2c7306d 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 4da71edad6c9..953f258fa23d 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 fa04407bf59c..f9bcaa6e10cf 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 544d582f4eeb..86df63170a2f 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 8d54cfb68768..f6713870cd97 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 742315607124..e23d96cc4023 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 25a5cb859a4e..06f15f998716 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 83069c4c2c78..edc2e0947b00 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 c7eeffae1bea..5c7b46b8d7a1 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 6c8d9c8e49cc..63a3dcf6d8c3 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 a170b3d53109..03949e2a6acb 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 0a93eabd8487..94cf9543c8ab 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 738cf2e00608..7db44f497800 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 e12732025b81..a266bd484b91 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 f07fdf714b5e..5a57c13193dc 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 5fc732f42c46..cbe4a00b4dad 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 58d36dce4ba7..259f578eb461 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 d486aae4117a..5b233e31ed8a 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 e297ab1f789a..11b5f5eff463 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 d92b905c7657..0bdffb4a72f5 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 3eadd9f2646a..e81180a61be8 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 7779b0a7f274..13cfa0e06b5f 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 cfc1892af718..59e3ad84bb0d 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 893ffec911f5..b61ad67df1c7 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 46925238d7d1..560480a77bca 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 2796fd7dafb3..3d56abd8f5f6 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 202b372404ac..5bed9ab844c3 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 917c3389d36a..1f8137ba55aa 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 27c57b2d45a7..19d4f8950db5 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 28cb7fd3c07c..8b4443a88f19 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 696457271ee4..e88289e0d96a 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 3683c7238e04..58cff9685253 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 18f0b893a286..cc658aa3202e 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 29a5221b1099..343e64b31474 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 db1e16538f61..516d660cad5a 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 bdca2e7c481e..e08e0d21a9d1 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 e960ad203670..f40a8ae60be9 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 2c2076a8d80a..5ee289072ee0 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 fe14bb1a9384..8fa8dec89332 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 8cb51045ed20..75a151a7d15a 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 c6cbcd4eac53..ec2d1bbb595e 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 11a1e1656c91..66758e0081f7 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 f7561294eca3..9d1c244f24f0 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 f1b4d73cd09b..09f36826e3d0 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 c2995cff4bc3..a5fe0243acab 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 f40d123d2572..f3f6b25123fe 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 cacd612fb531..5e0194062733 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 ef943d87ca47..f487d846dfd1 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 e6f45cfb6fae..d405b661ad54 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 6c476c7afacd..317af57cdc93 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 62be61c15093..2a9ef164e066 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 41270434ebe8..ff47e8112e4c 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 7d41e956b220..8d963b16b121 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 2ae4c2a044c7..1a49d9ae0ba3 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 0774ec7047dc..56ddfa812da3 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 384a2a05e378..e4ed39aaa0d5 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 0a1ec87b79c4..356da8d2161e 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 ba7d5a0eaac8..f0e1736db126 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 b92b333d15e0..0d1ac170626b 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 a9a8aa848806..ec999b92870d 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 f78670dc92ca..d768fa48e1a7 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 5bed7b3e516e..3e8e3b562489 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 50b7027bef34..d34e4bb58d6a 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 9a461fe779b5..ec62d9f28fab 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 73524969ef04..d3db5dea5051 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 1883fa77000d..3dfe6b52dc69 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 ad2b5bc479ce..e1ab44d4a0b6 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 0282231fa63e..9717ba5364ba 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 a77e71734658..fe6de3b94d99 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 938b68917b5c..bb1bed70db5a 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 8dda6d9e3c32..9ed8fc217f40 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 cc692aac4b58..8251d4e767a1 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 32ac5b6dce82..6d6bf8d849fc 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 2eaea1bd57d7..c8e3bed93f44 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 16777f4ffe88..b95ef50e1955 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 524966872049..943ab2a9613d 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 6c639fd5464b..be635365d1a3 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 9d24f7de25a0..c21f6b0a95e3 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 7ce8e52d5350..e93f3eab4422 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 bebd2b5a71fd..455c632e13c6 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 d22a26cb019d..dbe0ae69a957 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 3d5b1d60938e..f37761ef8944 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 9c0d24a2f6a9..81f62b9b11ca 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 0fbec311b375..30dc6e842181 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 99560a11decd..e3cdc57c1b77 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 3670773639dc..ed6187526a05 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 20b387018798..1f456051649f 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 e4f2f126f571..94a20c34eab6 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 6119ad9464cd..98d1cd2376bd 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 7ae72f0eff60..19aa90c46758 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 a16f8187fec4..d3907955875c 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 4c59f0b906a0..6a95b347f835 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 4122ab09eded..4ac2a9be64a6 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 003dbc3690ff..680ea9973e23 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 0976af3a04e6..f436f5d0ac43 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 a24a046f2b38..004b13cb4907 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 77762c18fbaf..34f198ede6ea 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 ea6ff5a64980..691146da1087 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 9349132b0399..43406dab29bd 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 63b9561e418c..113d67f6cd59 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 31631d96b892..bf4fb2f99f83 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 0a91573d0942..dd2f5b1adbd4 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 4fb99dee543f..372085f1da42 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 baa75ca613ff..d599b23338c1 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 d095011b8702..6d4975baec96 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 95938b4f2b66..f1cc0156a203 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 d0f6aa5b9127..ee348bc37349 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 48b48e53e553..f5145582feb4 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 bf753beb78b1..14bff371071f 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 44a0877d4678..9719afbf714e 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 029719b7d2a9..862ee2be6620 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 75eb6a506659..f5933adff401 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 4e64bda0d279..b12d076d6975 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 80bc66660632..c9f9b3043d9d 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 627095562e79..250090323578 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 ffa000ff7b90..29ebd823fec0 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 b4dbb25773a0..8ba0a8571488 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 b6fd250617eb..c9fa37497655 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 a0bc4ee4b64d..ceb9e9078a2c 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 f58d3e6a1d58..244f226e3937 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 653105444019..462c3a8602e5 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 ee936fb9331f..e6bfdebc4957 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 f6f6b7380e9b..8a8fbc985bd5 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 b0b4712abb17..e1707c947d39 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 4ce12ea18035..f0c306ae0502 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 87de94529aaf..53933a6c08c3 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 f8bd6902db6e..c7ebdc0fbdcd 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 a07756b44883..d17cdec448a1 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 8bd99fedd2ad..7ce2dd34a9bd 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 b335b96d4476..de46b96fa2b5 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 b7b90cdc528a..7ec45e7f34a4 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 9832f31ab1f1..696f126ae719 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 f9bb9385138b..a90572ed585d 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 aa198b19cf62..ea8c3fb3077f 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 cf36fb337cc6..5bbaafc17e0e 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 1895aa1541cc..61aa134d3c53 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 e68c11516062..2ac1d291104f 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 068099df1a3d..95cd9674579f 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 84d26d29b1fb..17a64d968c3d 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 68b92d5b18dd..3dc6b9533521 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 5a52cb74b1b5..e0a000068139 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 7f699c8337a8..909f94f50a69 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 f900dd2910fd..fb7734b22580 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 ab96d2ed4dd4..986b15a1259c 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 530df2607896..831910d80570 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 ed6f3baae7ae..7201b7fb38a8 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 63dd48d17da1..22ffcc49fc2c 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 0373400d425a..dfbb6f4e5103 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 c478603d58b7..f5648413a5df 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 5262adcaa0ae..9bc9703aa064 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 af2c5b904b61..ff0209d835bd 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 679f48f35945..291307984cca 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 4002344b4ff6..38ecced07c78 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 215841606716..25fdf3709755 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 0474e88c0f3c..a309542bf923 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 e9065f24010b..dc20cb8d3cc1 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 4d2b808a57e9..69f3db15733a 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 0ece6149ee82..94f0294095b5 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 edea9699d330..7468bac0f9b7 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 7e705530fe95..1c2c03d8228a 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 8975eba0a8d9..075981c3b245 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 110b3c99e9e2..567e9c9a4a12 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 5ed08bfbf34e..13573b3eb7e2 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 259dbc334363..3efe6b2dbbae 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 5a3512418330..79050001ea41 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 3a06aca9f0c0..9b0908988c9f 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 b4865ac2416e..ed3909ace075 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 904095f6e788..ef56b10e4cf9 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 cff9522b4f94..e39722744b24 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 c492c709850e..89b69bbe369f 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 8ae365199952..c5e528401bea 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 fe33a7897aa1..ba7460f634bf 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 e248b6d5366f..1d4ae22ef7b3 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 } diff --git a/internal/service/ecr/account_setting.go b/internal/service/ecr/account_setting.go index 7547aa26324b..6cd81e6ed461 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 9dd39dec73ce..d0c94ab10974 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 edfa4addf3c7..bc2dedf2c3aa 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 065b46405afa..b3e66aeb0fcb 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 a231705b2b46..4beb5ddcae6e 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 e1191752ec61..3b79c79d7c09 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 939e6c52578c..b6fc2c099558 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 b216673a57d0..4691642dde44 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 c7e971e633c0..f3b261197409 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 de438de93ed3..079f07c4d49f 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 b42782e20cb7..6910a14e4afe 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 cbbc530268d9..cf6119e6eb8a 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 bfb633d49edf..b5e388024586 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 57f984e6c73d..e41929080efb 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 7773e775196b..9646f898b913 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 39ad38995831..74e11bbea387 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 } diff --git a/internal/service/ecrpublic/repository_policy.go b/internal/service/ecrpublic/repository_policy.go index df2103e50808..9d87c5edc13d 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 baab9e98f7c1..6bde3e321348 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 } diff --git a/internal/service/ecs/account_setting_default.go b/internal/service/ecs/account_setting_default.go index 1e852bd4a7cc..ecc272849489 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 72c620ce0031..486990c5f9c4 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 59f24fa0ce7b..3c080200430f 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 2cd78ddf8813..2d42818b0964 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 2fe26bd9b869..c359f7d46487 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 c2fec8cac0b7..468e1a6825c8 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 d7b0c47d5263..3a85ee2c06f4 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 524802a15dba..6391ba815d52 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 a70eb5301ab2..1e8295aa4182 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 d2e35449cc1d..097dc16944fc 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 3e02b6e41be5..1898f308d6d5 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 e082dbbb3a3d..c1a588f3e5ce 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 62e2117f124f..b626776d62a3 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 48a119b58555..a97bd7795398 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 9447fee9d319..7c1ef2e3b68c 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 4d9e9f9fb8bc..dcd4876bb6b6 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 8086c9d43d3c..e6d7ee9d6ae7 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 } diff --git a/internal/service/efs/access_point.go b/internal/service/efs/access_point.go index e9d1b67be8ca..bc10958e5f37 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 4377bc59e911..04e454ee722c 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 4d9524e50c52..a6ba34bed5eb 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 d0a42d5f1674..ea93d55e8e35 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 2ed0cdaf6ba3..d2ff688c9f90 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 c5cbd173b6ca..0b0f0a3852d0 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 37f452b8fbbb..257a21199273 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 947ab8592adc..369dd0024027 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 45498e65fc58..60978c94b134 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 4e2e63adfaf3..a0e36e387138 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 b8da107e35da..81fe48e9c9e0 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 fb36b1db673c..b7cf8919c77d 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 } diff --git a/internal/service/eks/access_entry.go b/internal/service/eks/access_entry.go index 05c621faddd8..3ce76bd70e05 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 db192c6cb463..7b217162e272 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 fc4dd6a325db..d897450800c1 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 732986a8e261..0fbaf8e508a1 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 537e1731ba76..c3ac9021fceb 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 a32f838936b9..410b49f3218d 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 54843c4d9967..8715d740011c 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 f0c30b91afc4..58b81f2516c1 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 8502d3b54dd1..2895f7ba4c56 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 046b93b1e62b..41bb63ab78e3 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 1559bf287e7e..99cc266c4892 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 58fefa62a910..607cdf5cda3a 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 344ed0db2d9d..a5206654307f 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 6cb7424b9318..a4bd229f3058 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 845a0630b8b4..14fd3d748db5 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 0f4803fb6127..b5780b40c0af 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 } diff --git a/internal/service/elasticache/cluster.go b/internal/service/elasticache/cluster.go index dfcc1227337a..caf5d8270cf1 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 diff --git a/internal/service/elasticbeanstalk/application.go b/internal/service/elasticbeanstalk/application.go index 35fac41f3a20..0370e098a11b 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 48a929fd6dea..46d17a0448c0 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 d25d9a93870c..0d8989e3ecad 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 1961677a8294..26e6fc721f1b 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 38d5493d9a87..46f0ce6fb9c0 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 c5147fe795f8..67f03ce7dba8 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 797296c2ee7d..3adafda95482 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 200a3cce8a90..d7a73e30a91f 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 } diff --git a/internal/service/elasticsearch/domain.go b/internal/service/elasticsearch/domain.go index 1737c6f335f2..e5cba666e81b 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 2081c0cfb7ca..85dc67081b44 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 f81c07666e60..07c42a67e3e2 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 947744cab401..4eab4081285a 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 0a6575faffb1..6b70f6e58a4a 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 5eca0955b15c..2b8cff8ecc78 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 19b7ce4dcaeb..9fc573909e27 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 } diff --git a/internal/service/elb/app_cookie_stickiness_policy.go b/internal/service/elb/app_cookie_stickiness_policy.go index 3d3c00ab4335..a178f2d0ecc5 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 75fc6ad82d31..64ecd6031ca3 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 635ef5792709..16fcbdcffbef 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 a547293c9624..dbb0c4bfacf5 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 4fbedf5aafa4..570911c6baa9 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 1540eb4795a7..5b17e4bae3bf 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 4221f4b01044..f724c4673331 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 c334b1a6010d..866ee5c68ff4 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 75031c647dc2..35c034403fa7 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 6c493e78f68f..fb9d22955336 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 c5bbe1c977c2..e605017c3316 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 47fce72b3057..a381a26c4ae9 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 eb978b43f3d1..a99d3d8e8974 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 15ef0b159b79..d8d5d4b6277d 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 88af969121aa..107265bd7aaf 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 7fb3d63c612e..f355bced97b8 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 31c1759d3380..8afb60b6cf0f 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 } diff --git a/internal/service/elbv2/listener.go b/internal/service/elbv2/listener.go index 14dec4d4eb49..d269d512d3fa 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 afbe96ab2cfb..6560ee7bfcd7 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 398726ca5032..870f22cf403d 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 85884a981eb7..4a12a645b3fb 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 cf5e3b966a77..37c3c2f97ab8 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 0620b2f9dc37..cde9469313e5 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 47586109ffea..412009b5aed6 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 87fffa462386..fbfa81e53af9 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 a56b49fb8907..ddab070c6a2c 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 799e22fed67f..882eb6bccbef 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 1251d5f99877..22aa75395b60 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 893a5baec2dc..d305fb73d98e 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 5696341ca918..78552b3d68b2 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 d3bc6e033195..14830fb20d47 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 ef83b712297e..175f98b58298 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 634304f7b6ba..06afb976be95 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 } diff --git a/internal/service/emr/block_public_access_configuration.go b/internal/service/emr/block_public_access_configuration.go index c46af637ceba..9dc571738c75 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 54c5741a5937..64813e6fe95d 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 d3c37c879150..e4248226a5e1 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 7644176ac07c..e90ae021d6cf 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 8adc52530f7a..3139a18294dc 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 e3cc074567a4..b1e9e370d9b2 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 4c41024fa86f..8092156350d8 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 40a746bce523..8d5012fae975 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 e327fcf59b0d..4e0796d9065f 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 d1b154c43dff..614ab07ab7e8 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 661eea2b6ccb..954c46501725 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 4612fdb9cb94..0caf333e99d7 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 9a9ddaa9b50d..7514af82a5d2 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 d269979cf1e7..241f1c5ba3f7 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 } diff --git a/internal/service/emrcontainers/job_template.go b/internal/service/emrcontainers/job_template.go index cbae35ee68c5..136db13c2c98 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 14f46393aea1..6cd63313f680 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 9a2138eff271..9986179eb56f 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 cfef66521643..25eaac51eba4 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 } diff --git a/internal/service/emrserverless/application.go b/internal/service/emrserverless/application.go index 687427d04f6b..b9483c1e6934 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 } diff --git a/internal/service/events/api_destination.go b/internal/service/events/api_destination.go index a20e8a07c807..2c159ac02745 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 c4b0e4df177c..b8c08902433f 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 1899a953d393..345178e96a52 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 6a75b695951d..db4a354b401c 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 be478f146af9..67698ec172fa 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 b5b12694e050..66a197e432cb 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 1e61ce812ca4..cd839c1cffc7 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 6f292a137483..d1de7abefbd7 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 5dfd8b9dde12..3fe60c0c1bbc 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 d7551189942f..0ad094c62d76 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 d9add2decf66..caa5d14c7f3b 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 1f0f000514cd..665e5e4e407d 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 4859c4235a70..8ef98ccebe0e 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 a4a585f6cb21..cb27d1ab620a 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 01a6cc07d024..b25e88800e33 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 86449d2dc6e0..ed061dedfb0d 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 bbc053af87a3..f00402ea5933 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 a9178d71157a..276760616401 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 } diff --git a/internal/service/evidently/feature.go b/internal/service/evidently/feature.go index 959995d7542c..a87a0ab37c2f 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 395d4842f0f1..bec0e9743b76 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 24cdfd828feb..a064898fe5b9 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 dc993ade7507..c694c83c0b20 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 f7e848ed8238..4ed9f3e81651 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 05421c2d8428..ee294843cfcd 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 8c5d9a763ea1..3533d85aa34b 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 2cce5befb673..e87646cde024 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 7ecd63401f6a..d1430cd325ea 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 } diff --git a/internal/service/finspace/kx_cluster.go b/internal/service/finspace/kx_cluster.go index 9401f9dfba4d..28eb22ed59b0 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 b4023a1e6a6a..8dc61dc026af 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 319ec4a22a79..0cf2db514872 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 c25340b1da46..355b71c49335 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 39e2ac71a61e..439eab635277 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 07b4c68b7727..3cfb579f3912 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 dee4cc875a26..9e419c2783cf 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 } diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index b71667df69c1..27b8329f4561 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 f880078bd0cd..88358d8f9476 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 } diff --git a/internal/service/fis/experiment_template.go b/internal/service/fis/experiment_template.go index 1fa70a8c7adf..ab7a49a93046 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 9c015ad7ab87..027717fd551a 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 5459073aca37..c72c724f6362 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 cc4a670d21d1..ccea02761461 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 { diff --git a/internal/service/fms/admin_account.go b/internal/service/fms/admin_account.go index 49b4498530e8..ef2e70e1c914 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 bd8736857466..c0231a78e7ba 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 76552c7f70cb..b0933e0988b2 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 d99c79fab3c6..860860ac300e 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 752515d2c5fd..9035d16f9fc2 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 } diff --git a/internal/service/fsx/backup.go b/internal/service/fsx/backup.go index 7ca406281f25..ed225a83ef18 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 b4020c35a89c..30ab0ee3fe5b 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 e5def835d73c..51cd77d6363e 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 1e3180b6bf6a..ac19efad687a 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 3bdc510b2e04..7674d96713e7 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 7d568e0d85cb..8aea9305a968 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 7c7037c69121..4133123ea82e 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 b12f869ee025..c544915be5f8 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 03dbc602a675..409777fdedcf 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 020d412490ff..0a064050ede7 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 4acc01c4871d..f53398165f26 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 6543e5329a9a..a71c996a2add 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 8a3dd3555dd5..758f49c1617b 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 3811b77783dc..5c72e081cd12 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 e875e3f394e4..1a85370cc998 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 70b345a841c1..460e9f337b55 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 f9ea0281b9d3..6c5dadc6862f 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 1e214cbbf9f5..c0b9bc2851a8 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 6dc7cbc9c363..9ed87637e740 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 77f59f72b180..ff12e467fefb 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 e7284524104a..53d941efcfee 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 9b60aa248328..a64779c0ee2a 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 fc21e5956724..7a6a463a1b7b 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 b9d94daae296..67d4808faaa2 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 } diff --git a/internal/service/gamelift/alias.go b/internal/service/gamelift/alias.go index 0859116a6837..4555a5411f62 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 01db8f997096..92cf5a0ea4b8 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 8a3ee718aff5..938cd19dca0a 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 801c6361e38a..d1f8a73f4cbe 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 4dda1bc5b59f..7a2ac9ea6825 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 c9a1cb402ff4..4abfc3c876c1 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 0bd023084454..ca0412486125 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 aeea9c8f601a..06646d5bdf44 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 5563f9ad7429..fee0990deb8b 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 19ca51115325..214a2794bfce 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 a16df67598da..60d5cdbaaa39 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 696182c9fb2e..d1cae83bc80b 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 } diff --git a/internal/service/glacier/vault.go b/internal/service/glacier/vault.go index 8f42e5322f8f..819d742b5929 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 9d62db14aac7..7f10aa4d78f2 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 3346ba326906..ac98539ae058 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 6f4d8bfd93c1..6ce8ba805dd7 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 } diff --git a/internal/service/globalaccelerator/accelerator.go b/internal/service/globalaccelerator/accelerator.go index 8520dd05bc0a..bdd9f305a6d1 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 615a028be97b..fecc1406b4e8 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 561be7b3674a..a7c5a7afec3d 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 d8260910c22d..43de9a2369d9 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 ddd5d664cbf0..b0bf884d5b7b 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 f7d009d6b51a..62127d7e8e3b 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 78c59a137acf..f38f5c26899e 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 136bd5796776..207f6311ca07 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 559778af91e3..70c7f930de74 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 6fd17e8b35b2..2e7fed5266f7 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 bf4227f29ea9..ece761559ea8 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 8a6299e7776c..68fb266c254f 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 87af367ee08d..11e2403eae40 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 8cbebc2cd68f..8929c5ba5307 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 } diff --git a/internal/service/glue/catalog_database.go b/internal/service/glue/catalog_database.go index 1134db2cd9d2..a3930cc155b3 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 4675f0fd1d9c..90a5232a4b9c 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 93823b0544f1..b37b84c4de2e 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 cdc84487d572..6f268252c7c3 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 a455a07c1c88..57d646bedb86 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 c461c07e35c6..4285e647d0a4 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 ad2cdc9c53d8..aec70732a0c1 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 1cf713332b1d..3bfdedeeda1f 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 4dabe9ddbd22..70b2e891ad06 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 019c6fef1708..a623e6efdee7 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 983f78ffa210..b653d129d29d 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 0cce96b322e8..a4fda5a95f57 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 67b370d889ae..1cdfa3226963 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 8482a474b4ce..03f2b2bf1c28 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 530abb9d8617..752eecf5a156 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 3086f1553e86..e94ae1fae756 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 8f10637fb4a2..36346d198d7c 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 0a95d040bf95..e1668d66d5ef 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 91077ced8b98..c81fb00dd7b3 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 08dc904bf44d..26689eec4bbc 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 e14fa596eaa2..1a0ba65384ad 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 3076c4fee56d..3649b43c2280 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 f4b86fc092d8..a0fc465e8687 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 dddbce03041b..2247f3b3d552 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 } diff --git a/internal/service/grafana/license_association.go b/internal/service/grafana/license_association.go index 8adc8b25b3de..b519560e035a 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 7799c23b860e..fb2523659eff 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 0dfa6cfd6c74..723430bd10d1 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 553473503f69..80885f5ddb12 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 feab023cb0b5..1a2cf3d18682 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 00eca790ef4e..c8f66f57fe93 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 e92227de038b..19e5721cedff 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 2f1a9512927a..17f8671daa7b 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 5c0a9a102311..ede0b280f69e 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 131386ad7645..67eaad7ddc3e 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 8b080adcf996..2884de207953 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 } diff --git a/internal/service/guardduty/detector.go b/internal/service/guardduty/detector.go index 17eb8fdb4d90..4b98575f0499 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 80614440b7bc..150217b9a299 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 d2eca8f16451..ef2df2787719 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 f59ddc536f82..4eba02fe07fd 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 35230e7040ec..703bbe07fbd3 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 d2d73e5495a4..5a3b94041e72 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 385d4ba39a1a..e6398c74e372 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 f96960bcda74..b2e5a9a9b9f9 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 9051ba029baa..621a5981199a 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 d35a62fcae68..6e53771932be 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 diff --git a/internal/service/iam/access_key.go b/internal/service/iam/access_key.go index fc87b55f2a3b..7091ec070201 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 c62fae40d8cf..983daffccb5c 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 1b0402259a20..c8890a6f1b3c 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 62a081bb8720..c370dedba145 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 c51afc1297b0..bc7ebc084632 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 7d7eb7928486..148621b7805e 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 cdc01d32cd9c..f12915661933 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 0dcd88296f5a..117e535d54d5 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 0fc61c3a904b..f862e22051a9 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 2097b5dab661..86a97cedd76a 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 85e37175b420..1707717e0196 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 26b05be8cf2e..3449cf23aa04 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 8f62d53f7a7b..2a7f49bafa23 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 7a7f4dcc5592..fdb44b391ca9 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 00ef97d2e50b..eb1a7b51dc4e 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 27e0c9ddc579..2722c02542b4 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 624d7dfae267..bfd193ae7869 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 faec1cc3aa1e..d7db3849c6c1 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 99763ecbb3ee..727065a9c238 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 38088d23dc1a..18b75195f00a 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 9124470ea119..5a3142563f40 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 77b92dc7ddfc..7b234716a4ef 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 43f054b2f1a8..f47d1d2ff132 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 d5671e3d14e5..70f8313ffe9f 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 9a7e8d44919f..332f4ac327b8 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 21243ffa6e02..130891c7eb64 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 f042d21d704f..9401508d043e 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 bb65aaffbeb4..8b56581d9f0b 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 e99ca6a3276b..5275891fd0db 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 d67f4541d94c..d44c82fdded6 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 45e0f31bd3e6..acf8aa5ebafd 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 b5c4b830ad7b..6e70484fdefd 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 869b82c62853..81c16e7a588d 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 f7e3eca4ff1e..0f8d98f04fe2 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 c69f4f7c4b98..6fc1ec2cf6bc 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 9adb4414b516..a319a27b291a 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 46c5961a1711..af8948386607 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 76ba8e86e908..43ab7ccb9164 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 9d1d21eb61ea..c06755b208d2 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 42c476db1d6f..ddc7c41e3923 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 e343c8b06e05..95d246c615f1 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 1090294d78f7..4d5baf890b68 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 a1b0d6fd3e6b..6ccc23c66f93 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 6ce14d2b4eb7..651f6abc5012 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 52f5384fba4b..fb1505a96079 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 9b7826f69748..53962721c363 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 8bb8d00e6622..428ea30ebf83 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 f38462af42e9..dc08e2958f51 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 6b345814d9a3..7bfa9009250b 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 26ef64f77126..0af85dae66d2 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 2b335d1d3502..e67fa526a6cc 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 17a5ed5c9463..7d443d9f6f94 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 8bcd410949b3..178a717f6aa6 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 9b83c0fec23d..8c35355ed02f 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 ee0e3111b578..ea01646b8c20 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 } diff --git a/internal/service/identitystore/group.go b/internal/service/identitystore/group.go index 02071b88200e..4e73c66a52b0 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 979789b5aa11..729fad8378e0 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 06e5840e4fa2..df60e27c3ebe 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 5faf9223b185..7c4e3b5bd224 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 e9933523c9be..81e40fdf0189 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 01a203dde4c7..dff2f564318f 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 } diff --git a/internal/service/imagebuilder/component.go b/internal/service/imagebuilder/component.go index 79c716cb47ae..e2fbf14d206b 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 3079773d1428..655d78d0a7c4 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 85720b49ab6b..987e098a49fd 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 4ffd2b3df4d9..df8a6d04b1c7 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 09c83b009e40..815604cdccab 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 136c3a2c267f..89cccf0adbff 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 5e5b17755bea..8bbf62ece1ce 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 2445b2c5ac96..ee15af32f923 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 420dd018f7b5..13a4b265c22c 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 911d57a68c69..be51a9ea257d 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 1820ed2103ac..28588641ab52 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 6a3430b2f12a..60b9c31410f6 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 fa59a3a1deb7..88f796ed2e3b 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 b3f235bfc23e..40ac6b376611 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 26b74b6605d7..5235041e4415 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 f31c54b2c79f..d83d79412223 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 160b44188f9c..9d98d7f25e16 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 018542b16213..41f0cf934d34 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 } diff --git a/internal/service/inspector2/delegated_admin_account.go b/internal/service/inspector2/delegated_admin_account.go index a59f7db31818..3d90c83fab7d 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 1764d9bf93db..9013c058ff28 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 f81fcca4ba1d..171574796e4a 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 3a8146963501..b5a19c509ebf 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 14bb99457817..cc6ad45abeed 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 4d1552c57c69..a5fda3c03f61 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 198f5d0ca701..d314feedd7dc 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 6eaafd756c1c..1ffc1ed46523 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 b06fdfd042bf..e7209222362a 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 29fbb58e5382..4eb823673eac 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 } diff --git a/internal/service/internetmonitor/monitor.go b/internal/service/internetmonitor/monitor.go index 7985de91c0c5..4e9792771664 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 } diff --git a/internal/service/iot/authorizer.go b/internal/service/iot/authorizer.go index 005d98adb9e6..cc9c82f83e11 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 bbc28076a034..e984231f157e 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 3e8775fe3cfa..4be57621dcf1 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 83ddcb57562b..0e34601a381c 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 de8aa41518a2..f69ec22e5553 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 fd496e9a1247..cc730d0f7e45 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 68115cc5590f..6fa62a45c371 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 b33dd91a3432..61d00222a4df 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 0042503366d1..a35d024b0687 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 b0e4937c0968..d14ca16f482d 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 059015fd1cfd..e3710c8092d2 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 03cdf6082009..cfc62ac2e530 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 e1ccdbf84e08..1b5e90af607e 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 6ae5dd40657e..5d89d5258b93 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 b8a0651cf8b0..a6a77949a0a1 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 e14acf6e7a7d..0543747ecf8c 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 cf1d26e0cf4c..a3f8764c4a13 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 9a5d94437330..22094d061586 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 958883779d54..20ba1f81f54c 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 65c86e0a3b90..b53cb5ae430b 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 37ecfe5bf7bd..6acd8fe9e00f 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 653d7cf4905e..45af7743db53 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 5fc7d6b02830..22e119484922 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 262b3204662c..fd8767526321 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 14cfe893826c..eadc81b6eb7d 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 45632a98df3f..a4333324b9a2 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 532d73769ef3..9ef36734d0af 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 d8126190df3d..b4a6b4b3ac63 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 913a2b1d7dd0..c02fa3bc29da 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 d14d36f52c91..102eed853672 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 de1e53c9c652..f9f5024d4b17 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 2212d74baa4d..17544e3e2a91 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 4952f73ef9e5..03183857a20f 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 } diff --git a/internal/service/ivs/channel.go b/internal/service/ivs/channel.go index 57cd7067129d..9fe59d75d423 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 2188e6fae3e6..00b60f38dce4 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 264d8d7386a0..c4d521f01490 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 8489643bfe8e..10f102793288 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 } diff --git a/internal/service/ivschat/logging_configuration.go b/internal/service/ivschat/logging_configuration.go index 3bc150229764..b20e2e490d56 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 1e868752f14f..3ec752335fb6 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 3b3c80c5b083..d3c242430e0e 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 } diff --git a/internal/service/kafka/cluster.go b/internal/service/kafka/cluster.go index baeccbaef9b5..1986f94d14cd 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 bb46c8de5ab7..a8a8f8705de0 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 67eb6aa58c6f..e7dde3dd5ce0 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 e91b051829f8..f053e87423df 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 a0ff9e9b2635..2c405d8b5e32 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 28e42bb7105d..a2a45c7296c5 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 7394fdb04ba7..da3162f23c6c 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 cf30443ce8d5..fa6e69ff677f 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 ee66c4ea783a..6b29cd2c7fc4 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 0e842aecb27d..4c6686fbddbf 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 1aaf4c89f1fa..d6803a78e345 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 a0b11c4c7139..a44053b219a6 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 64bdd022b32c..ee2b94c4139e 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 dfe59d9bd841..3ff921d3f67d 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 debbef058bad..6617f60e2e19 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 a98a5de95f86..d00ceddc3f2d 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 } diff --git a/internal/service/kafkaconnect/connector.go b/internal/service/kafkaconnect/connector.go index d9fb7a85bc18..0d9558017ba7 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 5f4613c80504..4e49a52f23e4 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 06a0593350ae..be279352830d 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 7f3c7689f023..8a6d90ce560c 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 dad056b1a6f5..09d7e4c516b1 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 65b5d920c0fa..d52144551ce6 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 } diff --git a/internal/service/kendra/data_source.go b/internal/service/kendra/data_source.go index 81ffec641e58..6513bb0eb574 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 75eef5edda31..106e4e328a86 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 5f59a8057720..b5cd1c82b57e 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 99ad5a37cc43..9572ab72b10b 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 84c66bc224c2..bdbe956c61ba 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 34930d6ba7de..b5de9618aab2 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 95565ff669af..62cde330ba45 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 733f97231d71..dffcf5fdd5c7 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 12481ea23e21..821416cf7c6d 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 17928f9f6410..0e267e932793 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 9ef7c1559f83..1493df960cf6 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 } diff --git a/internal/service/keyspaces/keyspace.go b/internal/service/keyspaces/keyspace.go index decde13e948d..06e87f1f71fb 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 2248334f2032..36f0795d7831 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 31dc59633233..1bc352a71ff5 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 9b7ff8c11ad8..1a490abf883d 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 } diff --git a/internal/service/kinesis/resource_policy.go b/internal/service/kinesis/resource_policy.go index 38aa26c8975e..6ad921b21cfb 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 290363e4699a..5c4a54179413 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 0f33bfe221fa..ec6b1a589fde 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 6185a9750df8..1b300d3470ba 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 cf1612a3e6df..fd4d3a7c8b79 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 9aebb5a1dd2d..aec7829ae54f 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 } diff --git a/internal/service/kinesisanalytics/application.go b/internal/service/kinesisanalytics/application.go index f4d4562dcbd9..6ec5bed0e98c 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 80d91a5cb85e..5890c9896fe2 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 512ed5bcc8fb..c05d18d2898a 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 } diff --git a/internal/service/kinesisanalyticsv2/application.go b/internal/service/kinesisanalyticsv2/application.go index 6d7df349d66b..9dfcb6c5b380 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 2a558d755e49..52cf14cd0192 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 4971a01f63b9..5f72ed55bd46 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 75891927b731..a7e5d45c84f6 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 } diff --git a/internal/service/kinesisvideo/stream.go b/internal/service/kinesisvideo/stream.go index def3aa77ee71..ed7c44b96a67 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 } diff --git a/internal/service/kms/alias.go b/internal/service/kms/alias.go index 69bbd7138877..3d475c55eb4e 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 883cce237743..e30da3d0fdd1 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 42968d767be1..bc5ead0bb1b0 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 5aaafb114ef0..27860408de33 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 ebaf73b1c43f..cfa1c9d71554 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 d9746162dcb0..e8c064a47f24 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 9aa96d85da15..df231bbd41ff 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 21849e392790..d9e7eb1770c0 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 2e1be6c0e157..108845180c20 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 64b00ed17582..ac352b762a14 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 65755f40cd49..5c7d96766a40 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 c7184b7d941d..c24ba4086bcb 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 a061d46e8fe7..0ade416120e7 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 020de559bb3f..6fa72ec7d822 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 5ebfd05630ae..57b17be7659a 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 } diff --git a/internal/service/lakeformation/data_cells_filter.go b/internal/service/lakeformation/data_cells_filter.go index 0fb27617d2a9..4b08b94f3475 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 6120eb909eae..936a8b4cc9a9 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 8c04e75b3698..214537e36ebc 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 48bb3d1c84d8..ebba3bb5f1c7 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 550dcc34b117..420a9a1268ab 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 bb14b33b15e7..37d2f3663c57 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 } diff --git a/internal/service/lambda/alias.go b/internal/service/lambda/alias.go index 789dcdce1c0b..2ea5f812a2ed 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 8a04cad52d0a..30a5e0ad145b 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 3ffb786f010f..07178b718dab 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 25054b11d4ee..ad8865fe4888 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 4a1d801144ba..15bc64fc29fc 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 508f64373c1f..11cee5738612 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 803a0e995f42..d38ca7766f36 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 54d8024397cd..302ff2b43511 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 48bc6cfdf95c..3f706dd01c88 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 b47452b24c7c..b88e869bf4f1 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 1ceb3486ed19..7ed4fbf80596 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 b9db41928bcd..74e90204a149 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 8b6d7f13d0d5..8ded2cbc7502 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 ce7496d3f3e5..c51edd2fe807 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 34c417c7534d..4f0aab41a1ee 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 c90346a00217..992329aba443 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 8939d0289c91..be237d17c220 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 a70d8f581814..7932aa006d2a 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 e94af32e00d1..91efefd8babb 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 b0e8bac72b7b..a9028b551d12 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 738f760df0fa..bf5688e5a320 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 6184086afa40..9791270fe11c 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 } diff --git a/internal/service/lexmodels/bot.go b/internal/service/lexmodels/bot.go index 591333cc33d4..371931966a5e 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 66504dd44fe6..28c0d9f2a549 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 2b018c8876a8..275e900c3eef 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 0426d56eb244..762aa3ec0903 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 c57d3b06589a..c34dcf7164c5 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 } diff --git a/internal/service/lexv2models/bot.go b/internal/service/lexv2models/bot.go index e755ead85033..07909b284359 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 c9150563b8fd..865442cf91cc 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 b70853d5d0f8..d986927bd018 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 0535a7c4afd7..5414087ed503 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 9764c15a3cb8..72aebf7b4cfc 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 a8d1a2981548..e073784f7546 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 2726cc50dd66..cc86e6b37f4b 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 227f88180fb6..53f0f1d36860 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 afe53156a1a8..8875fa9d16f4 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 } diff --git a/internal/service/licensemanager/association.go b/internal/service/licensemanager/association.go index d279f7c0f434..ccfec0bca6b5 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 6d2249b90779..06af0e11a2ad 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 253af50d0383..30a7844a3caf 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 401e7c08f68f..17a5bab7835f 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 ff5773831e92..601655462f2f 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 e2284410c8a9..49631ad9aceb 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 d17f2e8812c7..c62c76c402ea 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 d14cc7f4f427..85f72a47609f 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 } diff --git a/internal/service/lightsail/bucket.go b/internal/service/lightsail/bucket.go index 7676f7dfe2f2..c45600ffb434 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 792af6a7d50e..2e465e261e62 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 934014140276..a75c8757308f 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 61d58aef2a80..f796cc31bc0c 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 2d660a3cea6e..8b3b178178ef 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 cca6f0f76c34..fd90b8ac4572 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 cc852ed939ae..0281629fa318 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 dda3e564ef6e..0feae96e6b08 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 3da4eb13b082..3487ff53716c 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 ecd34e3bcd56..f760e9005016 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 980c734dbb66..f82c28e53d15 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 c770ea8df992..49d5ef952d29 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 8a931ca6d313..631db0074ce8 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 0f7d356eb895..f533aaeab3e0 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 759c4e68f399..2c149c80375e 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 c557291f3e15..b5f793b83dc8 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 229b3c851e7d..9e649865abfa 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 58b5378ff50d..e00710a22d6a 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 fd95e4b33f62..ef8b82db3622 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 293dea265529..ce7f84feafe1 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 72b6c390adc7..7ab4c76b435a 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 398b72fb8f82..7b74de78c0aa 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 e657d816e8da..b10b9707d640 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 42dbf703b373..7bd2ecd507b7 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 b639530243a6..fca51d692fce 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 23b27bbdcb79..7bbbc5375699 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 eeaf88e56982..07fe63723ba3 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 140282ee2f19..405d00b58e95 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 82d9c6fbba7c..73756786ac43 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 dbcb3af8cf76..0ae07cddcd78 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 ab044adec8f5..fe809c27b399 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 } diff --git a/internal/service/location/geofence_collection.go b/internal/service/location/geofence_collection.go index a66b195fcad4..e05a69d91a65 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 e0f4c8575fcf..47da082048c4 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 752c774a1635..e50cb040ef63 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 400c4651096f..34623b371791 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 diff --git a/internal/service/m2/application.go b/internal/service/m2/application.go index 56f7ec6c64a2..71e84a776cc7 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 e2191b82eff2..f4810fd41832 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 187581b6ff1a..aca6fb678a65 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 e6d129d76242..4ee904936a12 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 abf3e06ccd0e..c4a2dcf0469a 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 8a06fb813d6e..6f386ed7d20c 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 } diff --git a/internal/service/macie2/classification_job.go b/internal/service/macie2/classification_job.go index fe64a2077d21..d51ae3de460c 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 fa6a7345d819..7e249a45b794 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 b64bc431ffdb..58fefef97b36 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 46084bef4893..d0a2b4a5b0d2 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 811d444cb07a..41607542b934 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 cc2f27ce580d..8766c217815d 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 81c8db1d4c8c..fdb4a88fbc46 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 419d2dd56db6..31eaacd45592 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 c33414370f04..145ed2855249 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) diff --git a/internal/service/mediaconvert/queue.go b/internal/service/mediaconvert/queue.go index 27132f85842a..c8033bbf3a11 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 3d8370a15e55..17f5792c72e6 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 } diff --git a/internal/service/medialive/channel.go b/internal/service/medialive/channel.go index 4dae588d0bcf..f94a205d6a6a 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 266e37ffe882..30f4f45d0d07 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 df0e61c2c307..a95c419fd949 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 01559f7e23fb..12b7d861586a 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 81116f9d95ee..8b825ddd96cc 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 d6929b754197..0575a17170b5 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 c97b07f3fd98..70e3d6500f11 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 bcb0c11ecc73..93aa7eb80e07 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 b062050aff0d..68f61e463b3f 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 3b0f95b222f5..e250f70c4d8e 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 } diff --git a/internal/service/mediapackagev2/channel_group.go b/internal/service/mediapackagev2/channel_group.go index 7cb256e655f4..b249296d5ee0 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 40fbd3a1d88a..5e436e93ff9b 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 } diff --git a/internal/service/mediastore/container.go b/internal/service/mediastore/container.go index f4e4286ee506..ba26091fec0d 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 b2665d5a5c81..1c5a82f7da3a 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 d7d8f2ade10c..19ab7babea42 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 1fa5a0284046..5e7a2dbf984a 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 } diff --git a/internal/service/memorydb/acl.go b/internal/service/memorydb/acl.go index b81d67684c3a..88f5c35fcbb6 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 5afe655f55ef..d73b854adb78 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 9c701ea7241a..b1a65e04896e 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 b4f43a08cb53..e9a30172e51e 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 212dccab53bd..87b43320cb76 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 9a0c4fbcd7f7..662a9fee4849 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 e0868213c2a5..60c7d7b7144d 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 52fd67ce37b5..090aa833abcd 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 f446dfe2320e..9e0869c5caa2 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 9b66a59609f4..4b9b6b13c0cb 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 8136ad649673..80f551c7d8c8 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 d0f9bb64b17b..ed1aab45b2ec 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 62cf3d12367d..4bdc857ddf28 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 2b9da17a4357..66f8c67393bf 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 } diff --git a/internal/service/mq/broker.go b/internal/service/mq/broker.go index 6ae940c0e048..663e6bd902e8 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 16cedf4cfbbb..9d6668b414ea 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 ccd13ca4456c..89c27d92d367 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 diff --git a/internal/service/mwaa/environment.go b/internal/service/mwaa/environment.go index fdab7f3fbaea..bed42c6e3b83 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 } diff --git a/internal/service/neptune/cluster.go b/internal/service/neptune/cluster.go index 2699aca66608..879361c285b1 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 65dbd459ba91..39824620f133 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 f2be6ed108bc..a8067676d06f 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 2617f00b762a..a759865d01c9 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 dc6e5bf31189..d72fdbd40206 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 b573ee081f32..8b90cb8e239f 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 f304506fc909..a8a8974bc616 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 2f6799e09cb7..09bbcf1c83db 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 e313040c6e5e..be1b151ec991 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 5358e5813723..7450d0bdfc8a 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 ebfa57b3c4e2..f3960fdb8bdc 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 24116946f677..6f2d1b33a96a 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 ddd88f2aba2d..68440a746d19 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 1ccbcc4732ca..a9295633600a 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 1a884d96d252..ff81f2afdceb 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 2e1e56409128..906ca361e0e6 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 8d1dc49bf22d..023dff903d29 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 638feb815495..6fd18fd47791 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 7626594e2051..7a118377d974 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 } diff --git a/internal/service/neptunegraph/graph.go b/internal/service/neptunegraph/graph.go index 3e7cdd008b17..f9ac4b7e67f8 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 } diff --git a/internal/service/networkfirewall/firewall.go b/internal/service/networkfirewall/firewall.go index ed4ea11d3fce..ae7f3f68ad80 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 7c576490a8a2..a77d80e67bc4 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 bfa7dc80506a..cb9511282d41 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 b0d79dba9ee3..2361d99d6bed 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 917d05d8b926..5d29a9cf18c4 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 107823c4804c..dfdd3eb0ef44 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 0e07e8d29cd8..7a5a80ccaafc 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 a98bb142fc8a..8970f8317bd0 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 4eed9eebdbd6..f48e22432daf 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 09721d48099c..b537aff0c8cc 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 c401b068a416..a305cbcd07d2 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 438f0a11e834..659638485b6f 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 fdf3e31996ea..8cbfe53b8a27 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 945c447e85be..3b238ab5c5bd 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 b42a26af44ae..9a2bb0c86a38 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 13fb263b1805..6a777b09eb03 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 } diff --git a/internal/service/networkflowmonitor/monitor.go b/internal/service/networkflowmonitor/monitor.go index c5d9532319b3..b5b0994974e7 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 cddc4e7454d2..7cf122e1a257 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 6d09cccf1bed..921e7fca970e 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 6c8d5f604f03..750d5d5767b7 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 } diff --git a/internal/service/networkmanager/attachment_accepter.go b/internal/service/networkmanager/attachment_accepter.go index 062e2e10c8ce..a835424414bc 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 96c950860ef9..bd599493986f 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 2b07dce204c5..c8e1141a413a 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 9807f69fe0e8..9509954d2115 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 8855d7d1165d..a79e71d0cba8 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 e08d284afd12..5da937307f28 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 4e0ae0efca78..699cf4ae4999 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 b2fc6fd56c76..2ab7e7658d96 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 6c2162854f8a..e6394c754b35 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 90bf3704283a..8db08e8e7880 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 541e3d37d57b..a594777ec2db 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 6a46b898fd78..5b04796af560 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 2e1ad3c78a76..e5047c61dec6 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 19512192ccfb..d7a968130dd5 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 81a9777e8ec2..20701f0885d5 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 39d1518b46fe..3cda95b358b8 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 fdf85b9b38dc..b87638cd5bb3 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 f57542435e8c..64943380e87a 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 8b7441877590..4d9d372ce459 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 9abfb093b1a8..a868757fa6e4 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 723dd2ee918a..fc7b9f33a0eb 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 be1454e98829..7960e0be92c7 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 9e195453fe07..85ed98ee248e 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 ebc073f6640f..a95489849513 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 f44195d6f0d0..f8934cc045e6 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 3d693201ee06..f6e55cc5f87d 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 91bdf47fb2b4..0b24a4c66ac6 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 07d577f9129f..9b406a538222 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 deef6f2f0244..110b87af2987 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 a80b956431bb..d13de8cb6458 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 2f2fea982f5c..f25f3c7f3d58 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 c989d4291dd4..bad510742c9e 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 4da39fdac763..44e737b5c0d1 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 91a2de93cc0b..e2b44aee6f68 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 aaf9795d5293..1f83c631adc1 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 f8fa2437ab51..074ec54a7248 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 } diff --git a/internal/service/networkmonitor/monitor.go b/internal/service/networkmonitor/monitor.go index d7d5c1d2f164..312d87794c98 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 b8856f6152c5..32dc46855ce1 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 2835ac85745d..4035fd6bb36d 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 eaee9204f61a..32f875be03fa 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 } diff --git a/internal/service/notifications/channel_association.go b/internal/service/notifications/channel_association.go index 8897b07e4007..5584ca0c7edf 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 1e739d52cf74..4dc97ec75356 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 a9b4ed1fe88d..7c2d82b493a6 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 2791f274d859..e6b7e83d086c 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 eae0a7269ccf..2b2414b56cbb 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 860827f739b3..59c82a0e0bec 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 10dba4d8d464..1a755561090a 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 e89985991c47..90e9f2106190 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 } diff --git a/internal/service/oam/link.go b/internal/service/oam/link.go index cef64768238b..f619c23dea75 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 2aa647be8eac..f230df5c1e8d 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 6cfd04d53768..d0ee81a61196 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 diff --git a/internal/service/observabilityadmin/centralization_rule_for_organization_test.go b/internal/service/observabilityadmin/centralization_rule_for_organization_test.go index 41e14eb5e90a..9556bfa42ad3 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 } diff --git a/internal/service/odb/cloud_autonomous_vm_cluster.go b/internal/service/odb/cloud_autonomous_vm_cluster.go index b128bc2c7a79..99b9652cbefd 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 7e33f69285d0..9d5b09fe6a08 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 369724f7bde0..9fa04227c462 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 f40dd036186e..8ab738b643b2 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 83df2759c16e..709af0a4ef76 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 44678001f9b6..4f2796cd0fad 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 dce822986cce..9610a5a3a131 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 10f9988ca0cb..5287ee0ee476 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 5a311c71e8f6..80ed6cb32d3c 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 aaea22b0b5ec..98eb9dfaec46 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 6f39b287abab..604690a00b0b 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 7db8c985ee6f..877337e90a30 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 72b0421eb727..1d7cd22be81d 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 ee4b0c1e5282..376c2c80e181 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 597975fe64e4..002b54dcb712 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 af571a010743..f9caa2bb7795 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 d16321dc7e21..e125e63b0b72 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 653eb49805cb..52f0bfdd61e5 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 4a3007a7cfdc..2f6d14f4a58f 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 { diff --git a/internal/service/opensearch/authorize_vpc_endpoint_access.go b/internal/service/opensearch/authorize_vpc_endpoint_access.go index f72e4bdeebc9..f41c682e5a14 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 e5c62d4da66e..82a52551568b 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 608083aec3ae..8604b34514c5 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 0d5f363b596f..ca23acc29fc5 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 07764723dabc..5ce84a886ab0 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 6b79f61b2e33..99d2b02be1ec 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 88f9de8bdd9f..0098d0e7021a 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 b3727800d649..8558f9fdcb3c 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 b2d3aad30c13..3829afbc6416 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 4861569fb69c..53a229576493 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 79b012ff6dcf..5fda7b1fc9f5 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 09b9d834c8cb..f57c35bcc10c 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 f1ad8019f51f..d33ca789e55d 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 0665c039c78c..a0ed5f98b616 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 502da6f71d76..10d950743446 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 67683e5f439d..8d629455354b 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) diff --git a/internal/service/opensearchserverless/access_policy.go b/internal/service/opensearchserverless/access_policy.go index 2e59b69e9c7d..fec8777a4043 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 d2172a006083..cac80c7ac55a 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 c4b589855906..47b4af1f4deb 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 c9ab40a06fb8..6b939e888547 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 c445fb6bf85d..26f0cdcd71f8 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 8d707eb67cb2..d4afeaece8a9 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 71bf6b37d09c..803848a1d1b2 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 b26555f16f23..a13ec0b6873c 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 9ca2bb13c6e5..ac3bbbfad31b 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 a6ce5173ca52..55254a31a56d 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 eaf50a9746c2..8463bc053245 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 c237d721372d..f500c571de40 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 } diff --git a/internal/service/organizations/account.go b/internal/service/organizations/account.go index 5ee3f68f3e48..c7cfd1fb400a 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 bc1f90718e29..b136dc3abf96 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 de6eef098f66..68be7f55e9a2 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 b497aa9249af..9c7a236db306 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 f8e859ece9e5..e809f8b0d30e 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 a09ba8769811..7a2e36c129f5 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 83400a4aca88..094b17a02f4a 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 b33ec10e509c..98578b7dc8f3 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 8b3f5a742e75..e656430aa5ad 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 daf46b2720df..0561e6220feb 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 6f469e511cab..973d5e8d6c96 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 d73e460cff71..3a4e67cc80a1 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 2fb75e67258e..368233c67ce7 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 ec31a5dda20d..abaccf8a6dfe 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 } diff --git a/internal/service/osis/pipeline.go b/internal/service/osis/pipeline.go index a50c8fb4c013..faebee81a6b6 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 10af7f605516..cbf88699e0bd 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 } diff --git a/internal/service/paymentcryptography/key.go b/internal/service/paymentcryptography/key.go index 2f708978ef82..639d64bbf066 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 fc6746cecc5d..052ec675b5c4 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 612f511c47de..5d8b00b3511e 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 } diff --git a/internal/service/pinpoint/adm_channel.go b/internal/service/pinpoint/adm_channel.go index f2f2c5b7a22b..634e3cb2f827 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 1f1f6469025d..561a7da38c54 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 23eb98db36b3..968c7279609b 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 2efdf338d553..906219b9c7c7 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 972bf031fe72..cf519566aa57 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 2dff8e2666e2..ff3b80ef1db0 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 8abe76cb63e6..6b7c101fe432 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 86b7f89af7d0..4f47bbf0e033 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 e4d352b1925f..873847bc9e9b 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 42cee6b462e9..e427fdb59214 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 fc71b8d5f93a..610ea8ec9e91 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 c83cfc23c8df..5ea6a8e7ef89 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 3edf838c3f26..c9ed30ec0450 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 47b0b540d6b8..7f3032be6a4d 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 6dd2eed6c9a2..43d6f40ef7da 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 2c82fe09b064..b1340955ab9c 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 2109a350c66b..489242385497 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 f8e2cd1c136b..8df3d84a11be 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 8b0a424f4a84..3d96a4fc4cf0 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 0298dd0863f8..eb49a7642b19 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 d0065edbe31c..8648cf4a67b2 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 a947fef40a15..982930277c43 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 c3b9ed698a83..23a7e10f0189 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 } diff --git a/internal/service/pinpointsmsvoicev2/configuration_set.go b/internal/service/pinpointsmsvoicev2/configuration_set.go index 3614c6f507ca..6d5123addfab 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 66b4d3ea5c25..3b23cfc7d11b 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 bb9e3e8682f7..6b5d564c590f 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 7d543adceba4..1a661f814ab3 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 005552e37b04..e8dd3c7bd82e 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 13f67610d794..911290b0a497 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 } diff --git a/internal/service/pipes/pipe.go b/internal/service/pipes/pipe.go index dd7d48f76694..912f429dab17 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 f14a689a7bcf..658574c5ee47 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 } diff --git a/internal/service/qbusiness/application.go b/internal/service/qbusiness/application.go index 4ce32101450a..f21202c24f9d 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 } diff --git a/internal/service/qldb/ledger.go b/internal/service/qldb/ledger.go index e7a62b2a1abd..1176d863224e 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 22151666f166..b91ae3b9568a 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 f69dc7db6530..b665a837042d 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 06afaecdd87c..fd3f26f5be01 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 } diff --git a/internal/service/quicksight/account_settings.go b/internal/service/quicksight/account_settings.go index 872338345d25..d43f53a76c17 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 58188c35aa76..cf78412332dd 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 f58bfe38bf8d..83b36db7160a 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 46c94e480282..1eedd166f52a 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 45db8a4377d2..a2d3396b88d7 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 adceac4d1d54..558734291cde 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 34d437f1f227..9569c840b28b 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 a03fedeb91b4..6e94559e3d46 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 0fb2b9d36c64..56e9ecc690cf 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 8c7b3e65ba19..02f7a55a0771 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 d7477b747b22..b1a92dca96db 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 2fda8fbd94bf..2745f8b1704d 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 020cbe613f16..1199f4959e2e 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 e4460beeef5a..369d8e0f80b9 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 e53b1abdeadb..8177dab7ac30 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 b899cc3b8963..58e758b699dc 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 f1c25f823438..b65e5b90e294 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 6c99e8fe1066..d17c039a4785 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 b81d4c317b20..c01ec08d9170 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 26109a5f9291..ee3b996ea2c1 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 b8ad3d5c00fd..a70e4451b8b5 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 f88603d78d07..2299f58baabe 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 bbd1d117c45f..a18b5f14e616 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 bb1e33741778..b689a8d828ff 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 666e4cb35be3..e6004b812b86 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 62498ba46d97..e9047a43c006 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 19c45f633e33..722a052531be 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 969485164783..6b15003c518e 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 d3d313bf15e5..d5ec8f4ea295 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 49f6791d3a63..a7220120a7bf 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 270a5a8d7fb9..c29c9f850c98 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 94ddb0370573..2c9750271115 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 24eb810ab4ef..fb8d1f4db869 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 9a35d5469810..a3b6a42e5c85 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 675a51e410f5..8cb3273afa0a 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 3874097f1d82..b1d57424d24d 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 7ddde49cd405..8e36938eb5b8 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 3987f2cf7aa0..edd0c868882e 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 2c717360a7ea..f676d21249ee 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 99a467a75fdd..f6013869256c 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 e48b83edf8c8..474d441a0d6e 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 022928c9e54d..e53cd709bb58 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 77a6be7b68af..890d1870a871 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 b0d33ca4c084..76cf8cc27806 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 da5330485a82..2d3b34e22ac1 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 34eecf69ab68..33004cd48908 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 7438713979ff..beab3a92a953 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 ae4cb2c5e2ad..ea3ff4b872f1 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 fd37c84371b3..64c609266352 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 } diff --git a/internal/service/ram/principal_association.go b/internal/service/ram/principal_association.go index ff6d3087e299..27ed2ee37641 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 440c3d8c87ff..73e2b0bc3437 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 6ecd1760afc4..c005682814e2 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 6a786b5a755c..1498274e7be4 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 2bf510dde063..3de6863c9e1c 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 f9b09cc7b49d..69918d777d33 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 05dcedda503e..e2c9c416c8af 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 79e964b20cf4..d48092987d8f 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 269bf4eb216e..ace6fdc483cc 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 diff --git a/internal/service/rbin/rule.go b/internal/service/rbin/rule.go index 3c586c1d5aeb..a0877aba0a4e 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 } diff --git a/internal/service/rds/certificate.go b/internal/service/rds/certificate.go index e58143b2c2f4..a67f394016c9 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 7c9f7f9e6191..edcb492462bc 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 1d6c9f6d7f1a..7430d7080bae 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 eeb57f00063f..501cab5779fd 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 093756b6500f..8c6b1bedba2f 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 c15791293a3a..572b4154626f 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 265d2270e7b5..47c2a9bc5e93 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 ae518f1d01d7..b037576a6193 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 5930ab95ef5f..0135b49df215 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 c56bdf44e1c7..af20fe1a6527 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 061eadbc2c23..cb0608a2c8c5 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 7d822d964329..aeebf4a9152e 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 cc7958e5099e..94b8a494dfbf 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 54bdb1e7e8b9..45f22ac817f3 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 399d5d690a9e..d811661f21ba 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 d73d4419940f..d55758e55432 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 0393fde4b3e7..7646fe39cb32 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 39a810c77d4c..a30e9a3c500e 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 29324b7d816c..8931ca97b0fc 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 f424e6ebd388..bd09870cf275 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 eb21bc2eafbf..6670affe1adf 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 ff124cbac792..30b62b674f14 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 f32e53924bd7..84e99f496682 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 63bc1a1de062..56c8ac4a1b66 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 1552ce30d1cc..de0b222d6130 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 0490b260b922..a42116d57ab4 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 8c7e3d77c07f..cc40b1b2149d 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 5beaa1c76001..cc51dee14796 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 495b7905ed80..6b3641443360 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 9bcc47ec7588..11020022ba95 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 2253b59aeb46..c689f3bb83da 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 ac5d6365a93d..d06fba5b56a6 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 f19fe17b4ccb..89dd62792942 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 8c00d51594b9..750ad64dc0ee 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 b28788e02991..e9ea4e64204a 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 085a4c13019d..e42e9130bc53 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 98cddf692e61..218585af3d56 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 754a291fc5ab..c1a564427eeb 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 6df0b41139bb..5d1eef9af94a 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 b51acf5f133a..53d0382a7ea9 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 2d8a5a72a203..dd09eeea103f 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 f165632fd668..80bd2eeecb5c 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 e354a390fd4e..bd6877dbc4c0 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 88b25c42ebf9..2bd66ea9964d 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 e90b842f3957..81b46260c4a0 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 763c036d98fe..4c438a81725d 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 81262141b61a..ad913a7087a9 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 df2399316b37..37c530fe4126 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 cf11fd83227d..000b5b695f92 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 97b99d61994c..65b9ea2b8b8e 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 f3dd6901fd3b..448fea0bd3e2 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 6c5c58d73764..9846dc2797ac 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 a83827590420..162b7761690c 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 cc7d8e7a8adc..ddb572555365 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 2089fb4d55b1..9e715f608bc9 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 e1b574435a2b..30054f10d45d 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 58df1a808293..69459a5efbda 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 } diff --git a/internal/service/redshift/authentication_profile.go b/internal/service/redshift/authentication_profile.go index ba22dec238ba..9e769c988934 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 17ddf9b3ea2a..365139be1f69 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 727a24fdcd82..b77846516833 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 dcb92ae677ee..641c2a88eb2f 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 0f1a9b07f014..a9ac7b4f9567 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 eb4259de912a..e9cbb367d9aa 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 fb3b8f5f529a..7ab3f395c42d 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 ad8822e6046a..8db83dd86189 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 c0006d4d57f2..bb47819dd2c1 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 8d501053ab7f..c12e6f7df137 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 441639e06c48..dca43ee7ef54 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 5e5687738191..9ea64e839345 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 896694827d57..0ee68c0e856f 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 b5d8bcb3ec22..23ed4f5f8869 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 b03d23441d35..adc681468b1f 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 49cda8887bd5..eeb0307814da 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 b2663de8e5ea..5a7013b05326 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 bf21414c0032..af6a380448c8 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 ca52a5fc5136..ad101b9bd7a1 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 e73f28960ff2..c103fa29464c 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 8fc8e98b1131..2e307ea541a8 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 adf36558234b..6d9c3a427d8e 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 1dfd2d9e8bfc..2837d1ee9478 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 69b79dbc65eb..443dc96f73a1 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 e858dbd7306b..d102ad2e2bd6 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 0710dd0f595c..24117cff5a94 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 6ddd4f706df4..89d21f8bbd20 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 c7c84dd65dc1..f38c8c36f538 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 1577a2f2c20c..8258981f9d29 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 156c955d3d98..0d484ba29ffc 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 0f3b823aaae0..48fc2e3a6d07 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 da2c8a84f624..e506603e79dc 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 4c45e7e47700..6882081b7403 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 5a6f329c9b9c..30c9f9b07593 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 d74c712b4707..9d18c910adc4 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 7189940c1019..37c1c91cc934 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 1edcd1104546..341ffb10662c 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 d989ee1699d7..7dc224c364c0 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 dc2a5c2ab598..6cd49a8ab637 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 4220058491ad..a13c6540d57d 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 ac1c6638a2c0..37681294a92f 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 c830941b2380..4df2c60833ee 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 } diff --git a/internal/service/redshiftdata/statement.go b/internal/service/redshiftdata/statement.go index a59de67eef5f..d80bbd201f4d 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 } diff --git a/internal/service/redshiftserverless/custom_domain_association.go b/internal/service/redshiftserverless/custom_domain_association.go index 78efd2ce77cc..4b2a02cd81c9 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 570526501054..e45ba9e071f7 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 569b9b9b9c20..bd429b676a5c 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 660298b45952..f8d59d67792e 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 0a64a0b8291b..9eb8f4708c09 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 eaded0fd10a3..0f7b1703c187 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 1ab827439739..9187273669c1 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 1df1ab8be804..191257ecb2dd 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 5777d6de4558..92b566b09b8b 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 cb199e36c854..cc4dd2abc5b0 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 c2068aeb862f..6f11bd28c7d2 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 1fb53552c1f7..9894eb6ff682 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 63f72eebea36..ea7005e4df20 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 87c56f51618e..80d192e9325b 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 } diff --git a/internal/service/rekognition/collection.go b/internal/service/rekognition/collection.go index 8f3d604dbaaa..c91d8d5fcfe4 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 78b0d88fe88b..37bd155cf9ab 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 a7bf9d1531d6..e0ab3b2665fe 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 f271a7489492..97ce03badfdc 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 9f92f3d191ec..630bf7bd61c6 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 88a61571452e..7f799f500c08 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 } diff --git a/internal/service/resiliencehub/resiliency_policy.go b/internal/service/resiliencehub/resiliency_policy.go index 7689a60464dc..db018c565ad5 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 } diff --git a/internal/service/resourceexplorer2/index.go b/internal/service/resourceexplorer2/index.go index c5fc160e4c18..dae07723c9cc 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 ae48c21ccfe2..bf4ffd2e2d91 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 9ac20606736a..c9d5ad9987ec 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 b6ed4eb40f33..9db014d76886 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 } diff --git a/internal/service/resourcegroups/group.go b/internal/service/resourcegroups/group.go index e0152545603a..26fccad4f5dc 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 8478a03c03c8..1c5ee2b03a1f 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 c233127968ce..6343c6032952 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 5d20d01b5042..50e1cfae157e 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 } diff --git a/internal/service/rolesanywhere/profile.go b/internal/service/rolesanywhere/profile.go index 2e836d02b1d1..276976dd73eb 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 28a568fc7a0f..5be6de2945f0 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 19a510885064..4929fc4f243b 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 054bed9abfca..f3a6fed7987e 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 } diff --git a/internal/service/route53/change_info.go b/internal/service/route53/change_info.go index 1646bfa3fcbc..3beb9f96e1b6 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 97dc90b5d00d..c75d01196a3a 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 ad5d70516f23..8764c8ce9af6 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 cc47de892c23..981de3188e3c 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 63f753150970..0da5485530b8 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 9052140d6f51..b00444e49afa 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 a613258957f2..a5bea9e4414c 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 cc32d2fbc825..275289ea5b81 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 cf5635b16c69..1da7bdc84924 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 6e94f21ec0dc..c91f9f2133ad 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 bd13d7973708..4fbdd77a5359 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 4633dc5af0bb..2684bbf3e6c7 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 499f84063978..1baaa7c471e9 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 4a77c0db8304..3f9159689d3c 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 4fb25de18ae5..0199e58c3ac1 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 eddc7d0bd12e..e88b00b1747a 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 dd2918ce7bc6..0c2f7c616547 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 3a65b68f272c..8a24d1951746 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 af505d350e67..f94b4afced80 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 781782da55d8..8ddd16d596a6 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 004175d2851c..49da788915e7 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 01a7f727ddbe..9f480372c70a 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 cbc21a868d86..e2f03fdd9120 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 4b56babf89fb..18448efb0530 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 49b2c4b7d635..f89495667cd9 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 3964ce763012..f33f3097908d 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 7af26267d45e..916752434bed 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 c0425bc5c76c..10c55682750d 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 } diff --git a/internal/service/route53domains/delegation_signer_record.go b/internal/service/route53domains/delegation_signer_record.go index 8c48b6403a31..3aa185a5695d 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 4b71b232b098..6881124ac096 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 edd8cfd03a41..80467139874a 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 108776dbe581..6d4c2f5b946d 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 b07f1015c946..2e57773e115f 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 a083b346f619..5556e590ee04 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 diff --git a/internal/service/route53profiles/association.go b/internal/service/route53profiles/association.go index 952b9703c056..fe037d117fe8 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 3c6af48371ab..1098071a03af 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 92f622ba4586..25941217be08 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 } diff --git a/internal/service/route53recoverycontrolconfig/cluster.go b/internal/service/route53recoverycontrolconfig/cluster.go index b59ec74eb7e3..792487f12628 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 ff5d597bb4d0..4896918d9f63 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 76829e24c98a..575bb53d160c 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 b0b383be6b65..18582de316cf 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 c5e163e1dc2d..fd3d728f304b 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 2f94e5be936e..8cb1216a0ce8 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 f8afde1b37e1..2bf8a95a7c2d 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 2c7ad180fa97..4d4772ec1fdc 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 d8883a4aa290..c51a0cd6ea2d 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 } diff --git a/internal/service/route53recoveryreadiness/cell.go b/internal/service/route53recoveryreadiness/cell.go index b3f46abae159..a1f4dce6b93d 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 250151c3c966..997f8f92aab8 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 ea110ebd9cae..5ceefc13bfc0 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 1938470d11d7..9c11ea3aaf84 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 b809634d9c7d..1dcd39d7a6b9 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 90a543f35053..7cf62805e86f 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 9a82e3f623b4..a0f9caf50cb8 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 2b3475f3f8f7..2cc19363c1d5 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 } diff --git a/internal/service/route53resolver/config.go b/internal/service/route53resolver/config.go index 089ececc8259..f820e72d60e5 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 e4fb0cc8a5e8..66cba0921fa2 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 1b1a8faf1da7..9cd73fdd5946 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 c2383b7f77b1..8ffe85f3a83a 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 3222b19a4049..b3a01426ce79 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 ea4b8947b39f..3386be9a7ca8 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 036d8faa05e8..be042e419203 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 cb35080a0751..7a4cb5bc34a5 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 5e3124c6e745..64869609fcd8 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 8b23cecb3f0e..8c597c88d4d9 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 8183de3ccf86..dd6a553217cf 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 43ca6a2e88c9..b0f51f07f479 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 c6d9cb1f024e..f60a40e3ec75 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 ae8740d6ae8d..680fbae02b4f 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 8885b199a42a..f7d226bb3350 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 264c4dedcba7..1d3b362b5951 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 2c5b94fcc76f..e21eb97ba684 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 6642c6cad0c9..2b19fa6b44c6 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 aea6e9fffc3c..599299b4cb94 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 c394f454b3d3..90902d8cb8ad 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 2084d930ea98..f91fcd33fa93 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 e059d820ed07..7fdba3c6a30e 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 074f5f8f449f..c6f1ccd7b977 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 } diff --git a/internal/service/rum/app_monitor.go b/internal/service/rum/app_monitor.go index c32a7f849015..7dd228aff48c 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 99fc9ec5ea8d..206e9be4bedb 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 900f1b510c70..302338ba7e0e 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 19b057a44125..77a75b802969 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 } diff --git a/internal/service/s3/bucket.go b/internal/service/s3/bucket.go index a6fa2cf0eb57..82968a4da9f0 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 d3accebc6064..4cb0c08ae842 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 f128149b0f15..53006eada53e 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 818181906f50..52be77331826 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 627c35095648..b62479bc70b5 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 1360d08ab257..efb730c88461 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 656d8ceb19e6..f2ab000d276d 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 efa57e755ffc..ad83f88f1c2f 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 7c039663b484..ba236c3680bb 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 d7d1f156b709..7c7b1f119f20 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 e1b78fd7be29..0d8862ec7c91 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 0a6f3ad1708d..4576da7167f4 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 d8b28a83c932..9a9b3b2bc2bc 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 50d6378e3e37..2d96b859d5b7 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 150cb941a1ae..57b42d08461e 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 de66ddad2db0..5f1f71d7498a 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 0ff0d3d23d33..c42a540fcf69 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 c16c5c20b829..afd636e38b0f 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 90699704e689..dfd1a6103816 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 d69aec88c408..03c966b22706 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 b89526148267..f0a0c99d3256 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 a163c61a98a1..ca0811a4bc10 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 3861549aff3a..2dc8bd203299 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 9aa53cb02da0..e2560427fc4b 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 9dcdf6061c8b..95e4b76364a8 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 18121bed696b..0610079e854d 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 6d4a8d61f88f..b62e0fb235ef 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 07b471783f84..1a63fddad2e8 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 6187686c10f9..c2dcaaba922f 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 860eac675044..665d702b194f 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 50c1dc57097c..454e2211745c 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 573fca262c6b..3e1cc9c3f4ef 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 768525f66c9a..8282934a2b82 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 7e2fc783a814..fab8e3ef02dc 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 19549b95e144..56f1d1eb904b 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 e1a3e40ce5b1..c47513856a49 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 9d4392cda782..5058d130b959 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 0cd89b4af6d2..ae70f8720a69 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 13942725b240..0d9e5ca0acc2 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 fe00bbc28e2a..5660ae75ab17 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 837f65ee9c00..f6f41c060f53 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 455d6549a75e..74a190f1e907 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 c85d58d9e5af..213f60e59e46 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 46068b74eee8..bd9f57416e51 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 211e38f08738..b96bd6263e89 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 fc24fea4bfa8..96352ebc1004 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 09db377a9287..83aab884fa91 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 f181ddd859fc..a431a855a578 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 9b888c722444..482b385b147a 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 be1dab8b32c1..dce6f64000ba 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 be25ff27f133..22953e622d11 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(), diff --git a/internal/service/s3control/access_grant.go b/internal/service/s3control/access_grant.go index 81f778399ee2..6bf5a5045fca 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 8474999fdf3c..4049eece8c55 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 5b7a432ce1fb..f6720891491c 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 4f1ed65846e5..5811b2413803 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 bfd9da857f04..e3b811a39c56 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 c6aeec7441ad..617fdca48f20 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 5fb17ea08579..11cf5a8a3181 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 596db14291af..8a915983f8b7 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 4659ebf66c22..948dea74470b 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 f8bf3f9a2a78..077c22c5eff4 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 5c48bebc8070..b477d7804943 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 da686675e299..aa8f5161814f 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 f27360f2cb15..38bd53200038 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 6de95c4c5147..892df63b1e19 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 eda7ac069bca..3886e4dd8edf 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 b0c862985d12..b7a81820b92b 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 94ca87b057ba..ddb3c53108e8 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 28725e4b09d3..21df30676013 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 24019b724b50..730dafc24a00 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 6ba054a4c374..71326548f681 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 32e87885403c..3122779e4221 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 877edec938be..85170a8ab779 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 a11a28ca8bd4..29bac84a2137 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 766a3e6da888..609d062d35c9 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 05a1060c9ba0..1c5dab28f598 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 514edaf408a3..c111a91a368d 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 21e0ef3858a5..5e9eb35f2557 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 6f53664f8eeb..2f9bb30a2934 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 4bc38f580dcb..000f94ecd5cb 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 eaeeff0c7c40..e43f66f26f98 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 fee3df780707..fb5994ff9bbb 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 } diff --git a/internal/service/s3outposts/endpoint.go b/internal/service/s3outposts/endpoint.go index 4635ac2a78ec..bac73d00c249 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 } diff --git a/internal/service/s3tables/namespace.go b/internal/service/s3tables/namespace.go index ccfa6b773dd6..5eebbbe7ebdd 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 b8d9abb6fc38..f8073f82338e 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 33d6843a7300..f722eae3f248 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 75d70d6010a8..a3b105fde386 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 25c81cad1b46..c755162e3c30 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 82b0b4424cf0..c3bddcbb0503 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_replication.go b/internal/service/s3tables/table_bucket_replication.go index 6e1d71c02ee6..271840c0995e 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 9086e516e214..f887c421b681 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" ) @@ -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_bucket_test.go b/internal/service/s3tables/table_bucket_test.go index 3a00dbec2954..5867a8ba2d7e 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 aa8b8cd9f3a2..b88b8fcae3ee 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 7e2c8827297f..f0c951dc989b 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_replication.go b/internal/service/s3tables/table_replication.go index 185cdfb18e86..72bf38b39c7a 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 fa59b8a9b459..246c23cb073e 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" ) @@ -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 } diff --git a/internal/service/s3tables/table_test.go b/internal/service/s3tables/table_test.go index 8186ca88463a..70035a7237cf 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 } diff --git a/internal/service/s3vectors/index.go b/internal/service/s3vectors/index.go index 7479ac316e35..c8281803921f 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 62fd5311eb0a..43390d3b2e0c 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" ) @@ -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 fb533e610784..109a7a6964e7 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 f15813d704ac..2a076bf1f639 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 1d76f4c859e7..97950285a617 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" ) @@ -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 c5f42906416a..f2fa815659ac 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" ) @@ -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 } diff --git a/internal/service/sagemaker/app.go b/internal/service/sagemaker/app.go index 417b3fde24aa..9c4eb376a897 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 049271f8ddbd..5e03b081f758 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 fe1fb17a719e..36ad549ca649 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 529b3cda421d..aab450198e25 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 8f05ee755fe5..638b12a730b8 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 a423ba158de9..3fed223bc68c 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 dc1aecd7525b..fa4c2afe2b4b 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 2693366c2d41..ee49722c8f1e 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 3d04ecd4bedf..93408fd63f4b 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 c2af89684c5a..4e6841c1779a 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 98a14818780a..72bcf6a2db1d 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 8e720ecc1e15..b6867d7557a1 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 6225c9950d27..e8047fd69fd6 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 5617b53a019f..9c648b1935da 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 ad4c67e22847..da57c8652bef 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 bf161f878a98..722b22f4fdb6 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 d7b031874991..b36a64bb9434 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 3c4661f72d9d..3d003aa44446 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 9ef4025297e0..079c4bb7d766 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 ba6040a073f1..2dcd2fca75b4 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 97a7a0bcb3e4..15f75b0e8bf6 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 5fb5647a6050..fb1fa37e90c4 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 ba74fab711d4..2ea3cdce5a64 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 6caec995ec8b..4be2807d597c 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 c7d3463dffce..7380f6a15e53 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 d3e768b6a6e8..4d4d2a30cdea 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 b34694a84b92..d44ef32deb5f 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 a5ed6088d2a6..36cc007d2bf6 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 8fdf5e83132d..d32c4990d36b 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 cf6549d61f7c..abf63469f0eb 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 33364663ed24..185aa5296cae 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 9c0118d9f704..3f315ac68c70 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 ff9e3c9ce03f..72f61d410b20 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 890bfe4b19b1..51d9d37c83a2 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 d2176cf49a84..0df6d1b9d1ec 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 2e1f8ea05691..cdfbebcecfbc 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 c2aef4135033..acc9dcbf315a 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 8ee258d05a77..b46e4aae0235 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 45512ff017c3..5599cd78cbde 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 e6f05ae9af8f..15c39118d0c8 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 8e2402c07744..2f43f3184890 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 5418913848e2..6cc510631c52 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 fbcb54e9c2e8..9aea0e40d529 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 d9c341b1069e..38c3d549fcb4 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 dc17adf5442e..9a4e4552144a 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 e74118b7c0e0..43d442ac6d0d 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 93a740c9969d..7c1601cb0946 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 5978165b56ec..e8430cce471c 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 55cf248b4c3d..17ab1e59a841 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 fe4825d82f7f..43b1d60cff26 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 5785d9ee34fe..f1bda91e671e 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 f1698d185bae..f3ab8f63184d 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 f814edcb9d43..627fc1bd99c1 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 280969dfb0db..d7ab0051a6c9 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 1f95febe4b5d..9d26abdf63d9 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 1c7c556c780e..92dd8aa39e08 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 1ce70df8808e..477178e7612b 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 } diff --git a/internal/service/scheduler/schedule.go b/internal/service/scheduler/schedule.go index 6348dc030466..e1d6fa19af6b 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 d83c5518076c..dfdb6cbe2f16 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 76359a5a8352..f61fb6548cdd 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 c22c0f724112..772c32980574 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 } diff --git a/internal/service/schemas/discoverer.go b/internal/service/schemas/discoverer.go index d9344fdbfbff..fb3b6b4eeb32 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 0d035c39f107..7b109ed0d7a7 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 8734cf47385b..9f062ff3f669 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 c006fa060726..4d587d2f5682 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 277ed9e63d92..8daec79fb200 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 25c21b99f72d..a215e4f51906 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 e267e3808311..7f19db605281 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 ff9d14c8fc37..6cb7d8cc14e1 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 } diff --git a/internal/service/secretsmanager/secret.go b/internal/service/secretsmanager/secret.go index dc7274031833..d98d5fac496a 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 7b065c5f0748..8f1e963d97a8 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 7149b474d03b..74ecf36ee132 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 46c88406455a..d6f404ce1e0c 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 6cc07ac71475..540bce17377b 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 a5355de60893..91f8080bfa1e 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 e0a77f547952..0e525bbef387 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 5e9728e2d407..edc2045c6271 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 } diff --git a/internal/service/securityhub/account.go b/internal/service/securityhub/account.go index 3803248f2934..e42d4fe7f6ae 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 7b4dd4051cf3..4157eefe6647 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 78a1347ae25e..28ca796856e1 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 2d9313b9735e..7647face0766 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 b55ae3f5fb98..0753531feb96 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 6570f5d2cde8..8fd68e3bf991 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 c47b42c675a1..54e544cbee6d 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 66fbc61574ff..9370b41a438a 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 f01b7c559bf8..4ea4f99ade51 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 91b91271c92e..7d4e258fcadb 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 5e07e6cb9cab..040c91d80a6a 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 65fd6431fe1a..5241cade95ef 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 cf965b6684cb..a30edf5aa8e1 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 025a85a0a52a..73abf92bf91f 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 91074896f6ae..0ff794bdd278 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 61d1e7fc892c..99acb4791b07 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 bf0b0772c1b9..787b07cdabbb 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 8c88c64a1173..423617b51955 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 6ef3e8743fbd..b473e68d6933 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 ab1591261546..57680fdb13b3 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 207deafbf269..21b40f8763d0 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 9188f82d63ec..b4ccc9c5b357 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 024f830347b5..3b0f5af4ddfa 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 f33366d89147..6f777306ad8e 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 3a890177cb31..0f72a13f23a4 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 df65385117fe..fcd3a56264f8 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 6c8c65e5874e..93f95d1ca78a 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 a330e12bb0c9..683bcec39de2 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 } diff --git a/internal/service/securitylake/aws_log_source.go b/internal/service/securitylake/aws_log_source.go index d66a76231c39..2e2cae1cc99d 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 13b09c1c815f..168fb55ffb83 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 f5bc02795006..0dafab035001 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 976961f25079..6422c739f91a 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 956e0a63af40..ab32aa263641 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 e9a32b0df12e..c772b550f7f1 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 48a6e359e041..9d30a9686180 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 364d40969637..5fc788bd83a1 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 4f7aa4992a40..0815bf8c9419 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 13a56c2f2d30..15d38c9c6fd0 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 } diff --git a/internal/service/serverlessrepo/cloudformation_stack.go b/internal/service/serverlessrepo/cloudformation_stack.go index ebc3dc76c17c..69da204adbaa 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 diff --git a/internal/service/servicecatalog/budget_resource_association.go b/internal/service/servicecatalog/budget_resource_association.go index 27b3eba0cfee..0c1002eaa138 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 a951f7783ab3..428ec8903349 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 7cface18f6dc..49dc3c6fa411 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 70fc06dd7844..764affb61b80 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 8c1907bd6a6f..d344bdac0c69 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 367383e15ed0..e2e673168198 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 e307a2175a6c..bd07c631b2cf 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 f9a26b3810c1..7eab2cb5bf07 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 31812f71ed99..e7b933b846ab 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 1001cb36a445..dd584d0d9921 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 4c914f4f155f..2b7a50c96ca3 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 dfb4fa177f25..b12de5a8d078 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 2984edf4b08d..ffc7bb03c13b 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 f8e2ffb7ae21..eb04022c34e6 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 0848c9d8b873..b566451cb6ce 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 d17394c78660..348bc0aa5752 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 } diff --git a/internal/service/servicecatalogappregistry/application.go b/internal/service/servicecatalogappregistry/application.go index c4b0c0f7fbeb..fcb7315b6071 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 5532b4343363..20c6ad2e504d 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 9f2b94500a6e..e64a27d2ca78 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 } diff --git a/internal/service/servicediscovery/http_namespace.go b/internal/service/servicediscovery/http_namespace.go index 94f6fb9b50df..b39027cdd892 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 88abe1e6ca18..72b2e2e91ed3 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 64dd9891dac0..fe056b1bd309 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 2842e412ed84..434579b78c4a 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 a42847b71ea1..2ac1ed3cdcc9 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 7d5cddab7d42..043b17e306ea 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 c68ec7e22409..92bdc544e416 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 46cbed327ef9..f7f800048578 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 3445a19ed227..885c5dc17ab9 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 b2576cf89a5c..6ec3f409f2c8 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 a633a5f79a3e..3dc816503f5c 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 } diff --git a/internal/service/servicequotas/service_quota.go b/internal/service/servicequotas/service_quota.go index a2d2160a5d59..58c13deaf490 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 8cc58bec2b23..e786ce7ccbda 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 a5f3af1a4b33..684c94046d54 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 eebe98f30d4b..93ebb12d7d9f 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 56116484842e..1a2b096163c0 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 29d8399b2501..6f9cd301d148 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 } diff --git a/internal/service/ses/active_receipt_rule_set.go b/internal/service/ses/active_receipt_rule_set.go index f4dc71ace1d0..c01b2668c2bd 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 9e8b6222aa7b..79c5fffcf106 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 6cd75effb90f..6b59306f4076 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 ec395bfba851..ae42c8de9a33 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 b7b68cda9a8e..bb8943e7647c 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 dd6bdc47beb8..654a6b1a5495 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 a637faeb7bdc..73d9e4dca062 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 2128fc8074c6..688dbedda8ea 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 5270eb91a30a..8f8983fdd4e0 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 c67348fee3db..72aa12f46cd8 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 2b80012a9aa7..b5eab9c9b370 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 b0b505f55958..05744ebfcdb5 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 56b394bd08c4..60cf2c7f7e9e 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 43d56b104297..0e436eb173c4 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 5352ad406dad..3db13d32b179 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 cf2e6cadac86..1b0a4063cfbe 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 8c53f2cdae39..b848415aa077 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 45027b561793..843f8bdbe090 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 eca0b9954a51..10acce0bd95f 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 46a7b725c66f..400c45178271 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 c9f0d644c56c..791612fd964a 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 922398c00c03..bf5603e9280b 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 98401c3c9943..a21bfdb2e694 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 7540f755c3e2..0ab9ca211dfb 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 b530d284c326..4ee940eb43a1 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 } diff --git a/internal/service/sesv2/account_suppression_attributes.go b/internal/service/sesv2/account_suppression_attributes.go index 03e179db810b..a20534f0ab69 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 913283f60b31..6b4d5bbe1398 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 ee59baa5fced..baf8b9d861fd 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 b0adca266f91..81f95ffbb71b 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 671bdf83686d..fb55ef65150f 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 334afe8c81cd..bd874c7ff8a2 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 be44ca140053..f858b5163a2d 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 abc19e690cf0..6e3029eb5bdc 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 658c59274c7a..c0f9f7fbc9da 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 cca452d33602..d77588f392d2 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 cdaa5b133982..3b7b25cc738b 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 8f83810fc47c..6ffce91dceff 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 556246b5a496..9d4e47a5d33e 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 590c9e42ee79..747016eccf9d 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 46f5f2c4aaa8..6bb328951e04 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 566a2b01989e..6de477a590ac 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 fea1849a1482..7ac60a17f87e 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 bdf47bdb777f..d1db3ad06c54 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 d8962888506e..4d1d90e5bef9 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 } diff --git a/internal/service/sfn/activity.go b/internal/service/sfn/activity.go index c67e6959cdf9..bdc2372a2bd0 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 aea11b5ab1a6..9cf9ae1c55bd 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 7bb7c8e5331a..7f48adfbaeb6 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 d5944e4be6c5..a3f3e516b48c 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 a0fcf4e0561c..008719dbc2c0 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 69d3b2b4b075..d5d7c1f74149 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 } diff --git a/internal/service/shield/application_layer_automatic_response.go b/internal/service/shield/application_layer_automatic_response.go index 0e3319799ea3..67736309c768 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 85f26c2a6c5c..fd32b83f2ae8 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 7e95d5d233b6..36bdd9d1f1a8 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 55cded750019..afdb1d4c8703 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 f90017c9ba28..c76279dfccd3 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 5374937c124a..c5e39ee9ab03 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 d62da9f6e4e3..1afc241259b2 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 109aee2bfb00..3d084701ac1a 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 bd235be46a25..fe7bf302ccef 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 fabbec609067..8f6de3360a9c 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 6d1e190de027..72118b223538 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 } diff --git a/internal/service/signer/signing_job.go b/internal/service/signer/signing_job.go index e569f0c55da1..490b7d3a8d18 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 d8c3d5aa8209..a65148e1bb7f 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 44795ed0db4b..eee9a0c76df1 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 1e61971186c1..f34204c7c955 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 88121a5f4f45..486aebd28356 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 } diff --git a/internal/service/sns/platform_application.go b/internal/service/sns/platform_application.go index 89e204b8011a..3907a5bde2bd 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 8407d4ae53c0..3f8302e08b4a 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 43747574abcf..41c5d0036465 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 5b5d855f7871..e70f9b006e8c 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 b54038d9ad46..d6ae3390819c 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 70430b20f81c..494e2867b836 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 b42edfdebdac..506bc14f800c 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 44d69b0dfe0c..2bbe8bd66b18 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 b52128b61da5..4809cf18aa2c 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 c86ce0d4856d..a997c3a64c88 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 } diff --git a/internal/service/sqs/attribute_funcs.go b/internal/service/sqs/attribute_funcs.go index db799f2fd136..98a95a1db5a1 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 761bda2e525d..933f14c3eb25 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 } diff --git a/internal/service/ssm/activation.go b/internal/service/ssm/activation.go index fa7492f576af..bc52877a6444 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 1adeeed13a69..7faab783ad57 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 4ed5384b5394..1533a3b9d15c 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 1cb9b2abe1cd..24e86df2637f 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 2cfc302ebf1e..4a794cf72415 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 147c0e52d605..3d7880335d58 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 878a7598012c..af64e5b5607a 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 7774fb24da98..e1495d4a4127 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 a90d848cd247..ee0054a39df5 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 7fc47a5587f6..6f69a7ed39a4 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 d1a29ee0f7a8..beebee821e3a 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 6727d582edc7..a06880c21187 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 1c264d3cad31..bf460c9ac8f2 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 7438ce15cf5b..e10b7bdd9ab2 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 176522b43397..5a24c80aecc9 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 d6b714d659cb..bc603d25d39b 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 52824ca71c42..a7298c7fc8ae 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 760454617d8b..3e2823b55974 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 f297c9ae864d..f18dcb2d563f 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 666b2b7fe312..8c87da2bb587 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 7fb14f57d7bf..d2a8a695cc42 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 1013d5bb262b..4f5a6052032b 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 f4a12d7b79ff..451a43e822c9 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 bdb6cde2562b..a9cc66919760 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 } diff --git a/internal/service/ssmcontacts/contact.go b/internal/service/ssmcontacts/contact.go index b328273aeae1..0b096defaab8 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 83a9188c0d2a..b764e6e4a993 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 4a39828cef69..430ff9fc05d2 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 87d7ea610376..af2d0ed6c60b 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 e0ce42d8266b..88d4d4b751ba 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 } diff --git a/internal/service/ssmincidents/replication_set.go b/internal/service/ssmincidents/replication_set.go index 4e3410c2bd72..b8b8cd62abc1 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 ad61b2ea800d..8873fa4ce249 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 604fd5287bc0..2080a8ad2f21 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 537f59678f65..d7135225ff42 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 } diff --git a/internal/service/ssoadmin/account_assignment.go b/internal/service/ssoadmin/account_assignment.go index 0227868ba3c4..677f0f274a3a 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 3b94087474a9..0413052a74ed 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 fcb809b594bc..ac70b5a69b4a 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 a0e9dbe00783..15817a419f56 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 dd58e8f73c89..009958803438 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 2f185dbb593c..58b8866f1336 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 020baa56dd80..5f42da366333 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 e6d47cf8cdad..9240a49cc67f 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 7409caed4e01..418262b567e9 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 be2ac224f4a4..218e207c82aa 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 3590cc33d1d6..3410eb1859d0 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 3cedcca5e966..3ab96f19585a 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 03686f16102f..a7f6919646da 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 6bbe0ec2a016..105d1ca3a574 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 9b404f9cb084..64a9f4950b70 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 3a31ae5562bc..6809b8381abf 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 81de96de1ba0..5f57a5eb4aa1 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 583b5a5ca31a..c8afc078a70a 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 753741e0f03b..1cd5ade503e5 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 aacb172086e3..cb35be148c7f 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 708989ca8138..25235192ee3f 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 } diff --git a/internal/service/storagegateway/cache.go b/internal/service/storagegateway/cache.go index 8508b908edb8..34d1a0284bcc 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 17489e021027..f67b764dd6c5 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 725dc43d872e..5d2e7b46b3d1 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 bae48076db35..7819fc35f081 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 e8add6349d25..e04baf47c09c 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 753215f2c796..8e4ac29748b3 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 8afdb7dcf284..4eeb7ce87063 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 7c0638c9f139..10687dbcd23e 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 b40d91befb5a..43c46b8951a2 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 7d3e9a78e58d..f5b3fe06631b 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 05ab88ea45eb..88c6f202c2a8 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 335e4662e06c..56acd1fc4c6e 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 ca65652ba9ed..7318277aa69f 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 579f458e0e0b..9f83f6f338e5 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 a826ac4147c2..da1e3effd523 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 c93289815925..183fd419d1ef 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 a7545dda3f6f..56f209ace708 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 diff --git a/internal/service/synthetics/canary.go b/internal/service/synthetics/canary.go index 1cc095dcb73b..c0210371eb70 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 7c8bc6f00734..42f77323be2b 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 30b72d17e2e9..b33241df2441 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 7a33a760e4e9..c4f4d32c8203 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 25b1549278f1..17edaef72957 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 b8c0d7cccc59..486723d9e61f 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 1e5fd7bd3c3b..c0c4e3054a0e 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 } diff --git a/internal/service/timestreaminfluxdb/db_cluster.go b/internal/service/timestreaminfluxdb/db_cluster.go index d912899fe750..f83dd56be901 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 } diff --git a/internal/service/timestreamquery/scheduled_query.go b/internal/service/timestreamquery/scheduled_query.go index 421a54c2a79f..c410210cb845 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 } diff --git a/internal/service/timestreamwrite/database.go b/internal/service/timestreamwrite/database.go index 421b6c1b9df2..6cf0df2aeead 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 6c090a244172..7f1cec478786 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 53d3832ae24d..f267e6887b02 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 9131f68f84ae..d15d4518b9a8 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 } diff --git a/internal/service/transcribe/language_model.go b/internal/service/transcribe/language_model.go index da4ea738ed07..7895e69d6810 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 cec871dcb79c..ea7c8ee6b41c 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 907e6d45e412..491c7fc4537e 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 60abb90de319..6b2b10366ad2 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 df58b4b7c6fe..14583d205734 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 2a1a18b4aca8..ac4fce0c15dc 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 b0c44ddd677b..896f36163fb3 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 4869c20b864a..208b38c83669 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 } diff --git a/internal/service/transfer/access.go b/internal/service/transfer/access.go index c776402660b0..d92810ca00ce 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 7fbc8dcf9f76..03b7bfa84ede 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 5cbfc627b4bb..c74bc56040ce 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 cd5e4fcc4937..847b53f7eddc 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 3581603da7e9..f192662a831b 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 2e08bae40429..41d4b91847f8 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 f780b2f6c6a3..d0e3cde77c7c 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 2f4f4b85740c..af7a35ff2c26 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 331521453bab..358c91bf9878 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 096a19a6a859..b1b9453ac2ba 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 4d3166838001..d05ad314bbd3 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 df5edc7775f7..75f11c90846f 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 3b9b6a81f1e7..73523d40fa7f 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 3a5cab9dd04c..d6c64a7baef5 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 453449b1fc55..444adb1e6471 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 cbf29f89081c..27857070c195 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 d1b8b44fc80a..7f5aaa5d02d5 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 76b7a5b36c14..2a876ec6178b 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 9b5e07619505..9607a6769f0c 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 084930e01ff0..078398dd8858 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 35f18302a033..fac88b267a65 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 1e7bc5190ad2..bb2b26887ce5 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 772c072c7fc2..71e90fdcce08 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 d8c25981623f..741ed1994af5 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 32db9140a120..55c2168c0f97 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 d43b11788882..19132488bb2d 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 } diff --git a/internal/service/verifiedpermissions/identity_source.go b/internal/service/verifiedpermissions/identity_source.go index 6d0ef45aa79c..80c5701a54b3 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 3c8a72c7e0b1..1c86f61dc14b 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 308461eb866f..b2008cacda02 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 3c7f16f0f83c..13a092334955 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 f13bc7f8baa4..6586b6e5518a 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 69522c198127..1c49806d570f 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 80ae11707e83..aa4862097832 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 ae08ae929725..01f3e5c10cd6 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 ba45cd0c1b29..8f0b0200e39c 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 } diff --git a/internal/service/vpclattice/access_log_subscription.go b/internal/service/vpclattice/access_log_subscription.go index 57a3ccf8a94c..a26812f76131 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 39e631321854..b76bd0fc555c 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 262b53d1084f..ff6ac0a3e7d9 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 98b4148a10b2..17583fde0ad8 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 9ec5329bc981..79a9bbc44291 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 f38208d14c6e..5841f4f0f273 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 6f2723ae39f2..0778c695bae4 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 3c9c19fb45f1..4865f5fe4204 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 21ed2b02960d..3decc1ef619d 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 9f958494b024..03d0cccf07f4 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 3637c64a14bc..c3b428282d2c 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 51a151f1cbc0..90cb803edf9d 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 49349cb13a2c..2f198b25c773 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 975798df5c01..d04d9d03031e 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 938f98a52dac..ac06119ea9b5 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 efa50b5551ca..61429f163da9 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 34d30219577e..f8db3b42c92b 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 c55b085afad9..bad10148a8b9 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 5e5f8f613446..52da5f96de33 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 a29c63ae5c6d..f43b013e275e 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 30be0bc1065c..32ddaa530b0b 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 5126471126f3..2927e60cb0d2 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 5ee2d8826a76..c761f5b94850 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 391f82ee5e8e..1682821d12db 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 3b58722635bf..dc64080e23c8 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 adde558b212a..57ed28271ebc 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 a454b23249e4..d192919c0d1b 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 47301b544dc9..240001a05615 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 be53cea58cae..a22b7bd39993 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 999f79dd56a4..ffbc3d48e135 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 } diff --git a/internal/service/waf/byte_match_set.go b/internal/service/waf/byte_match_set.go index 90826f4a3eb5..83db30fd5cd1 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 f467575a1d0d..74a1ad025f69 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 7883840ab99b..4941648ddead 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 0a8c74537fb3..2fed0f9c9851 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 d52ac942e6e7..49bae19b1c20 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 d980197ec801..24c4171c861b 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 87fde59fd7d7..3ce710ec49e8 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 1efe1de981e9..a6482e4aae11 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 c113054a2004..489e860c7652 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 13513ea1da14..b640f4d3a623 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 3d0f48c12501..c526169b1b86 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 0b3ce7a20316..4c2229718a40 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 15e0821c5d4b..260fd9946fe8 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 f5b89e5cb662..ad47533aae36 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 dbded582a51c..996796816c73 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 70280c422269..5f47af6d1f47 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 e4ee7d09f6fa..7908c80bb266 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 f053e9463a48..51a5370b8991 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 9ee12d9f568c..ff75329dfa87 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 222c568d6f8b..ac77538f7787 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 c04dd77e42b4..8c9338266d32 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 5dda7c01ad2f..5b24d54b7590 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 a273dee0a6f6..d15cea8c50ce 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 de19c871b34a..b6299fce6d72 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 } diff --git a/internal/service/wafregional/byte_match_set.go b/internal/service/wafregional/byte_match_set.go index af7d6c641180..2670dc3ff813 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 be8d5c32281f..1edfad0bd23a 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 70a9ba0a803b..3c5caca97807 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 cc3d451b2608..7634a96dc3e3 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 d62ff82b1e73..6c7c26136504 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 409d54996fe4..ae536b589a88 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 9b49101185f4..16f31bbc0964 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 90201ad7488f..43fe3293d8e2 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 6c1cef3c8b9f..6608ae3e2d8d 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 0d5015890c87..bd19cd3288fc 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 985aee773fa6..5959cc79188d 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 64f3bd9c92d0..d974c6f31bc7 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 fb857d9d5af3..61eb7d6542e5 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 bdff83193a98..ce2384226cc4 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 33eb420f396e..fb52124e909d 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 324e5aeca9d6..bfe17968bc0c 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 dec24e867367..8801c7aa9568 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 0a0d9519bf3d..be089469ed27 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 7dc73cbfd961..b51273343670 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 1f93943a7d82..769ccb5511da 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 ffcf5f349a19..ab2edaf9643b 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 b8279bfd9079..a2ca3c99e512 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 a2519901e112..40a4c855e2b7 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 3a92d4b682e6..a761fa19175a 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 daf3d4693933..7c02618e3bb5 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 2424d76bcf9b..bf5c4f8053d2 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 } diff --git a/internal/service/wafv2/api_key.go b/internal/service/wafv2/api_key.go index e9643a859da4..6e1faa5a8c01 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 7508b268c1e4..46dae269eaaa 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 8dfd0e8d2dfe..b4790c8786b5 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 00832487dbd4..5484d6d4e7f7 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 215c8027e4c0..24f73ba14e96 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 3504c2f90ba4..0aa23b835f90 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 a8a4e169a540..165a05a47d6f 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 eefb718991d3..fff503105f03 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 34ab2a9595d7..77d7104f0d0e 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 9ac2aefac071..655214618c17 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 30e9f95c7df5..14289fe05bff 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 e684ebe69073..423546a899a4 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 e104bce2f7d0..e0f4e0b72127 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.go b/internal/service/wafv2/web_acl_rule_group_association.go index a21361204a9c..51fd20d80a62 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/service/wafv2/web_acl_rule_group_association_test.go b/internal/service/wafv2/web_acl_rule_group_association_test.go index b87471a9da8e..ff28c402396b 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 ca5d3d0dbebb..02462f9a30ac 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 } diff --git a/internal/service/workspaces/connection_alias.go b/internal/service/workspaces/connection_alias.go index 9f50e1f31a4e..cd2fd0c59eeb 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 38a530769280..4ed1f121b550 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 b16a5425cdd1..3c92022bae4a 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 f87cedf7a280..66d82b86426a 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 6776df43fe0a..51b2f640c284 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 9737603d92a5..65360c08fbd4 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 a34f6d7c4e6b..8ab3cb0c2310 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 efd7a0f6ea40..8d1751825cef 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 } diff --git a/internal/service/workspacesweb/browser_settings.go b/internal/service/workspacesweb/browser_settings.go index 2832e68aa827..ec564d3bf5f6 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 e4850625d04c..03aa61a48e83 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 c85175e14cf8..c7c818d84475 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 6bf985697117..55aefa0d4be6 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 951bf87fac40..5eaf368f9eba 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 95fc199b3228..4a1701d72290 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 35c314be729f..f89eb150a6dd 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 a83269cbdc25..19ce06440f4c 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 c10ef4d3487e..61c524b194a3 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 9cddc9a5f26e..3652f7e84e34 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 ac780eba9f87..1f72e75265e9 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 575e753a0b26..b309dceab21a 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 68986eb12d36..853ba961927a 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 d3abf07a4ed5..450d23f8142e 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 f34474e7a163..57742fd491aa 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 024aca7bfeb5..75a02315ea9f 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 ab9a1d859e93..9b83a7fd46be 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 3e7d63309863..0ab66e14e6c9 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 4b4bae7e7434..9f660e349a51 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 a8c1b6cb8eba..09f3aabcf494 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 8fd7d7ad9c30..fcdfb139ca41 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 2dd786b534f1..9f315bc625b5 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 061e4f180298..2df6d4a1298d 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 075e0a8de316..7b94b7f3fa82 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 cdfe00d65eda..55e23123fd74 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 } diff --git a/internal/service/xray/encryption_config.go b/internal/service/xray/encryption_config.go index e441397062c0..7db3acf23e03 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 a36e467cbca2..d7cc0959b920 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 ef72943c9292..97a60386157a 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 475555347789..51f7360e1c6b 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 f82db588d8e7..05ad5b960923 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 5e3d832e8e2f..59d5f68ce31a 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 f096064a9f62..58a24cb38557 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 } diff --git a/internal/tfresource/errors_test.go b/internal/tfresource/errors_test.go index 70e4ecd45cf6..3df83bfa77e1 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() diff --git a/internal/tfresource/not_found_error.go b/internal/tfresource/not_found_error.go index 9bc03361fffa..5c6fe6c0f2e3 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,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 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) } diff --git a/internal/tfresource/retry.go b/internal/tfresource/retry.go index 3ebd030f7ed9..b577bc0e059a 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 } diff --git a/internal/vcr/.semgrep-vcr.yml b/internal/vcr/.semgrep-vcr.yml index fce1cb9c4102..9926c1483f2b 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"