-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Fix s3 third party provider error on creating bucket without object lock #26317
Fix s3 third party provider error on creating bucket without object lock #26317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @cristiGuranIonos 👋
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 CONTRIBUTING 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! 😃
Added enhancement changelog to the PR. Thanks for taking a look! |
@justinretzolk Would there be anything else to add to the PR? |
Hey @cristiGuranIonos 👋 Thank you for your contribution, and for checking in! On a quick glance, everything seems to be in order. At this point, we'll just need to wait for this PR to be prioritized, at which point one of the maintainers will do a full review before merging. |
👍 |
Any updates? Thanks! |
…ration' in resource Read.
…tFound' with 'tfawserr.ErrCodeContains(err, errCodeObjectLockConfigurationNotFound)'.
There was a problem hiding this 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=TestAccS3BucketObjectLockConfiguration_\|TestAccS3Bucket_Manage_objectLock' PKG=s3 ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 3 -run=TestAccS3BucketObjectLockConfiguration_\|TestAccS3Bucket_Manage_objectLock -timeout 180m
=== RUN TestAccS3BucketObjectLockConfiguration_basic
=== PAUSE TestAccS3BucketObjectLockConfiguration_basic
=== RUN TestAccS3BucketObjectLockConfiguration_disappears
=== PAUSE TestAccS3BucketObjectLockConfiguration_disappears
=== RUN TestAccS3BucketObjectLockConfiguration_update
=== PAUSE TestAccS3BucketObjectLockConfiguration_update
=== RUN TestAccS3BucketObjectLockConfiguration_migrate_noChange
=== PAUSE TestAccS3BucketObjectLockConfiguration_migrate_noChange
=== RUN TestAccS3BucketObjectLockConfiguration_migrate_withChange
=== PAUSE TestAccS3BucketObjectLockConfiguration_migrate_withChange
=== RUN TestAccS3BucketObjectLockConfiguration_noRule
=== PAUSE TestAccS3BucketObjectLockConfiguration_noRule
=== 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
=== CONT TestAccS3BucketObjectLockConfiguration_basic
=== CONT TestAccS3Bucket_Manage_objectLock
=== CONT TestAccS3BucketObjectLockConfiguration_update
--- PASS: TestAccS3BucketObjectLockConfiguration_basic (25.43s)
=== CONT TestAccS3BucketObjectLockConfiguration_migrate_noChange
--- PASS: TestAccS3BucketObjectLockConfiguration_update (40.01s)
=== CONT TestAccS3BucketObjectLockConfiguration_noRule
--- PASS: TestAccS3Bucket_Manage_objectLock (42.00s)
=== CONT TestAccS3BucketObjectLockConfiguration_migrate_withChange
--- PASS: TestAccS3BucketObjectLockConfiguration_migrate_noChange (34.23s)
=== CONT TestAccS3BucketObjectLockConfiguration_disappears
--- PASS: TestAccS3BucketObjectLockConfiguration_noRule (22.75s)
=== CONT TestAccS3Bucket_Manage_objectLockWithVersioning
--- PASS: TestAccS3BucketObjectLockConfiguration_migrate_withChange (34.48s)
=== CONT TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
--- PASS: TestAccS3BucketObjectLockConfiguration_disappears (20.30s)
=== CONT TestAccS3Bucket_Manage_objectLock_migrate
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning (26.35s)
=== CONT TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled (28.60s)
--- PASS: TestAccS3Bucket_Manage_objectLock_migrate (30.69s)
--- PASS: TestAccS3Bucket_Manage_objectLock_deprecatedEnabled (24.91s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 119.538s
@cristiGuranIonos Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.64.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! |
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. |
Community Note
Problem description
Error when trying to create bucket without lock configuration on 3rd party provider:
Cause:
S3 provider returns
ObjectLockConfigurationNotFound
instead ofObjectLockConfigurationNotFoundError
, so the strict checkErrCodeEquals
inbucket.go
does not work.Also, the check if it's an aws region(partition) below returns true, because the region even though it's not aws has the same format eg:
eu-west-2
and the regex check in the terraform-aws-provider is satisfied.Output from acceptance testing: