diff --git a/aws/awserr.go b/aws/awserr.go index efe0553b72c..6df07f7bec1 100644 --- a/aws/awserr.go +++ b/aws/awserr.go @@ -1,10 +1,8 @@ package aws import ( - "errors" "time" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" @@ -38,31 +36,3 @@ func retryOnAwsCode(code string, f func() (interface{}, error)) (interface{}, er return resp, err } - -// RetryOnAwsCodes retries AWS error codes for one minute -// Note: This function will be moved out of the aws package in the future. -func RetryOnAwsCodes(codes []string, f func() (interface{}, error)) (interface{}, error) { - var resp interface{} - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - var err error - resp, err = f() - if err != nil { - var awsErr awserr.Error - if errors.As(err, &awsErr) { - for _, code := range codes { - if awsErr.Code() == code { - return resource.RetryableError(err) - } - } - } - return resource.NonRetryableError(err) - } - return nil - }) - - if tfresource.TimedOut(err) { - resp, err = f() - } - - return resp, err -}