Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate aws_s3_bucket_lifecycle_configuration and aws_s3_bucket_replication_configuration to AWS SDK for Go v2 #34504

Merged
merged 8 commits into from
Nov 22, 2023
3 changes: 3 additions & 0 deletions .changelog/34504.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_s3_bucket_logging: Add `target_object_key_format` configuration block to support [automatic date-based partitioning](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html#server-access-logging-overview)
```
4 changes: 4 additions & 0 deletions .ci/.golangci2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ issues:
- staticcheck
path: "internal/service/s3"
text: "SA1019: \\w+.(\\w+) is deprecated: (\\w+) has been deprecated"
- linters:
- staticcheck
path: "internal/service/s3"
text: "SA1019: \\w+.(\\w+) is deprecated: This member has been deprecated"
- linters:
- staticcheck
path: internal/service/securityhub/
Expand Down
8 changes: 6 additions & 2 deletions internal/service/s3/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ import (

const (
resNameBucket = "Bucket"

// General timeout for S3 bucket changes to propagate.
// See https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html#ConsistencyModel.
s3BucketPropagationTimeout = 2 * time.Minute // nosemgrep:ci.s3-in-const-name, ci.s3-in-var-name
)

// @SDKResource("aws_s3_bucket", name="Bucket")
Expand Down Expand Up @@ -1047,7 +1051,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf
return diags
}

if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNoSuchLifecycleConfiguration, errCodeNotImplemented, errCodeXNotImplemented) {
if err != nil && !tfawserr.ErrCodeEquals(err, errCodeNoSuchLifecycleConfiguration, errCodeNotImplemented, errCodeXNotImplemented) {
return sdkdiag.AppendErrorf(diags, "getting S3 Bucket (%s) Lifecycle Configuration: %s", d.Id(), err)
}

Expand Down Expand Up @@ -1076,7 +1080,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf
return diags
}

if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeReplicationConfigurationNotFound, errCodeNotImplemented, errCodeXNotImplemented) {
if err != nil && !tfawserr.ErrCodeEquals(err, errCodeReplicationConfigurationNotFound, errCodeNotImplemented, errCodeXNotImplemented) {
return sdkdiag.AppendErrorf(diags, "getting S3 Bucket replication: %s", err)
}

Expand Down
Loading
Loading