New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-community/self-destruct

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-community/self-destruct

Ephemeral Stacks! A CDK Stack and Construct that will self-destruct after a specified time period.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Self-Destruct

:warning: This construct is designed to delete your CDK Stack after a specified amount of time! Use at your own risk! :warning:

Blog Post: Say Goodbye to Your CDK Stacks: A Guide to Self-Destruction

This project publishes an npm library that contains a CDK Stack and CDK Construct that will self-destruct the Stack at a defined interval since the last deployment.

Example Step Function Flow

The Step Function:

  1. Lists the current running executions of itself
  2. Stops old iterations
  3. Waits for the specified duration
  4. Deletes the stack after the "wait"

In the event that the CloudFormation stack was already being deleted, it will gracefully exit.

You can use this in your projects in two ways:

  • Extending the Stack
  • Using the Construct

Extending the Stack

To build this into your stacks... you can simply extend the stack:

export interface MyStackProps extends SelfDestructStackProps {};
export class MyStack extends SelfDestructStack {
  constructor(scope: Construct, id: string, props: MyProps) {
    super(scope, id, props);
  }
}

By default the self destruct construct is DISABLED. You have to explicitly enable it by passing in the selfDestructEnabled: true. You can also override the duration with the selfDestructDuration property.

Installing the construct

If instead you want to install this into an existing stack, you can!

export class MyStack {
  constructor(scope: Construct, id: string) {
    super(scope, id);
    new SelfDestructConstruct(this, 'SelfDestruct', {
      duration: Duration.days(7), // a duration is required
    });
  }
}

Keywords

FAQs

Package last updated on 13 May 2023

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