[![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)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:cdk-s3bucket-ng-2.0.47.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
cdk-s3bucket-ng-2.0.47.tar.gz (16个子文件)
cdk-s3bucket-ng-2.0.47
MANIFEST.in 23B
PKG-INFO 3KB
pyproject.toml 106B
LICENSE 11KB
src
cdk_s3bucket_ng.egg-info
PKG-INFO 3KB
requires.txt 92B
SOURCES.txt 424B
top_level.txt 16B
dependency_links.txt 1B
cdk_s3bucket_ng
py.typed 1B
_jsii
cdk-s3bucket-ng@2.0.47.jsii.tgz 17KB
__init__.py 365B
__init__.py 11KB
setup.cfg 38B
setup.py 2KB
README.md 2KB
共 16 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 汇编语言入门与编程实践-低层开发者的必备技能
- WatchIO二进制固件和刷机工具(无需源码编译).zip
- 提取网页核心信息:Python中的Readability与Date Extraction技术
- Swift语言教程:从基础语法到高级特性的全面讲解
- 表白代码(发射爱心).zip学习资料程序
- 常用工具合集(包括汉字转拼音工具、常用数据格式相互转换工具、尺寸相关的工具类).zip
- Delphi编程教程:从入门到精通Windows应用程序开发
- 视觉化编程入门指南:Visual Basic语言教程及其应用领域
- 纯代码实现的3d爱心.zip学习资料语言
- 儿童编程教育中Scratch语言的基础教学及实战示例
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功