Skip to content

Commit

Permalink
Add 'aws/internal/service/s3' package.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Sep 13, 2020
1 parent 3fca757 commit 654e978
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aws/internal/keyvaluetags/s3_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/hashicorp/aws-sdk-go-base/tfawserr"
tfs3 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/s3"
)

// Custom S3 tag service update functions using the same format as generated code.
Expand All @@ -24,7 +25,7 @@ func S3BucketListTags(conn *s3.S3, identifier string) (KeyValueTags, error) {
// S3 API Reference (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html)
// lists the special error as NoSuchTagSetError, however the existing logic used NoSuchTagSet
// and the AWS Go SDK has neither as a constant.
if tfawserr.ErrCodeEquals(err, "NoSuchTagSet") {
if tfawserr.ErrCodeEquals(err, tfs3.NoSuchTagSet) {
return New(nil), nil
}

Expand Down
5 changes: 5 additions & 0 deletions aws/internal/service/s3/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package s3

const (
NoSuchTagSet = "NoSuchTagSet"
)
3 changes: 3 additions & 0 deletions aws/resource_aws_s3_bucket_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,9 @@ func TestAccAWSS3BucketObject_ignoreTags(t *testing.T) {
testAccCheckAWSS3BucketObjectBody(&obj, "stuff"),
testAccCheckAWSS3BucketObjectUpdateTags(resourceName, nil, map[string]string{"ignorekey1": "ignorevalue1"}),
resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
testAccCheckAWSS3BucketObjectCheckTags(resourceName, map[string]string{
"ignorekey1": "ignorevalue1",
}),
),
},
{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_s3_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ func TestAccAWSS3Bucket_ignoreTags(t *testing.T) {
testAccCheckAWSS3BucketExists(resourceName),
testAccCheckAWSS3BucketUpdateTags(resourceName, nil, map[string]string{"ignorekey1": "ignorevalue1"}),
resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
testAccCheckAWSS3BucketCheckTags(resourceName, map[string]string{
"ignorekey1": "ignorevalue1",
}),
),
},
{
Expand Down

0 comments on commit 654e978

Please # to comment.