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_bucket: Migrate FindBucket to AWS SDK for Go v2 #33452

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Sep 13, 2023

Description

Migrates the FindBucket helper function used by the aws_s3_bucket resource to AWS SDK for Go v2.

Relations

Relates #33431.
Relates #33358.
Relates #33330.
Relates #33304.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccS3Bucket_' 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=TestAccS3Bucket_ -timeout 180m
=== RUN   TestAccS3Bucket_Basic_basic
=== PAUSE TestAccS3Bucket_Basic_basic
=== RUN   TestAccS3Bucket_Basic_emptyString
=== PAUSE TestAccS3Bucket_Basic_emptyString
=== RUN   TestAccS3Bucket_Basic_generatedName
=== PAUSE TestAccS3Bucket_Basic_generatedName
=== RUN   TestAccS3Bucket_Basic_namePrefix
=== PAUSE TestAccS3Bucket_Basic_namePrefix
=== RUN   TestAccS3Bucket_Basic_forceDestroy
=== PAUSE TestAccS3Bucket_Basic_forceDestroy
=== RUN   TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== RUN   TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== RUN   TestAccS3Bucket_Basic_acceleration
=== PAUSE TestAccS3Bucket_Basic_acceleration
=== RUN   TestAccS3Bucket_Basic_keyEnabled
=== PAUSE TestAccS3Bucket_Basic_keyEnabled
=== RUN   TestAccS3Bucket_Basic_requestPayer
=== PAUSE TestAccS3Bucket_Basic_requestPayer
=== RUN   TestAccS3Bucket_disappears
=== PAUSE TestAccS3Bucket_disappears
=== RUN   TestAccS3Bucket_Duplicate_basic
=== PAUSE TestAccS3Bucket_Duplicate_basic
=== RUN   TestAccS3Bucket_Duplicate_UsEast1
=== PAUSE TestAccS3Bucket_Duplicate_UsEast1
=== RUN   TestAccS3Bucket_Duplicate_UsEast1AltAccount
=== PAUSE TestAccS3Bucket_Duplicate_UsEast1AltAccount
=== RUN   TestAccS3Bucket_Tags_basic
=== PAUSE TestAccS3Bucket_Tags_basic
=== RUN   TestAccS3Bucket_Tags_withNoSystemTags
=== PAUSE TestAccS3Bucket_Tags_withNoSystemTags
=== RUN   TestAccS3Bucket_Tags_withSystemTags
=== PAUSE TestAccS3Bucket_Tags_withSystemTags
=== RUN   TestAccS3Bucket_Tags_ignoreTags
=== PAUSE TestAccS3Bucket_Tags_ignoreTags
=== RUN   TestAccS3Bucket_Manage_lifecycleBasic
=== PAUSE TestAccS3Bucket_Manage_lifecycleBasic
=== RUN   TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
=== PAUSE TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
=== RUN   TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
=== PAUSE TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
=== RUN   TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
=== PAUSE TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
=== RUN   TestAccS3Bucket_Manage_lifecycleRemove
=== PAUSE TestAccS3Bucket_Manage_lifecycleRemove
=== RUN   TestAccS3Bucket_Manage_objectLock
=== PAUSE TestAccS3Bucket_Manage_objectLock
=== RUN   TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
=== PAUSE TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
=== RUN   TestAccS3Bucket_Manage_objectLock_migrate
=== PAUSE TestAccS3Bucket_Manage_objectLock_migrate
=== RUN   TestAccS3Bucket_Manage_objectLockWithVersioning
=== PAUSE TestAccS3Bucket_Manage_objectLockWithVersioning
=== RUN   TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
=== PAUSE TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
=== RUN   TestAccS3Bucket_Manage_versioning
=== PAUSE TestAccS3Bucket_Manage_versioning
=== RUN   TestAccS3Bucket_Manage_versioningDisabled
=== PAUSE TestAccS3Bucket_Manage_versioningDisabled
=== RUN   TestAccS3Bucket_Manage_MFADeleteDisabled
=== PAUSE TestAccS3Bucket_Manage_MFADeleteDisabled
=== RUN   TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled
=== PAUSE TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled
=== RUN   TestAccS3Bucket_Replication_basic
=== PAUSE TestAccS3Bucket_Replication_basic
=== RUN   TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
=== PAUSE TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
=== RUN   TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
=== PAUSE TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
=== RUN   TestAccS3Bucket_Replication_twoDestination
=== PAUSE TestAccS3Bucket_Replication_twoDestination
=== RUN   TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
=== PAUSE TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
=== RUN   TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
=== PAUSE TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
=== RUN   TestAccS3Bucket_Replication_withoutStorageClass
=== PAUSE TestAccS3Bucket_Replication_withoutStorageClass
=== RUN   TestAccS3Bucket_Replication_expectVersioningValidationError
=== PAUSE TestAccS3Bucket_Replication_expectVersioningValidationError
=== RUN   TestAccS3Bucket_Replication_withoutPrefix
=== PAUSE TestAccS3Bucket_Replication_withoutPrefix
=== RUN   TestAccS3Bucket_Replication_schemaV2
=== PAUSE TestAccS3Bucket_Replication_schemaV2
=== RUN   TestAccS3Bucket_Replication_schemaV2SameRegion
=== PAUSE TestAccS3Bucket_Replication_schemaV2SameRegion
=== RUN   TestAccS3Bucket_Replication_RTC_valid
=== PAUSE TestAccS3Bucket_Replication_RTC_valid
=== RUN   TestAccS3Bucket_Security_corsUpdate
=== PAUSE TestAccS3Bucket_Security_corsUpdate
=== RUN   TestAccS3Bucket_Security_corsDelete
=== PAUSE TestAccS3Bucket_Security_corsDelete
=== RUN   TestAccS3Bucket_Security_corsEmptyOrigin
=== PAUSE TestAccS3Bucket_Security_corsEmptyOrigin
=== RUN   TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
=== PAUSE TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
=== RUN   TestAccS3Bucket_Security_logging
=== PAUSE TestAccS3Bucket_Security_logging
=== RUN   TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
=== PAUSE TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
=== RUN   TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
=== PAUSE TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
=== RUN   TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
=== PAUSE TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
=== RUN   TestAccS3Bucket_Web_simple
=== PAUSE TestAccS3Bucket_Web_simple
=== RUN   TestAccS3Bucket_Web_redirect
=== PAUSE TestAccS3Bucket_Web_redirect
=== RUN   TestAccS3Bucket_Web_routingRules
=== PAUSE TestAccS3Bucket_Web_routingRules
=== CONT  TestAccS3Bucket_Basic_basic
=== CONT  TestAccS3Bucket_Manage_versioning
--- PASS: TestAccS3Bucket_Basic_basic (31.70s)
=== CONT  TestAccS3Bucket_Web_routingRules
--- PASS: TestAccS3Bucket_Manage_versioning (58.19s)
=== CONT  TestAccS3Bucket_Web_redirect
--- PASS: TestAccS3Bucket_Web_routingRules (52.33s)
=== CONT  TestAccS3Bucket_Web_simple
--- PASS: TestAccS3Bucket_Web_redirect (79.28s)
=== CONT  TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
--- PASS: TestAccS3Bucket_Web_simple (75.52s)
=== CONT  TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
--- PASS: TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (49.68s)
=== CONT  TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (31.42s)
=== CONT  TestAccS3Bucket_Security_logging
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical (32.94s)
=== CONT  TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
--- PASS: TestAccS3Bucket_Security_logging (37.18s)
=== CONT  TestAccS3Bucket_Security_corsEmptyOrigin
--- PASS: TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin (31.88s)
=== CONT  TestAccS3Bucket_Security_corsDelete
--- PASS: TestAccS3Bucket_Security_corsEmptyOrigin (31.77s)
=== CONT  TestAccS3Bucket_Security_corsUpdate
--- PASS: TestAccS3Bucket_Security_corsDelete (27.03s)
=== CONT  TestAccS3Bucket_Replication_RTC_valid
--- PASS: TestAccS3Bucket_Security_corsUpdate (54.58s)
=== CONT  TestAccS3Bucket_Replication_schemaV2SameRegion
--- PASS: TestAccS3Bucket_Replication_schemaV2SameRegion (38.03s)
=== CONT  TestAccS3Bucket_Replication_schemaV2
--- PASS: TestAccS3Bucket_Replication_RTC_valid (110.36s)
=== CONT  TestAccS3Bucket_Replication_withoutPrefix
--- PASS: TestAccS3Bucket_Replication_withoutPrefix (40.95s)
=== CONT  TestAccS3Bucket_Replication_expectVersioningValidationError
--- PASS: TestAccS3Bucket_Replication_expectVersioningValidationError (18.21s)
=== CONT  TestAccS3Bucket_Replication_withoutStorageClass
--- PASS: TestAccS3Bucket_Replication_withoutStorageClass (40.27s)
=== CONT  TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
--- PASS: TestAccS3Bucket_Replication_schemaV2 (150.71s)
=== CONT  TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation (69.81s)
=== CONT  TestAccS3Bucket_Replication_twoDestination
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation (71.38s)
=== CONT  TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
--- PASS: TestAccS3Bucket_Replication_twoDestination (42.49s)
=== CONT  TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter (45.62s)
=== CONT  TestAccS3Bucket_Replication_basic
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter (52.94s)
=== CONT  TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled
--- PASS: TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled (43.06s)
=== CONT  TestAccS3Bucket_Manage_MFADeleteDisabled
--- PASS: TestAccS3Bucket_Replication_basic (108.40s)
=== CONT  TestAccS3Bucket_Manage_versioningDisabled
--- PASS: TestAccS3Bucket_Manage_MFADeleteDisabled (32.23s)
=== CONT  TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
--- PASS: TestAccS3Bucket_Manage_versioningDisabled (31.30s)
=== CONT  TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (31.12s)
=== CONT  TestAccS3Bucket_Manage_objectLockWithVersioning
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning (50.48s)
=== CONT  TestAccS3Bucket_Manage_objectLock_migrate
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled (50.65s)
=== CONT  TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
--- PASS: TestAccS3Bucket_Manage_objectLock_deprecatedEnabled (31.49s)
=== CONT  TestAccS3Bucket_Manage_objectLock
--- PASS: TestAccS3Bucket_Manage_objectLock_migrate (40.48s)
=== CONT  TestAccS3Bucket_Manage_lifecycleRemove
--- PASS: TestAccS3Bucket_Manage_objectLock (55.11s)
=== CONT  TestAccS3Bucket_Manage_lifecycleBasic
--- PASS: TestAccS3Bucket_Manage_lifecycleRemove (46.40s)
=== CONT  TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock (26.82s)
=== CONT  TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
--- PASS: TestAccS3Bucket_Manage_lifecycleBasic (51.61s)
=== CONT  TestAccS3Bucket_Basic_acceleration
--- PASS: TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly (50.28s)
=== CONT  TestAccS3Bucket_Duplicate_UsEast1AltAccount
    acctest.go:806: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccS3Bucket_Duplicate_UsEast1AltAccount (0.00s)
=== CONT  TestAccS3Bucket_Duplicate_UsEast1
--- PASS: TestAccS3Bucket_Duplicate_UsEast1 (26.84s)
=== CONT  TestAccS3Bucket_Duplicate_basic
--- PASS: TestAccS3Bucket_Basic_acceleration (55.31s)
=== CONT  TestAccS3Bucket_disappears
--- PASS: TestAccS3Bucket_Duplicate_basic (15.50s)
=== CONT  TestAccS3Bucket_Basic_requestPayer
--- PASS: TestAccS3Bucket_disappears (37.91s)
=== CONT  TestAccS3Bucket_Basic_keyEnabled
--- PASS: TestAccS3Bucket_Basic_requestPayer (55.90s)
=== CONT  TestAccS3Bucket_Basic_forceDestroy
--- PASS: TestAccS3Bucket_Basic_keyEnabled (36.64s)
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
--- PASS: TestAccS3Bucket_Basic_forceDestroy (43.16s)
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (47.12s)
=== CONT  TestAccS3Bucket_Basic_generatedName
--- PASS: TestAccS3Bucket_Basic_generatedName (33.82s)
=== CONT  TestAccS3Bucket_Basic_namePrefix
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (45.52s)
=== CONT  TestAccS3Bucket_Tags_withSystemTags
--- PASS: TestAccS3Bucket_Basic_namePrefix (28.73s)
=== CONT  TestAccS3Bucket_Tags_ignoreTags
--- PASS: TestAccS3Bucket_Tags_ignoreTags (47.38s)
=== CONT  TestAccS3Bucket_Basic_emptyString
--- PASS: TestAccS3Bucket_Basic_emptyString (29.39s)
=== CONT  TestAccS3Bucket_Tags_withNoSystemTags
--- PASS: TestAccS3Bucket_Tags_withSystemTags (150.83s)
=== CONT  TestAccS3Bucket_Tags_basic
--- PASS: TestAccS3Bucket_Tags_basic (34.91s)
--- PASS: TestAccS3Bucket_Tags_withNoSystemTags (97.88s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	1368.958s

@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/XS 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. and removed size/XS Managed by automation to categorize the size of a PR. labels Sep 13, 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 Sep 13, 2023
@github-actions github-actions bot added the size/S Managed by automation to categorize the size of a PR. label Sep 13, 2023
@ewbankkit ewbankkit merged commit 615f9a6 into main Sep 13, 2023
42 checks passed
@ewbankkit ewbankkit deleted the td-s3-sdk-go-v2-helpers branch September 13, 2023 20:55
@github-actions github-actions bot added this to the v5.17.0 milestone Sep 13, 2023
github-actions bot pushed a commit that referenced this pull request Sep 13, 2023
@github-actions
Copy link

This functionality has been released in v5.17.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
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 Oct 15, 2023
@justinretzolk justinretzolk added the aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. label Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. 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.

2 participants