Skip to content

Feature Request: Add support for autoDeleteObjects and removalPolicy properties on created Bucket #306

Open
@El-Jefe-Carne

Description

@El-Jefe-Carne

Recently found and used this package in an implementation. Fantastic work, and really appreciate what has been done here.

I ran destroy for the first time on my stack and I noticed that cloud formation had its bucket deletion skipped. Since this package uses the Bucket object from @aws-cdk/aws-s3 package, I was hoping you could add support into this project's config that allows me to set the removalPolicy and autoDeleteObjects from the SPADeploy config object.

In attempting to do this without an update to the pacakage, I added the following to my code after the initialization of the SPADeploy:

deployment.websiteBucket.applyRemovalPolicy(RemovalPolicy.DESTROY);

Unfortunately, CloudFormation won't delete a bucket with objects in it unless the autoDeleteObjects prop is set to true in the Bucket config, and I don't see a way to set that after initialization of the Bucket like with the removalPolicy.

Looking for this:
image

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions