Skip to content

Commit

Permalink
Merge pull request #33537 from hashicorp/f-aws_s3_bucket_website_conf…
Browse files Browse the repository at this point in the history
…iguration-aws-sdk-v2

r/aws_s3_bucket_website_configuration et al.: Migrate to AWS SDK for Go v2
  • Loading branch information
ewbankkit committed Sep 22, 2023
2 parents a7a008a + bd9831d commit 1346c46
Show file tree
Hide file tree
Showing 21 changed files with 991 additions and 1,507 deletions.
3 changes: 3 additions & 0 deletions .changelog/33537.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_s3_bucket_policy: Fix intermittent `couldn't find resource` errors on resource Create
```
4 changes: 2 additions & 2 deletions internal/service/s3/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf
return diags
}

if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNoSuchCORSConfiguration, errCodeNotImplemented, errCodeXNotImplemented) {
if err != nil && !tfawserr.ErrCodeEquals(err, errCodeNoSuchCORSConfiguration, errCodeNotImplemented, errCodeXNotImplemented) {
return sdkdiag.AppendErrorf(diags, "getting S3 Bucket CORS configuration: %s", err)
}

Expand Down Expand Up @@ -906,7 +906,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf
if err != nil && !tfawserr.ErrCodeEquals(err,
errCodeMethodNotAllowed,
errCodeNotImplemented,
ErrCodeNoSuchWebsiteConfiguration,
errCodeNoSuchWebsiteConfiguration,
errCodeXNotImplemented,
) {
return sdkdiag.AppendErrorf(diags, "getting S3 Bucket website configuration: %s", err)
Expand Down
10 changes: 10 additions & 0 deletions internal/service/s3/bucket_accelerate_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ func resourceBucketAccelerateConfigurationCreate(ctx context.Context, d *schema.

d.SetId(CreateResourceID(bucket, expectedBucketOwner))

_, err = tfresource.RetryWhenNotFound(ctx, s3BucketPropagationTimeout, func() (interface{}, error) {
return findBucketAccelerateConfiguration(ctx, conn, bucket, expectedBucketOwner)
})

if err != nil {
return diag.Errorf("waiting for S3 Bucket Accelerate Configuration (%s) create: %s", d.Id(), err)
}

return resourceBucketAccelerateConfigurationRead(ctx, d, meta)
}

Expand Down Expand Up @@ -165,6 +173,8 @@ func resourceBucketAccelerateConfigurationDelete(ctx context.Context, d *schema.
return diag.Errorf("deleting S3 Bucket Accelerate Configuration (%s): %s", d.Id(), err)
}

// Don't wait for the accelerate configuration to disappear as it still exists after suspension.

return nil
}

Expand Down
Loading

0 comments on commit 1346c46

Please sign in to comment.