cdk-s3bucket
Project description
cdk-s3bucket
Create a S3 Bucket that can be deleted completely.
Why
Sometime we just do some lab , create a S3 Bucket. Want to destroy resource , after Lab finished. But We forget delete Object in S3 Bucket first , so destroy will fail.
cdk-s3bucket
can help delete object when cdk destroy , just add removalPolicy: RemovalPolicy.DESTROY
property .
You never have to delete objects yourself, and the usage is almost the same as the native @aws-cdk/aws-s3.Bucket
Now Try It !!!
Sample
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from aws_cdk.core import App, Stack, CfnOutput, RemovalPolicy
from cdk_s3bucket import Bucket
# Create a S3 , add props "removalPolicy: RemovalPolicy.DESTROY".
bucket = Bucket(stack, "Bucket",
removal_policy=RemovalPolicy.DESTROY
)
# Get S3 Resource via bucket.s3Bucket ...
CfnOutput(stack, "BucketName", value=bucket.s3_bucket.bucket_name)
To deploy
cdk deploy --require-approval never
To destroy
cdk destroy -f
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
cdk-s3bucket-0.0.2.tar.gz
(20.9 kB
view hashes)
Built Distribution
Close
Hashes for cdk_s3bucket-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f51805cc3eb3b1df54390d552d19fd39963eda017d619485798d0b14d5e9d8b |
|
MD5 | 57fbc3424d4fce9a3f6fca347424a074 |
|
BLAKE2b-256 | 74ab073feeac2a6d36270a952b782ba5fd06bd9b3892bb540d167f14b1e0269e |