Skip to content

Commit 5bcbdca

Browse files
committed
r/aws_s3control_access_grant: Correct create retry handling.
1 parent 2130457 commit 5bcbdca

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

internal/service/s3control/access_grant.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ func (r *accessGrantResource) Create(ctx context.Context, request resource.Creat
179179
input.Tags = getTagsIn(ctx)
180180

181181
// "InvalidRequest: Invalid Grantee in the request".
182-
outputRaw, err := tfresource.RetryWhenIsAErrorMessageContains[*awstypes.InvalidRequestException](ctx, propagationTimeout, func() (interface{}, error) {
182+
outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (interface{}, error) {
183183
return conn.CreateAccessGrant(ctx, input)
184-
}, "Invalid Grantee in the request")
184+
}, errCodeInvalidRequest, "Invalid Grantee in the request")
185185

186186
if err != nil {
187187
response.Diagnostics.AddError("creating S3 Access Grant", err.Error())

internal/service/s3control/errors.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const (
99
errCodeAccessGrantsLocationNotEmptyError = "AccessGrantsLocationNotEmptyError"
1010
errCodeInvalidBucketState = "InvalidBucketState"
1111
errCodeInvalidIAMRole = "InvalidIamRole"
12+
errCodeInvalidRequest = "InvalidRequest"
1213
errCodeNoSuchAccessPoint = "NoSuchAccessPoint"
1314
errCodeNoSuchAccessPointPolicy = "NoSuchAccessPointPolicy"
1415
errCodeNoSuchAsyncRequest = "NoSuchAsyncRequest"

0 commit comments

Comments
 (0)