[![NPM version](https://badge.fury.io/js/cdk-s3bucket-ng.svg)](https://badge.fury.io/js/cdk-s3bucket-ng)
[![PyPI version](https://badge.fury.io/py/cdk-s3bucket-ng.svg)](https://badge.fury.io/py/cdk-s3bucket-ng)
![Release](https://github.com/neilkuan/cdk-s3bucket/workflows/release/badge.svg)
![Downloads](https://img.shields.io/badge/-DOWNLOADS:-brightgreen?color=gray)
![npm](https://img.shields.io/npm/dt/cdk-s3bucket-ng?label=npm&color=orange)
![PyPI](https://img.shields.io/pypi/dm/cdk-s3bucket-ng?label=pypi&color=blue)
# cdk-s3bucket-ng
cdk-s3bucket-ng is an AWS CDK construct library that provides a drop-in replacement for the Bucket construct with the capability to remove non-empty S3 buckets.
## Install
```bash
Use the npm dist tag to opt in CDKv1 or CDKv2:
// for CDKv2
npm install cdk-s3bucket-ng
or
npm install cdk-s3bucket-ng@latest
// for CDKv1
npm install cdk-s3bucket-ng@cdkv1
```
ð¡ð¡ð¡ please click [here](https://github.com/neilkuan/cdk-s3bucket/tree/cdkv1#readme), if you are using aws-cdk v1.x.x version.ð¡ð¡ð¡
# 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-ng` 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
```python
import { App, Stack, CfnOutput, RemovalPolicy } from 'aws-cdk-lib';
import { BucketNg } from 'cdk-s3bucket-ng';
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
// Create a S3 , add props "removalPolicy: RemovalPolicy.DESTROY".
const bucket = new BucketNg(stack, 'Bucket',{
removalPolicy: RemovalPolicy.DESTROY,
});
//Upload temp file .
new s3deploy.BucketDeployment(stack, 'addResource', {
sources: [s3deploy.Source.asset('./testdir')],
destinationBucket: bucket,
});
// Get S3 Resource via bucket.s3Bucket ...
new CfnOutput(stack, 'BucketName', { value: bucket.bucketName });
```
```bash
# create temp file .
mkdir ./testdir
touch ./testdir/{a.txt,b.txt,c.txt}
ls ./testdir
a.txt b.txt c.txt
```
### To deploy
```bash
cdk deploy
```
### To destroy
```bash
# will delete object in S3 , and delete S3 Bucket
cdk destroy
```
## :clap: Supporters
[![Stargazers repo roster for @neilkuan/cdk-s3bucket](https://reporoster.com/stars/neilkuan/cdk-s3bucket)](https://github.com/neilkuan/cdk-s3bucket/stargazers)
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
最新资源
- 光伏三相并网仿真 带说明文件,参考文献 模型内容: 1.光伏+MPPT控制+两级式并网逆变器(boost+三相桥式逆变) 2.坐标变+锁相环+dq功率控制+解耦控制+电流内环电压外环控制+spwm
- No.881 基于S7-200 PLC和组态王全自动洗衣机控制系统 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- Python试题复习题库PDF
- 电气类Matlab Simulink仿真模型 电力电子、电机控制、新能源发电、电力系统 模型定制
- 双馈风力发电仿真,里面包含各种集成化模块,且在initfcn中统一修改参数,非常方便后续进一步研究和改进,含低电压穿越控制:利用crowbar消耗突增的电压 封锁RSC防止突增的磁链影响控制 并附
- pocket nc 5轴雕刻机同款运动系统 USB运动控制 (五轴雕刻机系统)全部开源 不保留任何关键技术,PCB可直接生产,C++6.0源码,,本产品为可复制资料,支持五轴联动,支持RTCP算法
- matlab p文件转码 matlab pcode文件 matlab .p文件转为.m文件 p文件解码 将matlab中的p文件转为m文件 将matlab中无法打开的p文件 p code转为可见的m文
- ABS模型制动防抱死模型 汽车制动防抱死模型ABS模型 MATLAB Simulink搭建汽车直线制动abs模型,采用逻辑门限值控制abs增压、保压、减压过程 相关材料为初学者提供便利,有详细的模型
- 基于plc的瓶子印花机的设计,热转印工艺,程序欧姆龙PLC和mcgs控制案例,可以实现仿真的流畅运行
- 第三届华数杯数学建模c题答案PDF
- TSC,晶闸管投切电容器,晶闸管投切电容器无功补偿,晶闸管投切电容器仿真,simulink仿真,电力电子仿真,电力电子simulink仿真,MATLAB仿真,tsc仿真,SVC仿真,无功补偿器,无功补
- No.145 S7-200 MCGS 基于PLC的自动门控制系统设计 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- MATLAB仿真Delta并联机器人三角洲机器人simulink simscape仿真 正逆运动学正运动学
- 佩奇老师讲的最新的抖音弹幕
- 西门子1200博图程序案例,组态采用KTP700触摸屏 1200PLC和v90 伺服变频器G120通讯程序例程参考,内有 2台西门子变频器G120 Profinet通讯,4台伺服V90 PN口通讯
- Maxwell电机多目标尺寸优化 Ansys Maxwell 和OptiSlang 有案例电机,永磁同步电机内嵌式 满足电机多尺寸参数入手,满足多尺寸联动优化,最终达到多参数优化效果 提供源文件,提供
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈