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

AWS S3 Object: Support seamless upgrade from provider v4.x #33138

Merged
merged 5 commits into from
Aug 22, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Aug 22, 2023

Description

Marks acl as Computed for the aws_s3_object and aws_s3_object_copy resources.
This prevents diffs when migrating configurations with no configured acl value from Terraform AWS Provider v4.67.0 (and earlier).
The previous default value of private was removed at v5.0.0.

Relations

Closes #31633.
Relates #27197.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccS3Object_' PKG=s3 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 2  -run=TestAccS3Object_ -timeout 180m
=== RUN   TestAccS3Object_noNameNoKey
=== PAUSE TestAccS3Object_noNameNoKey
=== RUN   TestAccS3Object_empty
=== PAUSE TestAccS3Object_empty
=== RUN   TestAccS3Object_source
=== PAUSE TestAccS3Object_source
=== RUN   TestAccS3Object_content
=== PAUSE TestAccS3Object_content
=== RUN   TestAccS3Object_etagEncryption
=== PAUSE TestAccS3Object_etagEncryption
=== RUN   TestAccS3Object_contentBase64
=== PAUSE TestAccS3Object_contentBase64
=== RUN   TestAccS3Object_sourceHashTrigger
=== PAUSE TestAccS3Object_sourceHashTrigger
=== RUN   TestAccS3Object_withContentCharacteristics
=== PAUSE TestAccS3Object_withContentCharacteristics
=== RUN   TestAccS3Object_nonVersioned
=== PAUSE TestAccS3Object_nonVersioned
=== RUN   TestAccS3Object_updates
=== PAUSE TestAccS3Object_updates
=== RUN   TestAccS3Object_updateSameFile
=== PAUSE TestAccS3Object_updateSameFile
=== RUN   TestAccS3Object_updatesWithVersioning
=== PAUSE TestAccS3Object_updatesWithVersioning
=== RUN   TestAccS3Object_updatesWithVersioningViaAccessPoint
=== PAUSE TestAccS3Object_updatesWithVersioningViaAccessPoint
=== RUN   TestAccS3Object_kms
=== PAUSE TestAccS3Object_kms
=== RUN   TestAccS3Object_sse
=== PAUSE TestAccS3Object_sse
=== RUN   TestAccS3Object_acl
=== PAUSE TestAccS3Object_acl
=== RUN   TestAccS3Object_metadata
=== PAUSE TestAccS3Object_metadata
=== RUN   TestAccS3Object_storageClass
=== PAUSE TestAccS3Object_storageClass
=== RUN   TestAccS3Object_tags
=== PAUSE TestAccS3Object_tags
=== RUN   TestAccS3Object_tagsLeadingSingleSlash
=== PAUSE TestAccS3Object_tagsLeadingSingleSlash
=== RUN   TestAccS3Object_tagsLeadingMultipleSlashes
=== PAUSE TestAccS3Object_tagsLeadingMultipleSlashes
=== RUN   TestAccS3Object_tagsMultipleSlashes
=== PAUSE TestAccS3Object_tagsMultipleSlashes
=== RUN   TestAccS3Object_objectLockLegalHoldStartWithNone
=== PAUSE TestAccS3Object_objectLockLegalHoldStartWithNone
=== RUN   TestAccS3Object_objectLockLegalHoldStartWithOn
=== PAUSE TestAccS3Object_objectLockLegalHoldStartWithOn
=== RUN   TestAccS3Object_objectLockRetentionStartWithNone
=== PAUSE TestAccS3Object_objectLockRetentionStartWithNone
=== RUN   TestAccS3Object_objectLockRetentionStartWithSet
=== PAUSE TestAccS3Object_objectLockRetentionStartWithSet
=== RUN   TestAccS3Object_objectBucketKeyEnabled
=== PAUSE TestAccS3Object_objectBucketKeyEnabled
=== RUN   TestAccS3Object_bucketBucketKeyEnabled
=== PAUSE TestAccS3Object_bucketBucketKeyEnabled
=== RUN   TestAccS3Object_defaultBucketSSE
=== PAUSE TestAccS3Object_defaultBucketSSE
=== RUN   TestAccS3Object_ignoreTags
=== PAUSE TestAccS3Object_ignoreTags
=== CONT  TestAccS3Object_noNameNoKey
=== CONT  TestAccS3Object_objectLockLegalHoldStartWithOn
--- PASS: TestAccS3Object_noNameNoKey (4.02s)
=== CONT  TestAccS3Object_bucketBucketKeyEnabled
--- PASS: TestAccS3Object_bucketBucketKeyEnabled (26.79s)
=== CONT  TestAccS3Object_ignoreTags
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithOn (53.31s)
=== CONT  TestAccS3Object_defaultBucketSSE
--- PASS: TestAccS3Object_defaultBucketSSE (27.08s)
=== CONT  TestAccS3Object_tagsLeadingSingleSlash
--- PASS: TestAccS3Object_ignoreTags (54.60s)
=== CONT  TestAccS3Object_objectLockLegalHoldStartWithNone
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithNone (78.04s)
=== CONT  TestAccS3Object_tagsMultipleSlashes
--- PASS: TestAccS3Object_tagsLeadingSingleSlash (105.02s)
=== CONT  TestAccS3Object_tagsLeadingMultipleSlashes
--- PASS: TestAccS3Object_tagsMultipleSlashes (100.99s)
=== CONT  TestAccS3Object_objectLockRetentionStartWithSet
=== CONT  TestAccS3Object_objectBucketKeyEnabled
--- PASS: TestAccS3Object_tagsLeadingMultipleSlashes (102.57s)
--- PASS: TestAccS3Object_objectBucketKeyEnabled (26.73s)
=== CONT  TestAccS3Object_storageClass
--- PASS: TestAccS3Object_objectLockRetentionStartWithSet (103.64s)
=== CONT  TestAccS3Object_tags
--- PASS: TestAccS3Object_storageClass (114.17s)
=== CONT  TestAccS3Object_objectLockRetentionStartWithNone
--- PASS: TestAccS3Object_tags (106.04s)
=== CONT  TestAccS3Object_metadata
--- PASS: TestAccS3Object_objectLockRetentionStartWithNone (77.51s)
=== CONT  TestAccS3Object_nonVersioned
    acctest.go:1603: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccS3Object_nonVersioned (0.00s)
=== CONT  TestAccS3Object_sse
--- PASS: TestAccS3Object_sse (30.49s)
=== CONT  TestAccS3Object_kms
--- PASS: TestAccS3Object_metadata (73.46s)
=== CONT  TestAccS3Object_updatesWithVersioningViaAccessPoint
--- PASS: TestAccS3Object_kms (31.50s)
=== CONT  TestAccS3Object_updatesWithVersioning
--- PASS: TestAccS3Object_updatesWithVersioningViaAccessPoint (58.69s)
=== CONT  TestAccS3Object_updateSameFile
--- PASS: TestAccS3Object_updatesWithVersioning (58.02s)
=== CONT  TestAccS3Object_updates
--- PASS: TestAccS3Object_updateSameFile (55.11s)
=== CONT  TestAccS3Object_etagEncryption
--- PASS: TestAccS3Object_updates (58.82s)
=== CONT  TestAccS3Object_withContentCharacteristics
--- PASS: TestAccS3Object_etagEncryption (31.22s)
=== CONT  TestAccS3Object_sourceHashTrigger
--- PASS: TestAccS3Object_withContentCharacteristics (27.63s)
=== CONT  TestAccS3Object_contentBase64
--- PASS: TestAccS3Object_contentBase64 (26.19s)
=== CONT  TestAccS3Object_source
--- PASS: TestAccS3Object_sourceHashTrigger (51.63s)
=== CONT  TestAccS3Object_content
--- PASS: TestAccS3Object_source (29.81s)
=== CONT  TestAccS3Object_empty
--- PASS: TestAccS3Object_content (30.06s)
=== CONT  TestAccS3Object_acl
--- PASS: TestAccS3Object_empty (29.51s)
--- PASS: TestAccS3Object_acl (80.54s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	860.133s
% make testacc TESTARGS='-run=TestAccS3Object_upgradeFromV4' PKG=s3 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 2  -run=TestAccS3Object_upgradeFromV4 -timeout 180m
=== RUN   TestAccS3Object_upgradeFromV4
=== PAUSE TestAccS3Object_upgradeFromV4
=== CONT  TestAccS3Object_upgradeFromV4
--- PASS: TestAccS3Object_upgradeFromV4 (77.98s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	83.319s
% make testacc TESTARGS='-run=TestAccS3ObjectCopy_' PKG=s3 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 2  -run=TestAccS3ObjectCopy_ -timeout 180m
=== RUN   TestAccS3ObjectCopy_basic
=== PAUSE TestAccS3ObjectCopy_basic
=== RUN   TestAccS3ObjectCopy_BucketKeyEnabled_bucket
=== PAUSE TestAccS3ObjectCopy_BucketKeyEnabled_bucket
=== RUN   TestAccS3ObjectCopy_BucketKeyEnabled_object
=== PAUSE TestAccS3ObjectCopy_BucketKeyEnabled_object
=== CONT  TestAccS3ObjectCopy_basic
=== CONT  TestAccS3ObjectCopy_BucketKeyEnabled_object
--- PASS: TestAccS3ObjectCopy_BucketKeyEnabled_object (30.58s)
=== CONT  TestAccS3ObjectCopy_BucketKeyEnabled_bucket
--- PASS: TestAccS3ObjectCopy_basic (30.83s)
--- PASS: TestAccS3ObjectCopy_BucketKeyEnabled_bucket (27.73s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	63.931s

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3 Issues and PRs that pertain to the s3 service. labels Aug 22, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 22, 2023
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Aug 22, 2023
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

% make testacc PKG=s3 TESTS=TestAccS3Object_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3Object_'  -timeout 180m

--- PASS: TestAccS3Object_noNameNoKey (7.94s)
=== CONT  TestAccS3Object_defaultBucketSSE
--- PASS: TestAccS3Object_withContentCharacteristics (58.38s)
=== CONT  TestAccS3Object_ignoreTags
--- PASS: TestAccS3Object_bucketBucketKeyEnabled (58.42s)
=== CONT  TestAccS3Object_etagEncryption
--- PASS: TestAccS3Object_contentBase64 (59.65s)
=== CONT  TestAccS3Object_updatesWithVersioning
--- PASS: TestAccS3Object_source (59.80s)
=== CONT  TestAccS3Object_kms
--- PASS: TestAccS3Object_objectBucketKeyEnabled (60.45s)
=== CONT  TestAccS3Object_updatesWithVersioningViaAccessPoint
--- PASS: TestAccS3Object_defaultBucketSSE (53.53s)
=== CONT  TestAccS3Object_storageClass
--- PASS: TestAccS3Object_content (61.82s)
=== CONT  TestAccS3Object_updateSameFile
--- PASS: TestAccS3Object_empty (65.62s)
=== CONT  TestAccS3Object_metadata
--- PASS: TestAccS3Object_sse (67.12s)
=== CONT  TestAccS3Object_updates
--- PASS: TestAccS3Object_upgradeFromV4 (75.81s)
=== CONT  TestAccS3Object_nonVersioned
    acctest.go:1603: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccS3Object_nonVersioned (0.00s)
--- PASS: TestAccS3Object_sourceHashTrigger (108.55s)
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithOn (109.54s)
--- PASS: TestAccS3Object_etagEncryption (56.26s)
--- PASS: TestAccS3Object_kms (57.96s)
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithNone (144.20s)
--- PASS: TestAccS3Object_objectLockRetentionStartWithNone (146.69s)
--- PASS: TestAccS3Object_ignoreTags (91.05s)
--- PASS: TestAccS3Object_updatesWithVersioningViaAccessPoint (90.75s)
--- PASS: TestAccS3Object_updateSameFile (90.39s)
--- PASS: TestAccS3Object_updatesWithVersioning (93.80s)
--- PASS: TestAccS3Object_acl (153.77s)
--- PASS: TestAccS3Object_updates (89.02s)
--- PASS: TestAccS3Object_objectLockRetentionStartWithSet (166.91s)
--- PASS: TestAccS3Object_tagsMultipleSlashes (168.00s)
--- PASS: TestAccS3Object_tagsLeadingMultipleSlashes (170.52s)
--- PASS: TestAccS3Object_metadata (105.22s)
--- PASS: TestAccS3Object_tags (173.32s)
--- PASS: TestAccS3Object_tagsLeadingSingleSlash (173.34s)
--- PASS: TestAccS3Object_storageClass (139.83s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/s3 204.459s
% make testacc PKG=s3 TESTS=TestAccS3ObjectCopy_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3ObjectCopy_'  -timeout 180m

--- PASS: TestAccS3ObjectCopy_BucketKeyEnabled_bucket (23.75s)
--- PASS: TestAccS3ObjectCopy_BucketKeyEnabled_object (23.76s)
--- PASS: TestAccS3ObjectCopy_basic (23.97s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/s3 26.936s

@ewbankkit ewbankkit merged commit 5a91350 into main Aug 22, 2023
63 checks passed
@ewbankkit ewbankkit deleted the b-aws_s3_object-4-to-5-upgrade branch August 22, 2023 20:58
@github-actions github-actions bot added this to the v5.14.0 milestone Aug 22, 2023
github-actions bot pushed a commit that referenced this pull request Aug 22, 2023
@github-actions
Copy link

This functionality has been released in v5.14.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Aug 24, 2023
@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/s3 Issues and PRs that pertain to the s3 service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Migrate aws_s3_object from provider 4 to 5 is not working at first apply
3 participants