[![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)
# @cloudcomponents/cdk-temp-stack
[![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
[![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
[![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-temp-stack)
[![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-temp-stack/)
> A stack that destroys itself after a given time (ttl)
## Install
TypeScript/JavaScript:
```bash
npm i @cloudcomponents/cdk-temp-stack
```
Python:
```bash
pip install cloudcomponents.cdk-temp-stack
```
## How to use
```python
// temp-infra-app.ts
#!/usr/bin/env node
import 'source-map-support/register';
import { App, Duration } from 'aws-cdk-lib';
import { TempInfraStack } from './temp-infra-stack';
const app = new App();
new TempInfraStack(app, 'TempInfraStack', {
env: {
region: process.env.DEFAULT_REGION,
account: process.env.CDK_DEFAULT_ACCOUNT,
},
ttl: Duration.minutes(10),
});
// temp-infra-stack.ts
import { TempStack, TempStackProps } from '@cloudcomponents/cdk-temp-stack';
import { Vpc } from 'aws-cdk-lib/aws-ec2';
import { Construct } from 'constructs';
export class TempInfraStack extends TempStack {
constructor(scope: Construct, id: string, props: TempStackProps) {
super(scope, id, props);
new Vpc(this, 'VPC');
}
}
```
## TimeToLive Construct
Alternatively, you can also add the TimeToLive construct to your stack
```python
// your stack
import { TimeToLive } from '@cloudcomponents/cdk-temp-stack';
import { Stack, StackProps, Duration } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export class YourStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
new TimeToLive(this, 'TimeToLive', {
ttl: Duration.minutes(10),
});
}
}
```
## API Reference
See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-temp-stack/API.md).
## Example
See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).
## License
[MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-temp-stack/LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/cloudcomponents/cdk-constructs",
"name": "cloudcomponents.cdk-temp-stack",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "hupe1980",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/c2/50/ea5b6105ee3a8a297205ec475ae90318c1e752f776063326a60fb89815e2/cloudcomponents.cdk-temp-stack-2.3.0.tar.gz",
"platform": null,
"description": "[![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)\n\n# @cloudcomponents/cdk-temp-stack\n\n[![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)\n[![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)\n[![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-temp-stack)\n[![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-temp-stack/)\n\n> A stack that destroys itself after a given time (ttl)\n\n## Install\n\nTypeScript/JavaScript:\n\n```bash\nnpm i @cloudcomponents/cdk-temp-stack\n```\n\nPython:\n\n```bash\npip install cloudcomponents.cdk-temp-stack\n```\n\n## How to use\n\n```python\n// temp-infra-app.ts\n\n#!/usr/bin/env node\n\nimport 'source-map-support/register';\nimport { App, Duration } from 'aws-cdk-lib';\n\nimport { TempInfraStack } from './temp-infra-stack';\n\nconst app = new App();\n\nnew TempInfraStack(app, 'TempInfraStack', {\n env: {\n region: process.env.DEFAULT_REGION,\n account: process.env.CDK_DEFAULT_ACCOUNT,\n },\n ttl: Duration.minutes(10),\n});\n\n// temp-infra-stack.ts\n\nimport { TempStack, TempStackProps } from '@cloudcomponents/cdk-temp-stack';\nimport { Vpc } from 'aws-cdk-lib/aws-ec2';\nimport { Construct } from 'constructs';\n\nexport class TempInfraStack extends TempStack {\n constructor(scope: Construct, id: string, props: TempStackProps) {\n super(scope, id, props);\n\n new Vpc(this, 'VPC');\n }\n}\n```\n\n## TimeToLive Construct\n\nAlternatively, you can also add the TimeToLive construct to your stack\n\n```python\n// your stack\n\nimport { TimeToLive } from '@cloudcomponents/cdk-temp-stack';\nimport { Stack, StackProps, Duration } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\nexport class YourStack extends Stack {\n constructor(scope: Construct, id: string, props: StackProps) {\n super(scope, id, props);\n\n new TimeToLive(this, 'TimeToLive', {\n ttl: Duration.minutes(10),\n });\n }\n}\n```\n\n## API Reference\n\nSee [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-temp-stack/API.md).\n\n## Example\n\nSee more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).\n\n## License\n\n[MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-temp-stack/LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A stack that destroys itself after a given time (ttl)",
"version": "2.3.0",
"project_urls": {
"Homepage": "https://github.com/cloudcomponents/cdk-constructs",
"Source": "https://github.com/cloudcomponents/cdk-constructs.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2503ac67588496041b947a532a454ef5952215224c6c622526ac7795866b1238",
"md5": "4febb266de981e242cca3ebefaaa916f",
"sha256": "ad8ac9eec0e9d4cec7b853cfbc2f9ef9917785b8486a4bd18a3a5eb8f9473628"
},
"downloads": -1,
"filename": "cloudcomponents.cdk_temp_stack-2.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4febb266de981e242cca3ebefaaa916f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 1336583,
"upload_time": "2024-04-17T18:36:20",
"upload_time_iso_8601": "2024-04-17T18:36:20.796413Z",
"url": "https://files.pythonhosted.org/packages/25/03/ac67588496041b947a532a454ef5952215224c6c622526ac7795866b1238/cloudcomponents.cdk_temp_stack-2.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c250ea5b6105ee3a8a297205ec475ae90318c1e752f776063326a60fb89815e2",
"md5": "383b9d53676df915e23aa8e46d779778",
"sha256": "47b0ef31be686d5d1a7ad0ba941afc895ba19b01ba81f1cdc68debe0d2344ae4"
},
"downloads": -1,
"filename": "cloudcomponents.cdk-temp-stack-2.3.0.tar.gz",
"has_sig": false,
"md5_digest": "383b9d53676df915e23aa8e46d779778",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 1337858,
"upload_time": "2024-04-17T18:36:25",
"upload_time_iso_8601": "2024-04-17T18:36:25.985587Z",
"url": "https://files.pythonhosted.org/packages/c2/50/ea5b6105ee3a8a297205ec475ae90318c1e752f776063326a60fb89815e2/cloudcomponents.cdk-temp-stack-2.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-17 18:36:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cloudcomponents",
"github_project": "cdk-constructs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cloudcomponents.cdk-temp-stack"
}