- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.3k
fix(s3): objectLockEnabled null error when objectLockDefaultRetention is set to undefined #35281
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): objectLockEnabled null error when objectLockDefaultRetention is set to undefined #35281
Conversation
…on is undefined : issue 34709
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.
(This review is outdated)
…on is undefined : issue 34709
…on is undefined : issue 34709
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
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.
Thanks for your contribution, looks good!
| Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). | 
| This pull request has been removed from the queue for the following reason:  The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. | 
| This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure: 
 This PR will automatically close in 14 days if no action is taken. | 
| This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. | 
| Comments on closed issues and PRs are hard for our team to see. | 
Issue #34709
Closes #34709 .
Reason for this change
The root cause is that when Object Lock is disabled (i.e., setting the property ObjectLockDefaultRetention to undefined), the generated CloudFormation template ends up with a null value for ObjectLockEnabled. This leads AWS S3's handler to fail because it attempts to call .booleanValue() on a null, causing a runtime InternalFailure.
Description of changes
If the ObjectLockDefaultRetention is undefined (Object Lock Disabled), the ObjectLockEnabled prop is omitted now. Thereby solving the null value error. No side effects as omitting a prop that is disabled
Describe any new or updated permissions being added
None
Description of how you validated changes
Updated unit tests and snapshots from integration test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license