Skip to content

Conversation

@c19yamamoto
Copy link

Issue # (if applicable)

Closes #15413

Reason for this change

The autoDeleteObjects functionality, which enables the deletion of all objects within an S3 Bucket when the CDK stack is destroyed, is currently only configurable via the autoDeleteObjects property in the BucketProps constructor. This property requires users to decide on object cleanup behavior at the time of resource creation.

The use case for this change is to enable users to activate this capability after the bucket has been created (e.g., inside an aspect, a custom method, or dynamically based on conditions), by exposing the internal logic through a public method.

Description of changes

The private method enableAutoDeleteObjects() was changed to public

Describe any new or updated permissions being added

none

Description of how you validated changes

Add unit 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 effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Nov 14, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 14, 2025 14:33
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Nov 14, 2025
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.

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@c19yamamoto
Copy link
Author

Exemption Request: The change only exposes existing logic whose identical cleanup mechanism is already validated by integration tests.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-s3): Allow setting autoDeleteObjects on existing Buckets

2 participants