Skip to content

‼️ s3: toggling off auto_delete_objects for Bucket empties the bucket #16603

@rittneje

Description

@rittneje

If a stack is deployed with an S3 bucket with auto_delete_objects=True, and then re-deployed with auto_delete_objects=False, all the objects in the bucket will be deleted.

Reproduction Steps

  1. Deploy a stack with an S3 bucket created with auto_delete_objects=True.
  2. Upload files into the bucket.
  3. Deploy the stack again with auto_delete_objects=False.
  4. Observe that the bucket is now empty.

What did you expect to happen?

The bucket should not have been emptied.

What actually happened?

Since the custom resource was deleted, the bucket was emptied.

Environment

  • CDK CLI Version : 1.118.0
  • Framework Version:
  • Node.js Version: 14.17.5
  • OS : debian bullseye (running inside a container)
  • Language (Version): Python 3.9.6

This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-s3Related to Amazon S3bugThis issue is a bug.effort/smallSmall work item – less than a day of effortp0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions