Skip to content

Conversation

@nithin-kamal
Copy link

@nithin-kamal nithin-kamal commented Aug 20, 2025

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

@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Aug 20, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team August 20, 2025 12:09
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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)

@nithin-kamal nithin-kamal changed the title fix(s3): ObjectLockEnabled null error when objectLockDefaultRetention is set to undefined fix(s3): objectLockEnabled null error when objectLockDefaultRetention is set to undefined Aug 20, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review August 20, 2025 13:04

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@iankhou iankhou self-assigned this Aug 21, 2025
Copy link
Contributor

@iankhou iankhou left a 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!

@mergify
Copy link
Contributor

mergify bot commented Aug 21, 2025

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).

@mergify
Copy link
Contributor

mergify bot commented Aug 21, 2025

This pull request has been removed from the queue for the following reason: checks failed.

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.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@aws-cdk-automation
Copy link
Collaborator

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:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

@aws-cdk-automation
Copy link
Collaborator

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.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Sep 27, 2025
@github-actions
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants