-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Don't create new S3 object versions when updating just tags or ACL #7138
Conversation
return fmt.Errorf("Error putting object in S3 bucket (%s): %s", bucket, err) | ||
} | ||
|
||
// See https://forums.aws.amazon.com/thread.jspa?threadID=44003 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to set etag
or version_id
here. they're set in resourceAwsS3BucketObjectRead()
.
Acceptance tests after rebase: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3BucketObject_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3BucketObject_ -timeout 120m
=== RUN TestAccAWSS3BucketObject_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== RUN TestAccAWSS3BucketObject_updatesWithVersioning
=== PAUSE TestAccAWSS3BucketObject_updatesWithVersioning
=== RUN TestAccAWSS3BucketObject_kms
=== PAUSE TestAccAWSS3BucketObject_kms
=== RUN TestAccAWSS3BucketObject_sse
=== PAUSE TestAccAWSS3BucketObject_sse
=== RUN TestAccAWSS3BucketObject_acl
=== PAUSE TestAccAWSS3BucketObject_acl
=== RUN TestAccAWSS3BucketObject_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== CONT TestAccAWSS3BucketObject_source
=== CONT TestAccAWSS3BucketObject_kms
=== CONT TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT TestAccAWSS3BucketObject_updates
=== CONT TestAccAWSS3BucketObject_storageClass
=== CONT TestAccAWSS3BucketObject_tags
=== CONT TestAccAWSS3BucketObject_acl
=== CONT TestAccAWSS3BucketObject_sse
=== CONT TestAccAWSS3BucketObject_contentBase64
=== CONT TestAccAWSS3BucketObject_content
=== CONT TestAccAWSS3BucketObject_withContentCharacteristics
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (40.25s)
--- PASS: TestAccAWSS3BucketObject_sse (40.67s)
--- PASS: TestAccAWSS3BucketObject_source (42.87s)
--- PASS: TestAccAWSS3BucketObject_content (43.68s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (44.30s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (63.31s)
--- PASS: TestAccAWSS3BucketObject_updates (66.03s)
--- PASS: TestAccAWSS3BucketObject_kms (67.21s)
--- PASS: TestAccAWSS3BucketObject_acl (87.81s)
--- PASS: TestAccAWSS3BucketObject_storageClass (105.57s)
--- PASS: TestAccAWSS3BucketObject_tags (106.97s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 121.964s |
} | ||
|
||
body = file | ||
defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't leak open file.
@@ -52,6 +52,57 @@ func setTagsS3(conn *s3.S3, d *schema.ResourceData) error { | |||
return nil | |||
} | |||
|
|||
func getTagsS3Object(conn *s3.S3, d *schema.ResourceData) error { | |||
resp, err := retryOnAwsCode(s3.ErrCodeNoSuchKey, func() (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #5841.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this @ewbankkit, LGTM 🚀
--- PASS: TestAccAWSS3BucketObject_source (5.51s)
--- PASS: TestAccAWSS3BucketObject_content (5.89s)
--- PASS: TestAccAWSS3BucketObject_sse (5.95s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (6.05s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (6.44s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (8.96s)
--- PASS: TestAccAWSS3BucketObject_updates (9.16s)
--- PASS: TestAccAWSS3BucketObject_acl (12.66s)
--- PASS: TestAccAWSS3BucketObject_storageClass (15.05s)
--- PASS: TestAccAWSS3BucketObject_tags (15.49s)
--- PASS: TestAccAWSS3BucketObject_kms (24.37s)
This has been released in version 1.56.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Fixes #7130 and #5841.
Acceptance tests: