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

add override_provider block to s3 object copy #40689

Merged

Conversation

jafournier
Copy link

@jafournier jafournier commented Dec 24, 2024

Description
The override_provider block has already been introduced on aws_s3_object resource to allow ingoring provider default tags here.
This MR introduces this same option to the aws_s3_object_copy resource.
This option allows users to ignore default tags set at the provider level when managing S3 object copy resources.

Organizations that utilize a large number of default tags can encounter limitations when working with S3 objects due to the maximum tag limit (currently 10). This change enables users to more easily work with S3 objects in such environments by providing the option to ignore default tags, thus avoiding the need for aliasing providers to mitigate the tag limitation.

Relations
Relates #19895.
Relates #21273.
Relates #33262.

Output from Acceptance Testing

% make testacc TESTS=TestAccS3ObjectCopy_DefaultTags PKG=s3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3ObjectCopy_DefaultTags'  -timeout 360m
2024/12/24 10:34:02 Initializing Terraform AWS Provider...
=== RUN   TestAccS3ObjectCopy_DefaultTags_providerOnly
=== PAUSE TestAccS3ObjectCopy_DefaultTags_providerOnly
=== RUN   TestAccS3ObjectCopy_DefaultTags_providerAndResource
=== PAUSE TestAccS3ObjectCopy_DefaultTags_providerAndResource
=== RUN   TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride
=== PAUSE TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride
=== CONT  TestAccS3ObjectCopy_DefaultTags_providerOnly
=== CONT  TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride
=== CONT  TestAccS3ObjectCopy_DefaultTags_providerAndResource
--- PASS: TestAccS3ObjectCopy_DefaultTags_providerOnly (20.80s)
--- PASS: TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride (35.88s)
--- PASS: TestAccS3ObjectCopy_DefaultTags_providerAndResource (36.28s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	41.314s

@jafournier jafournier requested a review from a team as a code owner December 24, 2024 09:43
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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3 Issues and PRs that pertain to the s3 service. needs-triage Waiting for first response or review from a maintainer. labels Dec 24, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @jafournier 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@jafournier jafournier changed the title add ignore_default_tags option to s3 object copy add override_provider block to s3 object copy Jan 6, 2025
@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 6, 2025
ewbankkit
ewbankkit previously approved these changes Jan 6, 2025
Copy link
Contributor

@ewbankkit ewbankkit 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 TESTARGS='-run=TestAccS3ObjectCopy_' PKG=s3 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/s3/... -v -count 1 -parallel 3  -run=TestAccS3ObjectCopy_ -timeout 360m
2025/01/06 14:35:32 Initializing Terraform AWS Provider...
=== RUN   TestAccS3ObjectCopy_tags
=== PAUSE TestAccS3ObjectCopy_tags
=== RUN   TestAccS3ObjectCopy_tags_null
=== PAUSE TestAccS3ObjectCopy_tags_null
=== RUN   TestAccS3ObjectCopy_tags_EmptyMap
=== PAUSE TestAccS3ObjectCopy_tags_EmptyMap
=== RUN   TestAccS3ObjectCopy_tags_AddOnUpdate
=== PAUSE TestAccS3ObjectCopy_tags_AddOnUpdate
=== RUN   TestAccS3ObjectCopy_tags_EmptyTag_OnCreate
=== PAUSE TestAccS3ObjectCopy_tags_EmptyTag_OnCreate
=== RUN   TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_providerOnly
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_providerOnly
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_nonOverlapping
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_overlapping
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_overlapping
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_nullOverlappingResourceTag
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_nullOverlappingResourceTag
=== RUN   TestAccS3ObjectCopy_tags_DefaultTags_nullNonOverlappingResourceTag
=== PAUSE TestAccS3ObjectCopy_tags_DefaultTags_nullNonOverlappingResourceTag
=== RUN   TestAccS3ObjectCopy_tags_ComputedTag_OnCreate
=== PAUSE TestAccS3ObjectCopy_tags_ComputedTag_OnCreate
=== RUN   TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_DefaultTag
=== PAUSE TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_ResourceTag
=== PAUSE TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccS3ObjectCopy_basic
=== PAUSE TestAccS3ObjectCopy_basic
=== RUN   TestAccS3ObjectCopy_disappears
=== PAUSE TestAccS3ObjectCopy_disappears
=== RUN   TestAccS3ObjectCopy_metadata
=== PAUSE TestAccS3ObjectCopy_metadata
=== RUN   TestAccS3ObjectCopy_grant
=== PAUSE TestAccS3ObjectCopy_grant
=== RUN   TestAccS3ObjectCopy_BucketKeyEnabled_bucket
=== PAUSE TestAccS3ObjectCopy_BucketKeyEnabled_bucket
=== RUN   TestAccS3ObjectCopy_BucketKeyEnabled_object
=== PAUSE TestAccS3ObjectCopy_BucketKeyEnabled_object
=== RUN   TestAccS3ObjectCopy_DefaultTags_providerOnly
=== PAUSE TestAccS3ObjectCopy_DefaultTags_providerOnly
=== RUN   TestAccS3ObjectCopy_DefaultTags_providerAndResource
=== PAUSE TestAccS3ObjectCopy_DefaultTags_providerAndResource
=== RUN   TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride
=== PAUSE TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride
=== RUN   TestAccS3ObjectCopy_sourceWithSlashes
=== PAUSE TestAccS3ObjectCopy_sourceWithSlashes
=== RUN   TestAccS3ObjectCopy_checksumAlgorithm
=== PAUSE TestAccS3ObjectCopy_checksumAlgorithm
=== RUN   TestAccS3ObjectCopy_objectLockLegalHold
=== PAUSE TestAccS3ObjectCopy_objectLockLegalHold
=== RUN   TestAccS3ObjectCopy_targetWithMultipleSlashes
=== PAUSE TestAccS3ObjectCopy_targetWithMultipleSlashes
=== RUN   TestAccS3ObjectCopy_targetWithMultipleSlashesMigrated
=== PAUSE TestAccS3ObjectCopy_targetWithMultipleSlashesMigrated
=== RUN   TestAccS3ObjectCopy_directoryBucket
=== PAUSE TestAccS3ObjectCopy_directoryBucket
=== RUN   TestAccS3ObjectCopy_basicViaAccessPoint
=== PAUSE TestAccS3ObjectCopy_basicViaAccessPoint
=== CONT  TestAccS3ObjectCopy_tags
=== CONT  TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_DefaultTag
=== CONT  TestAccS3ObjectCopy_DefaultTags_providerAndResource
--- PASS: TestAccS3ObjectCopy_DefaultTags_providerAndResource (23.29s)
=== CONT  TestAccS3ObjectCopy_basicViaAccessPoint
--- PASS: TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_DefaultTag (39.91s)
=== CONT  TestAccS3ObjectCopy_directoryBucket
--- PASS: TestAccS3ObjectCopy_basicViaAccessPoint (19.98s)
=== CONT  TestAccS3ObjectCopy_targetWithMultipleSlashesMigrated
--- PASS: TestAccS3ObjectCopy_tags (53.36s)
=== CONT  TestAccS3ObjectCopy_targetWithMultipleSlashes
--- PASS: TestAccS3ObjectCopy_directoryBucket (17.46s)
=== CONT  TestAccS3ObjectCopy_objectLockLegalHold
--- PASS: TestAccS3ObjectCopy_targetWithMultipleSlashes (14.37s)
=== CONT  TestAccS3ObjectCopy_checksumAlgorithm
--- PASS: TestAccS3ObjectCopy_targetWithMultipleSlashesMigrated (45.32s)
=== CONT  TestAccS3ObjectCopy_sourceWithSlashes
--- PASS: TestAccS3ObjectCopy_objectLockLegalHold (31.72s)
=== CONT  TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride
--- PASS: TestAccS3ObjectCopy_checksumAlgorithm (25.81s)
=== CONT  TestAccS3ObjectCopy_grant
--- PASS: TestAccS3ObjectCopy_grant (16.05s)
=== CONT  TestAccS3ObjectCopy_DefaultTags_providerOnly
--- PASS: TestAccS3ObjectCopy_DefaultTags_providerAndResourceWithOverride (23.65s)
=== CONT  TestAccS3ObjectCopy_BucketKeyEnabled_object
--- PASS: TestAccS3ObjectCopy_sourceWithSlashes (25.62s)
=== CONT  TestAccS3ObjectCopy_BucketKeyEnabled_bucket
--- PASS: TestAccS3ObjectCopy_DefaultTags_providerOnly (13.50s)
=== CONT  TestAccS3ObjectCopy_disappears
--- PASS: TestAccS3ObjectCopy_BucketKeyEnabled_object (14.99s)
=== CONT  TestAccS3ObjectCopy_metadata
--- PASS: TestAccS3ObjectCopy_BucketKeyEnabled_bucket (15.57s)
=== CONT  TestAccS3ObjectCopy_basic
--- PASS: TestAccS3ObjectCopy_disappears (15.42s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccS3ObjectCopy_metadata (15.11s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccS3ObjectCopy_basic (14.88s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_nullNonOverlappingResourceTag (16.33s)
=== CONT  TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_nullOverlappingResourceTag (16.23s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_updateToProviderOnly (30.06s)
=== CONT  TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_emptyProviderOnlyTag (16.25s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Replace (29.19s)
=== CONT  TestAccS3ObjectCopy_tags_ComputedTag_OnCreate
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_emptyResourceTag (16.83s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccS3ObjectCopy_tags_ComputedTag_OnUpdate_Add (29.64s)
=== CONT  TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccS3ObjectCopy_tags_ComputedTag_OnCreate (17.91s)
=== CONT  TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_updateToResourceOnly (30.57s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_nonOverlapping
--- PASS: TestAccS3ObjectCopy_tags_IgnoreTags_Overlap_ResourceTag (43.99s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_providerOnly
--- PASS: TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Add (40.07s)
=== CONT  TestAccS3ObjectCopy_tags_DefaultTags_overlapping
=== CONT  TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_nonOverlapping (45.48s)
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_overlapping (45.62s)
=== CONT  TestAccS3ObjectCopy_tags_AddOnUpdate
--- PASS: TestAccS3ObjectCopy_tags_EmptyTag_OnUpdate_Replace (28.29s)
=== CONT  TestAccS3ObjectCopy_tags_EmptyTag_OnCreate
--- PASS: TestAccS3ObjectCopy_tags_DefaultTags_providerOnly (59.87s)
=== CONT  TestAccS3ObjectCopy_tags_EmptyMap
--- PASS: TestAccS3ObjectCopy_tags_AddOnUpdate (28.09s)
=== CONT  TestAccS3ObjectCopy_tags_null
--- PASS: TestAccS3ObjectCopy_tags_EmptyMap (20.94s)
--- PASS: TestAccS3ObjectCopy_tags_EmptyTag_OnCreate (27.85s)
--- PASS: TestAccS3ObjectCopy_tags_null (21.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	347.392s

website/docs/r/s3_object_copy.html.markdown Outdated Show resolved Hide resolved
internal/service/s3/object_copy_test.go Outdated Show resolved Hide resolved
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 🚀

@ewbankkit
Copy link
Contributor

@jafournier Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 598c2c4 into hashicorp:main Jan 7, 2025
47 checks passed
@github-actions github-actions bot added this to the v5.83.0 milestone Jan 7, 2025
Copy link

github-actions bot commented Jan 9, 2025

This functionality has been released in v5.83.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. 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.

3 participants