[![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/cb/54/e7ca9693a3b773eff243acadac36748d477b397c14c1802a437a4afc68e8/cloudcomponents.cdk-temp-stack-2.4.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.4.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": "2dfcaeb1c8830b2821f42b8f5936a1ec7b557240d9b0b973f84fd179906ab755",
"md5": "d24f12b41bb48bbd2eb32484e7c27199",
"sha256": "1000a6a5edaa19f00262faf22fb93fda7966c090128ea1743c096eba8fcfd6fd"
},
"downloads": -1,
"filename": "cloudcomponents.cdk_temp_stack-2.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d24f12b41bb48bbd2eb32484e7c27199",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 138148,
"upload_time": "2024-05-16T19:33:05",
"upload_time_iso_8601": "2024-05-16T19:33:05.393758Z",
"url": "https://files.pythonhosted.org/packages/2d/fc/aeb1c8830b2821f42b8f5936a1ec7b557240d9b0b973f84fd179906ab755/cloudcomponents.cdk_temp_stack-2.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cb54e7ca9693a3b773eff243acadac36748d477b397c14c1802a437a4afc68e8",
"md5": "c55c8009de2bc7899a2c8b88def27871",
"sha256": "2fb9e11cd02d5e2929c1b2126fc30cdb148090c930f13d203b0c543937fd04d9"
},
"downloads": -1,
"filename": "cloudcomponents.cdk-temp-stack-2.4.0.tar.gz",
"has_sig": false,
"md5_digest": "c55c8009de2bc7899a2c8b88def27871",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 139496,
"upload_time": "2024-05-16T19:33:20",
"upload_time_iso_8601": "2024-05-16T19:33:20.969893Z",
"url": "https://files.pythonhosted.org/packages/cb/54/e7ca9693a3b773eff243acadac36748d477b397c14c1802a437a4afc68e8/cloudcomponents.cdk-temp-stack-2.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-16 19:33:20",
"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"
}