cdk-s3bucket-ng


Namecdk-s3bucket-ng JSON
Version 0.0.60 PyPI version JSON
download
home_pagehttps://github.com/guan840912/cdk-s3bucket.git
Summarycdk-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.
upload_time2020-10-24 01:17:58
maintainer
docs_urlNone
authorNeil Kuan<guan840912@gmail.com>
requires_python>=3.6
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![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/guan840912/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.

# 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
# 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_ng import BucketNg
import aws_cdk.aws_s3_deployment as s3deploy

# Create a S3 , add props "removalPolicy: RemovalPolicy.DESTROY".
bucket = BucketNg(stack, "Bucket",
    removal_policy=RemovalPolicy.DESTROY
)

# Upload temp file .
s3deploy.BucketDeployment(stack, "addResource",
    sources=[s3deploy.Source.asset("./testdir")],
    destination_bucket=bucket
)
# Get S3 Resource via bucket.s3Bucket ...
CfnOutput(stack, "BucketName", value=bucket.bucket_name)
```

```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
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guan840912/cdk-s3bucket.git",
    "name": "cdk-s3bucket-ng",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Neil Kuan<guan840912@gmail.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c4/d0/b3b1257cbefd779bace76c5ea29481e8d5bcaee0b418ff566caadf68f765/cdk-s3bucket-ng-0.0.60.tar.gz",
    "platform": "",
    "description": "[![NPM version](https://badge.fury.io/js/cdk-s3bucket-ng.svg)](https://badge.fury.io/js/cdk-s3bucket-ng)\n[![PyPI version](https://badge.fury.io/py/cdk-s3bucket-ng.svg)](https://badge.fury.io/py/cdk-s3bucket-ng)\n![Release](https://github.com/guan840912/cdk-s3bucket/workflows/Release/badge.svg)\n\n![Downloads](https://img.shields.io/badge/-DOWNLOADS:-brightgreen?color=gray)\n![npm](https://img.shields.io/npm/dt/cdk-s3bucket-ng?label=npm&color=orange)\n![PyPI](https://img.shields.io/pypi/dm/cdk-s3bucket-ng?label=pypi&color=blue)\n\n# cdk-s3bucket-ng\n\ncdk-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.\n\n# Why\n\nSometime we just do some lab , create a S3 Bucket.\nWant to destroy resource , after Lab finished.\nBut We forget delete Object in S3 Bucket first , so destroy will fail.\n\n`cdk-s3bucket-ng`  can help delete object when cdk destroy , just add `removalPolicy: RemovalPolicy.DESTROY`  property .\n\nYou never have to delete objects yourself, and the usage is almost the same as the native @aws-cdk/aws-s3.Bucket\n\n## Now Try It !!!\n\n# Sample\n\n```python\n# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826\nfrom aws_cdk.core import App, Stack, CfnOutput, RemovalPolicy\nfrom cdk_s3bucket_ng import BucketNg\nimport aws_cdk.aws_s3_deployment as s3deploy\n\n# Create a S3 , add props \"removalPolicy: RemovalPolicy.DESTROY\".\nbucket = BucketNg(stack, \"Bucket\",\n    removal_policy=RemovalPolicy.DESTROY\n)\n\n# Upload temp file .\ns3deploy.BucketDeployment(stack, \"addResource\",\n    sources=[s3deploy.Source.asset(\"./testdir\")],\n    destination_bucket=bucket\n)\n# Get S3 Resource via bucket.s3Bucket ...\nCfnOutput(stack, \"BucketName\", value=bucket.bucket_name)\n```\n\n```bash\n# create temp file .\nmkdir ./testdir\ntouch ./testdir/{a.txt,b.txt,c.txt}\nls ./testdir\na.txt  b.txt  c.txt\n```\n\n### To deploy\n\n```bash\ncdk deploy\n```\n\n### To destroy\n\n```bash\n# will delete object in S3 , and delete S3 Bucket\ncdk destroy\n```\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "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.",
    "version": "0.0.60",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "d4c895b3de53a5f9031c6c9453a27d64",
                "sha256": "f229286ce224ca1f48858301e30ab23772b7d7a05bb306db037a9a496060c39b"
            },
            "downloads": -1,
            "filename": "cdk_s3bucket_ng-0.0.60-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4c895b3de53a5f9031c6c9453a27d64",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 20875,
            "upload_time": "2020-10-24T01:17:57",
            "upload_time_iso_8601": "2020-10-24T01:17:57.348164Z",
            "url": "https://files.pythonhosted.org/packages/fc/7c/8ce906a0e0eaa90d206d7af7454af75eb9bb36d3af423b99c5588d871911/cdk_s3bucket_ng-0.0.60-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "707f1cacea006465fcbb8b76c412d30c",
                "sha256": "561a6fc8890c8d32430ae0254daae7e68e3a1003d1bda955d50e053608602e15"
            },
            "downloads": -1,
            "filename": "cdk-s3bucket-ng-0.0.60.tar.gz",
            "has_sig": false,
            "md5_digest": "707f1cacea006465fcbb8b76c412d30c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 21110,
            "upload_time": "2020-10-24T01:17:58",
            "upload_time_iso_8601": "2020-10-24T01:17:58.938002Z",
            "url": "https://files.pythonhosted.org/packages/c4/d0/b3b1257cbefd779bace76c5ea29481e8d5bcaee0b418ff566caadf68f765/cdk-s3bucket-ng-0.0.60.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-10-24 01:17:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "guan840912",
    "error": "Could not fetch GitHub repository",
    "lcname": "cdk-s3bucket-ng"
}
        
Elapsed time: 0.21283s