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

provider/aws: Enable updates & versioning for s3_bucket_object #5305

Merged

Conversation

radeksimko
Copy link
Member

This is closing #3068 and will help finishing #5239

It also introduces a breaking change - etag is now returned without quotes - frankly I don't see the "quoted" version being useful in any context.

Test plan

$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSS3BucketObject'
TF_ACC=1 GO15VENDOREXPERIMENT=1 go test ./builtin/providers/aws -v -run=AWSS3BucketObject -timeout 120m
=== RUN   TestAccAWSS3BucketObject_source
--- PASS: TestAccAWSS3BucketObject_source (96.96s)
=== RUN   TestAccAWSS3BucketObject_content
--- PASS: TestAccAWSS3BucketObject_content (36.43s)
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (37.41s)
=== RUN   TestAccAWSS3BucketObject_updates
--- PASS: TestAccAWSS3BucketObject_updates (58.90s)
=== RUN   TestAccAWSS3BucketObject_updatesWithVersioning
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (60.36s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    290.076s

// See https://forums.aws.amazon.com/thread.jspa?threadID=44003
d.Set("etag", strings.Trim(*resp.ETag, `"`))

d.Set("version_id", resp.VersionId)
d.SetId(key)
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why doesn't the Put call the Read? I know you didn't change this part but seems like it should

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I guess I didn't feel the need for the extra API call as the output from Put call is providing the basic stuff already? But I don't mind adding it 😉

I guess better safe than sorry!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind that it's not in place - if you feel it's good then i am good with it

@stack72
Copy link
Contributor

stack72 commented Feb 25, 2016

1 small query around Put -> read not happening (as normal convention). But apart form that it looks good and the tests run:

make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSS3BucketObject'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=AWSS3BucketObject -timeout 120m
=== RUN   TestAccAWSS3BucketObject_source
--- PASS: TestAccAWSS3BucketObject_source (30.76s)
=== RUN   TestAccAWSS3BucketObject_content
--- PASS: TestAccAWSS3BucketObject_content (31.57s)
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (29.79s)
=== RUN   TestAccAWSS3BucketObject_updates
--- PASS: TestAccAWSS3BucketObject_updates (47.46s)
=== RUN   TestAccAWSS3BucketObject_updatesWithVersioning
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (49.30s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    188.905s

@radeksimko
Copy link
Member Author

Added the Put -> Read call as requested, also I reran acceptance tests -> all OK, just waiting for Travis now, then I'll merge it.

radeksimko added a commit that referenced this pull request Feb 25, 2016
provider/aws: Enable updates & versioning for s3_bucket_object
@radeksimko radeksimko merged commit 4b8726d into hashicorp:master Feb 25, 2016
@radeksimko radeksimko deleted the f-s3-obj-update-and-versioning branch February 25, 2016 12:19
@ghost
Copy link

ghost commented Apr 27, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants