Skip to content

Conversation

@c19yamamoto
Copy link

@c19yamamoto c19yamamoto commented Nov 14, 2025

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 and integ tests.

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.

(This review is outdated)

@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
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 21, 2025 16:52

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

@aws-cdk-automation aws-cdk-automation removed the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Nov 21, 2025
@c19yamamoto c19yamamoto marked this pull request as ready for review November 21, 2025 16:58
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 22, 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/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants