From abe0cd9d5fa0acd8ccb4659a67ed899d385f7cfc Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 10 Mar 2022 21:10:32 -0500 Subject: [PATCH] Rebase and add changelog entry --- .changelog/13366.txt | 3 +++ internal/service/s3/bucket.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/13366.txt diff --git a/.changelog/13366.txt b/.changelog/13366.txt new file mode 100644 index 000000000000..8cd5dca012eb --- /dev/null +++ b/.changelog/13366.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_s3_bucket: Add error handling for `NotImplemented` errors when reading `object_lock_enabled` and `object_lock_configuration` into terraform state. +``` \ No newline at end of file diff --git a/internal/service/s3/bucket.go b/internal/service/s3/bucket.go index 130bf8fd4c3a..9e1ba8d0062b 100644 --- a/internal/service/s3/bucket.go +++ b/internal/service/s3/bucket.go @@ -1150,7 +1150,7 @@ func resourceBucketRead(d *schema.ResourceData, meta interface{}) error { } // Object lock not supported in all partitions (extra guard, also guards in read func) - if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeMethodNotAllowed, ErrCodeObjectLockConfigurationNotFound) { + if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeMethodNotAllowed, ErrCodeNotImplemented, ErrCodeObjectLockConfigurationNotFound) { if meta.(*conns.AWSClient).Partition == endpoints.AwsPartitionID || meta.(*conns.AWSClient).Partition == endpoints.AwsUsGovPartitionID { return fmt.Errorf("error getting S3 Bucket (%s) Object Lock configuration: %w", d.Id(), err) }