Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cloudcomponents/cdk-temp-stack

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudcomponents/cdk-temp-stack

A stack that destroys itself after a given time (ttl)

  • 2.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cloudcomponents Logo

@cloudcomponents/cdk-temp-stack

Build Status cdkdx typescript python

A stack that destroys itself after a given time (ttl)

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-temp-stack

Python:

pip install cloudcomponents.cdk-temp-stack

How to use

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

// 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.

Example

See more complete examples.

License

MIT

Keywords

FAQs

Package last updated on 16 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc