Skip to main content

Bucket with content cleanup to allow bucket deletion when the stack will be destroyed

Project description

cloudcomponents Logo

@cloudcomponents/cdk-deletable-bucket

Build Status cdkdx typescript python

Bucket with content cleanup to allow bucket deletion when the stack will be destroyed

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-deletable-bucket

Python:

pip install cloudcomponents.cdk-deletable-bucket

How to use

import { DeletableBucket } from '@cloudcomponents/cdk-deletable-bucket';
import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';

export class DeletableBucketStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    new DeletableBucket(this, 'DeletableBucket', {
      bucketName: 'bucket2delete',
      forceDelete: true,
    });
  }
}

API Reference

See API.md.

Example

See more complete examples.

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page