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 XNotEmplemented error handling in resourceBucketRead #24764

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

wilfriedroset
Copy link
Contributor

Signed-off-by: Wilfried Roset wilfriedroset@users.noreply.github.com

Community Note

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

The following patch takes into account third party S3 who does not support CORS.
Example of error message:

 Error: error getting S3 Bucket CORS configuration: NotImplemented: The requested resource is not implemented status code: 501, request id: [redacted], host id: [redacted] 

@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels May 12, 2022
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 13, 2022
@anGie44 anGie44 self-assigned this May 27, 2022
@anGie44
Copy link
Contributor

anGie44 commented Jun 6, 2022

Hi @wilfriedroset , thank you for this PR! Just one quick question before we get this merged in. Should we also account for the XNotImplemented error if that has been encountered as well when using 3rd party s3 implementations similar to #23291? Or is it solely the NotImplemented error?

Do you mind also adding a changelog entry when you have a chance (an example can be seen in a past PR: https://github.com/hashicorp/terraform-provider-aws/pull/23278/files)? thanks in advance!

@anGie44 anGie44 added the waiting-response Maintainers are waiting on response from community or contributor. label Jun 6, 2022
…ketRead

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
@wilfriedroset
Copy link
Contributor Author

Thank you @anGie44 you are totally correct, It makes sense to take into account XNotImplemented as well.
I've updated the PR to reflect that and added the changelog

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Jun 6, 2022
@anGie44
Copy link
Contributor

anGie44 commented Jun 6, 2022

Awesome, thanks @wilfriedroset! LGTM 🚀 (failing CI check can be ignored as it's unrelated to these changes)

@anGie44
Copy link
Contributor

anGie44 commented Jun 6, 2022

Output of acceptance tests:

make testacc TESTARGS='-run=TestAccS3Bucket_' PKG=s3 ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 5  -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_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_updateACL
=== PAUSE TestAccS3Bucket_Security_updateACL
=== RUN   TestAccS3Bucket_Security_updateGrant
=== PAUSE TestAccS3Bucket_Security_updateGrant
=== RUN   TestAccS3Bucket_Security_aclToGrant
=== PAUSE TestAccS3Bucket_Security_aclToGrant
=== RUN   TestAccS3Bucket_Security_grantToACL
=== PAUSE TestAccS3Bucket_Security_grantToACL
=== 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_Security_policy
=== PAUSE TestAccS3Bucket_Security_policy
=== 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_Replication_basic
=== CONT  TestAccS3Bucket_Security_aclToGrant
=== CONT  TestAccS3Bucket_Replication_withoutStorageClass
=== CONT  TestAccS3Bucket_Replication_expectVersioningValidationError
--- PASS: TestAccS3Bucket_Replication_expectVersioningValidationError (12.59s)
=== CONT  TestAccS3Bucket_Web_routingRules
--- PASS: TestAccS3Bucket_Basic_basic (23.38s)
=== CONT  TestAccS3Bucket_Web_redirect
--- PASS: TestAccS3Bucket_Replication_withoutStorageClass (28.10s)
=== CONT  TestAccS3Bucket_Web_simple
=== CONT  TestAccS3Bucket_Security_policy
--- PASS: TestAccS3Bucket_Security_aclToGrant (37.93s)
--- PASS: TestAccS3Bucket_Web_routingRules (37.25s)
=== CONT  TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
--- PASS: TestAccS3Bucket_Replication_basic (63.91s)
=== CONT  TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
--- PASS: TestAccS3Bucket_Web_redirect (53.43s)
=== CONT  TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
--- PASS: TestAccS3Bucket_Web_simple (54.39s)
=== CONT  TestAccS3Bucket_Security_logging
--- PASS: TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (35.55s)
=== CONT  TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
--- PASS: TestAccS3Bucket_Security_policy (47.79s)
=== CONT  TestAccS3Bucket_Security_corsEmptyOrigin
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (22.11s)
=== CONT  TestAccS3Bucket_Security_corsDelete
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical (26.10s)
=== CONT  TestAccS3Bucket_Security_corsUpdate
--- PASS: TestAccS3Bucket_Security_corsEmptyOrigin (22.81s)
=== CONT  TestAccS3Bucket_Security_grantToACL
=== CONT  TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
--- PASS: TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin (23.30s)
--- PASS: TestAccS3Bucket_Security_corsDelete (23.09s)
=== CONT  TestAccS3Bucket_Replication_RTC_valid
--- PASS: TestAccS3Bucket_Security_logging (28.97s)
=== CONT  TestAccS3Bucket_Security_updateGrant
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter (31.01s)
=== CONT  TestAccS3Bucket_Security_updateACL
--- PASS: TestAccS3Bucket_Security_corsUpdate (39.89s)
=== CONT  TestAccS3Bucket_Manage_lifecycleBasic
--- PASS: TestAccS3Bucket_Security_grantToACL (39.11s)
=== CONT  TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
--- PASS: TestAccS3Bucket_Security_updateGrant (58.56s)
=== CONT  TestAccS3Bucket_Replication_twoDestination
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter (28.67s)
=== CONT  TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
--- PASS: TestAccS3Bucket_Manage_lifecycleBasic (36.05s)
=== CONT  TestAccS3Bucket_Replication_schemaV2
--- PASS: TestAccS3Bucket_Security_updateACL (39.41s)
=== CONT  TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
--- PASS: TestAccS3Bucket_Replication_RTC_valid (86.70s)
=== CONT  TestAccS3Bucket_Replication_schemaV2SameRegion
--- PASS: TestAccS3Bucket_Replication_twoDestination (27.64s)
=== CONT  TestAccS3Bucket_Replication_withoutPrefix
--- PASS: TestAccS3Bucket_Replication_schemaV2SameRegion (29.16s)
=== CONT  TestAccS3Bucket_Manage_versioningAndMfaDeleteDisabled
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation (48.79s)
=== CONT  TestAccS3Bucket_Tags_withNoSystemTags
--- PASS: TestAccS3Bucket_Replication_withoutPrefix (27.67s)
=== CONT  TestAccS3Bucket_Manage_MfaDeleteDisabled
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation (48.56s)
=== CONT  TestAccS3Bucket_Basic_keyEnabled
--- PASS: TestAccS3Bucket_Manage_versioningAndMfaDeleteDisabled (22.45s)
=== CONT  TestAccS3Bucket_Manage_versioningDisabled
--- PASS: TestAccS3Bucket_Manage_MfaDeleteDisabled (22.22s)
=== CONT  TestAccS3Bucket_Tags_basic
--- PASS: TestAccS3Bucket_Basic_keyEnabled (23.95s)
=== CONT  TestAccS3Bucket_Manage_versioning
--- PASS: TestAccS3Bucket_Manage_versioningDisabled (22.55s)
=== CONT  TestAccS3Bucket_Tags_ignoreTags
--- PASS: TestAccS3Bucket_Tags_basic (26.51s)
=== CONT  TestAccS3Bucket_Tags_withSystemTags
--- PASS: TestAccS3Bucket_Replication_schemaV2 (107.49s)
=== CONT  TestAccS3Bucket_disappears
--- PASS: TestAccS3Bucket_Manage_versioning (42.24s)
=== CONT  TestAccS3Bucket_Basic_forceDestroy
--- PASS: TestAccS3Bucket_Tags_withNoSystemTags (74.43s)
=== CONT  TestAccS3Bucket_Basic_requestPayer
--- PASS: TestAccS3Bucket_disappears (14.49s)
=== CONT  TestAccS3Bucket_Basic_acceleration
--- PASS: TestAccS3Bucket_Tags_ignoreTags (37.78s)
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
--- PASS: TestAccS3Bucket_Basic_forceDestroy (19.75s)
=== CONT  TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (22.29s)
=== CONT  TestAccS3Bucket_Basic_generatedName
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (19.97s)
=== CONT  TestAccS3Bucket_Basic_emptyString
--- PASS: TestAccS3Bucket_Basic_requestPayer (38.59s)
=== CONT  TestAccS3Bucket_Manage_objectLock_migrate
--- PASS: TestAccS3Bucket_Basic_acceleration (40.51s)
=== CONT  TestAccS3Bucket_Manage_objectLockWithVersioning
--- PASS: TestAccS3Bucket_Basic_generatedName (21.55s)
=== CONT  TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
--- PASS: TestAccS3Bucket_Basic_emptyString (21.63s)
=== CONT  TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
--- PASS: TestAccS3Bucket_Manage_objectLock_migrate (29.09s)
=== CONT  TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning (26.47s)
=== CONT  TestAccS3Bucket_Manage_lifecycleRemove
--- PASS: TestAccS3Bucket_Manage_objectLock_deprecatedEnabled (22.57s)
=== CONT  TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (22.24s)
=== CONT  TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock (18.99s)
=== CONT  TestAccS3Bucket_Basic_namePrefix
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled (26.28s)
=== CONT  TestAccS3Bucket_Manage_objectLock
--- PASS: TestAccS3Bucket_Tags_withSystemTags (122.82s)
--- PASS: TestAccS3Bucket_Manage_lifecycleRemove (31.89s)
--- PASS: TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly (36.06s)
--- PASS: TestAccS3Bucket_Basic_namePrefix (22.10s)
--- PASS: TestAccS3Bucket_Manage_objectLock (38.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	435.506s

@anGie44 anGie44 added this to the v4.18.0 milestone Jun 6, 2022
@anGie44 anGie44 merged commit 98ae6c4 into hashicorp:main Jun 6, 2022
@github-actions
Copy link

This functionality has been released in v4.18.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 Jul 10, 2022
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. service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants