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

r/aws_s3_object: Migrate to AWS SDK for Go v2 #33358

Merged
merged 62 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6164986
s3: 'ObjectUpdateTags' -> 'ObjectUpdateTagsV1'.
ewbankkit Sep 7, 2023
64a82e6
s3: Add 'ObjectUpdateTags'.
ewbankkit Sep 7, 2023
df86185
Run 'go get github.com/aws/aws-sdk-go-v2/feature/s3/[email protected]
ewbankkit Sep 7, 2023
8b08857
r/aws_s3_object_copy: Tweak error message.
ewbankkit Sep 7, 2023
591a9d9
Fixup 'ObjectUpdateTags'.
ewbankkit Sep 7, 2023
438ce49
r/aws_s3_object: Migrate to AWS SDK for Go v2.
ewbankkit Sep 7, 2023
8ecd1b9
TestDeleteAllObjectVersions: Migrate to AWS SDK for Go v2.
ewbankkit Sep 7, 2023
845af9a
ObjectListTags: Remove retry as there is now string consistency for r…
ewbankkit Sep 7, 2023
e57f697
s3: 'errs.IsA' doesn't work as expected because the errors in 'types'…
ewbankkit Sep 7, 2023
457bda2
resourceObjectRead: Remove retry as there is now strong read-after-wr…
ewbankkit Sep 7, 2023
a2c8dbb
r/aws_s3_object: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Sep 7, 2023
702161d
Use 'cmp.Diff', not 'reflect.DeppEqual'.
ewbankkit Sep 7, 2023
74955e1
s3: Fix sweepers.
ewbankkit Sep 7, 2023
8fd99e9
Fix golangci-lint 'ineffassign'.
ewbankkit Sep 7, 2023
c702171
s3: 'DeleteAllObjectVersions' -> 'deleteAllObjectVersions'.
ewbankkit Sep 8, 2023
5428ce0
s3: 'FindObjectByThreePartKey' -> 'findObjectByThreePartKey'.
ewbankkit Sep 8, 2023
1e9cd4a
Add 'findObject'.
ewbankkit Sep 8, 2023
452c073
r/aws_s3_object: Add `checksum_algorithm` argument and `checksum_crc3…
ewbankkit Sep 8, 2023
d6a1f93
Enhance 'TestAccS3Object_basic'.
ewbankkit Sep 8, 2023
e30e3fb
Acceptance test output:
ewbankkit Sep 8, 2023
6f41bd4
Add 'TestAccS3Object_checksumAlgorithm'.
ewbankkit Sep 8, 2023
21b5d46
Acceptance test output:
ewbankkit Sep 8, 2023
b87f312
r/aws_s3_object_copy: Add `checksum_algorithm` argument and `checksum…
ewbankkit Sep 8, 2023
0830d99
Acceptance test output:
ewbankkit Sep 8, 2023
ffe2dcd
Fix 'Content-MD5 OR x-amz-checksum- HTTP header is required for Put O…
ewbankkit Sep 8, 2023
75e7b39
Add 'TestAccS3ObjectCopy_objectLockLegalHold'.
ewbankkit Sep 8, 2023
69f5c19
Acceptance test output:
ewbankkit Sep 8, 2023
598090a
Fix 'TestAccS3ObjectCopy_basic'.
ewbankkit Sep 8, 2023
7de05be
d/aws_s3_object: Migrate to AWS SDK for Go v2.
ewbankkit Sep 8, 2023
9db50a6
Remove 'testAccCheckObjectExistsDataSource'.
ewbankkit Sep 9, 2023
a144173
d/aws_s3_object: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Sep 9, 2023
57be0f2
Acceptance test output:
ewbankkit Sep 9, 2023
7552904
Add 'TestAccS3ObjectCopy_targetWithMultipleSlashes'.
ewbankkit Sep 9, 2023
7014254
Acceptance test output:
ewbankkit Sep 9, 2023
ca409e7
Add TODO comments.
ewbankkit Sep 10, 2023
e1bee5b
Fix providerlint 'R004: ResourceData.Set() incompatible value type: *…
ewbankkit Sep 10, 2023
1e1f125
r/aws_s3_object_copy: Remove 'aws_s3_bucket.force_destroy' from accep…
ewbankkit Sep 10, 2023
139ce33
Acceptance test output:
ewbankkit Sep 10, 2023
860e0d3
d/aws_s3_object: Add `checksum_mode` argument and `checksum_crc32`, `…
ewbankkit Sep 10, 2023
9c401db
Acceptance test output:
ewbankkit Sep 10, 2023
3bb4cac
d/aws_s3_object: Use S3 downloader.
ewbankkit Sep 11, 2023
fbec9d9
r/aws_s3_object: Tidy up acceptance test check functions.
ewbankkit Sep 11, 2023
0b2e33f
Add 'TestAccS3ObjectCopy_targetWithMultipleSlashesMigrated'.
ewbankkit Sep 11, 2023
2a72e76
Acceptance test output:
ewbankkit Sep 11, 2023
594609a
s3: Add 'sdkv1CompatibleCleanKey'.
ewbankkit Sep 11, 2023
b41213f
r/aws_s3_object_copy: Use 'sdkv1CompatibleCleanKey'.
ewbankkit Sep 11, 2023
91fcd0c
Acceptance test output:
ewbankkit Sep 11, 2023
4182f2b
Add 'TestAccS3Object_keyWithSlashesMigrated'.
ewbankkit Sep 11, 2023
ca8c798
Acceptance test output:
ewbankkit Sep 11, 2023
55f8d29
r/aws_s3_object: Use 'sdkv1CompatibleCleanKey'.
ewbankkit Sep 11, 2023
55100be
Acceptance test output:
ewbankkit Sep 11, 2023
53d08ef
Tweak comment.
ewbankkit Sep 12, 2023
31cdf17
Add AWSClient.S3UsePathStyle -- used by S3 sweepers.
ewbankkit Sep 12, 2023
62f2c2b
s3: Migrate sweepers to AWS SDK for Go v2.
ewbankkit Sep 12, 2023
56fc1af
Revert "r/aws_s3_object(test): fixed _tags post destroy bucket deleti…
ewbankkit Sep 12, 2023
e7046aa
Acceptance test output:
ewbankkit Sep 12, 2023
c54bf83
d/aws_s3_object: Use 'sdkv1CompatibleCleanKey'.
ewbankkit Sep 12, 2023
6c2d115
d/aws_s3_object: 'key = "/"' is no longer supported.
ewbankkit Sep 12, 2023
b8ad2c4
% make testacc TESTARGS='-run=TestAccS3ObjectDataSource_' PKG=s3 ACCT…
ewbankkit Sep 12, 2023
a1fb178
Merge branch 'main' into f-aws_s3_object-aws-sdk-v2
ewbankkit Sep 12, 2023
c541b6f
Fix terrafmt errors.
ewbankkit Sep 12, 2023
26b1cd8
Fix terrafmt errors.
ewbankkit Sep 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/33358.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
resource/aws_s3_object: Add `checksum_algorithm` argument and `checksum_crc32`, `checksum_crc32c`, `checksum_sha1` and `checksum_sha256` attributes
```

```release-note:enhancement
resource/aws_s3_object_copy: Add `checksum_algorithm` argument and `checksum_crc32`, `checksum_crc32c`, `checksum_sha1` and `checksum_sha256` attributes
```
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/aws/aws-sdk-go v1.45.4
github.com/aws/aws-sdk-go-v2 v1.21.0
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.83
github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.20.5
github.com/aws/aws-sdk-go-v2/service/account v1.11.5
github.com/aws/aws-sdk-go-v2/service/acm v1.18.5
Expand Down Expand Up @@ -113,20 +114,20 @@ require (
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.33 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.32 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.39 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.22.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.14 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.35 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.13.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 // indirect
github.com/aws/smithy-go v1.14.2 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
Expand Down
31 changes: 12 additions & 19 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,24 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go v1.45.4 h1:6B8oTYNEncxga8EV1C6Q4iJNnpDIqLEigy0v0oh2qYw=
github.com/aws/aws-sdk-go v1.45.4/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.20.1/go.mod h1:NU06lETsFm8fUC6ZjhgDpVBcGZTFQ6XM+LZWZxMI4ac=
github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc=
github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 h1:OPLEkmhXf6xFPiz0bLeDArZIDx1NNS4oJyG4nv3Gct0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13/go.mod h1:gpAbvyDGQFozTEmlTFO8XcQKHzubdq0LzRyJpG6MiXM=
github.com/aws/aws-sdk-go-v2/config v1.18.33 h1:JKcw5SFxFW/rpM4mOPjv0VQ11E2kxW13F3exWOy7VZU=
github.com/aws/aws-sdk-go-v2/config v1.18.33/go.mod h1:hXO/l9pgY3K5oZJldamP0pbZHdPqqk+4/maa7DSD3cA=
github.com/aws/aws-sdk-go-v2/credentials v1.13.32 h1:lIH1eKPcCY1ylR4B6PkBGRWMHO3aVenOKJHWiS4/G2w=
github.com/aws/aws-sdk-go-v2/credentials v1.13.32/go.mod h1:lL8U3v/Y79YRG69WlAho0OHIKUXCyFvSXaIvfo81sls=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8/go.mod h1:ce7BgLQfYr5hQFdy67oX2svto3ufGtm6oBvmsHScI1Q=
github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ=
github.com/aws/aws-sdk-go-v2/config v1.18.39/go.mod h1:+NH/ZigdPckFpgB1TRcRuWCB/Kbbvkxc/iNAKTq5RhE=
github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3wIeB6pw7vPRM4M9/U=
github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38/go.mod h1:qggunOChCMu9ZF/UkAfhTz25+U2rLVb3ya0Ua6TTfCA=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.83 h1:wcluDLIQ0uYaxv0fCWQRimbXkPdTgWHUD21j1CzXEwc=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.83/go.mod h1:nGCBuon134gW67yAtxHKV73x+tAcY/xG4ZPNPDB1h/I=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32/go.mod h1:0ZXSqrty4FtQ7p8TEuRde/SZm9X05KT18LAUlR40Ln0=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 h1:fc0ukRAiP1syoSGZYu+DaE+FulSYhTiJ8WpVu5jElU4=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39/go.mod h1:WLAW8PT7+JhjZfLSWe7WEJaJu0GNo0cKc2Zyo003RBs=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 h1:GPUcE/Yq7Ur8YSUk6lVkoIMWnJNO0HT18GUzCWCgCI0=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4 h1:6lJvvkQ9HmbHZ4h/IEwclwv2mrTW8Uq1SOB/kXy0mfw=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4/go.mod h1:1PrKYwxTM+zjpw9Y41KFtoJCQrJ34Z47Y4VgVbfndjo=
github.com/aws/aws-sdk-go-v2/service/accessanalyzer v1.20.5 h1:1w0ELQMC3AptxEFS4A+vJuhyIuC9IoNN2YxNKK5pSYQ=
Expand Down Expand Up @@ -100,7 +98,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36 h1:eev2yZX7esGRjq
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36/go.mod h1:lGnOkH9NJATw0XEPcAknFBj3zzNTEGRHtSw+CwC1YTg=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.35 h1:UKjpIDLVF90RfV88XurdduMoTxPqtGHZMIDYZQM7RO4=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.35/go.mod h1:B3dUg0V6eJesUTi+m27NUkj7n8hdDKYUpxj8f4+TqaQ=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32/go.mod h1:4jwAWKEkCR0anWk5+1RbfSg1R5Gzld7NLiuaq5bTR/Y=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4 h1:v0jkRigbSD6uOdwcaUQmgEwG1BkPfAPDqaeNt/29ghg=
Expand Down Expand Up @@ -165,13 +162,10 @@ github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.16.5 h1:kt2JpBjKnG2GfiHJU0es
github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.16.5/go.mod h1:g6xJdpynIx7D1UW9te8ul36qWGyuzIL6ATrJF6E6ygI=
github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.22.5 h1:1PesErC0GN25MaKtBju52HlJOXtLeFoAsOxAgHhEoCk=
github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.22.5/go.mod h1:11Z2L2mDhJbRZo5rwRs1NPz1Vi37U5N1EiaazEoBGag=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.2/go.mod h1:ju+nNXUunfIFamXUIZQiICjnO/TPlOmWcYhZcSy7xaE=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.5 h1:oCvTFSDi67AX0pOX3PuPdGFewvLRU2zzFSrTsgURNo0=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.5/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2/go.mod h1:ubDBBaDFs1GHijSOTi8ljppML15GLG0HxhILtbjNNYQ=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.5 h1:dnInJb4S0oy8aQuri1mV6ipLlnZPfnsDNB9BGO9PDNY=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.5/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.2/go.mod h1:FQ/DQcOfESELfJi5ED+IPPAjI5xC6nxtSolVVB773jM=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 h1:2PylFCfKCEDv6PeSN09pC/VUiRd10wi1VfHG5FrW0/g=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.6/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsytWHWKxg+NgyGV4B2L58=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvTZW2S44Lt9Mk2aYQ=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU=
github.com/aws/aws-sdk-go-v2/service/swf v1.17.3 h1:E2i7UVmrS7D+RqvOHdv/6pag549LNrR+W8x8z+fwFWo=
Expand All @@ -188,7 +182,6 @@ github.com/aws/aws-sdk-go-v2/service/workspaces v1.29.5 h1:WE+Y5exd/Jowh2eVl2vmd
github.com/aws/aws-sdk-go-v2/service/workspaces v1.29.5/go.mod h1:AVjfc8q87mKUZgiW4NjqJgG1OzcFIO6OHyfkOQSrPSY=
github.com/aws/aws-sdk-go-v2/service/xray v1.17.5 h1:fJ7KMcuZXBfmK0A8ZfMZIKle0/WuiZwOl+JDpR+LV4I=
github.com/aws/aws-sdk-go-v2/service/xray v1.17.5/go.mod h1:aE2t25bCn8YrfL6faz73m5Q/7gKa25HjCoa+z6OQMG4=
github.com/aws/smithy-go v1.14.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ=
github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/beevik/etree v1.2.0 h1:l7WETslUG/T+xOPs47dtd6jov2Ii/8/OjCldk5fYfQw=
Expand Down
4 changes: 4 additions & 0 deletions internal/conns/awsclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func (client *AWSClient) RegionalHostname(prefix string) string {
return fmt.Sprintf("%s.%s.%s", prefix, client.Region, client.DNSSuffix)
}

// ****************
// TODO: REVIEW
// TODO: AWS SDK for Go v2 does NO URL cleaning.
// ****************
ewbankkit marked this conversation as resolved.
Show resolved Hide resolved
func (client *AWSClient) S3ConnURICleaningDisabled(ctx context.Context) *s3_sdkv1.S3 {
config := client.S3Conn(ctx).Config
config.DisableRestProtocolURICleaning = aws_sdkv1.Bool(true)
Expand Down
9 changes: 6 additions & 3 deletions internal/service/s3/bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ func resourceBucketObjectCreate(ctx context.Context, d *schema.ResourceData, met
}

func resourceBucketObjectRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
const (
objectCreationTimeout = 2 * time.Minute
)
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).S3Conn(ctx)

Expand Down Expand Up @@ -349,7 +352,7 @@ func resourceBucketObjectUpdate(ctx context.Context, d *schema.ResourceData, met
if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")

if err := ObjectUpdateTags(ctx, conn, bucket, key, o, n); err != nil {
if err := ObjectUpdateTagsV1(ctx, conn, bucket, key, o, n); err != nil {
return sdkdiag.AppendErrorf(diags, "updating S3 Bucket (%s) Object (%s) tags: %s", bucket, key, err)
}
}
Expand All @@ -359,7 +362,7 @@ func resourceBucketObjectUpdate(ctx context.Context, d *schema.ResourceData, met

func resourceBucketObjectDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).S3Conn(ctx)
conn := meta.(*conns.AWSClient).S3Client(ctx)

bucket := d.Get("bucket").(string)
key := d.Get("key").(string)
Expand All @@ -370,7 +373,7 @@ func resourceBucketObjectDelete(ctx context.Context, d *schema.ResourceData, met

var err error
if _, ok := d.GetOk("version_id"); ok {
_, err = DeleteAllObjectVersions(ctx, conn, bucket, key, d.Get("force_destroy").(bool), false)
_, err = deleteAllObjectVersions(ctx, conn, bucket, key, d.Get("force_destroy").(bool), false)
} else {
err = deleteObjectVersion(ctx, conn, bucket, key, "", false)
}
Expand Down
Loading
Loading