cdkversionedstackmanager

package module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

cdk-versioned-stack-manager

A CDK construct for dealing with Versioned Stacks - multiple copies of the same stack that would forever grow over time without this. This prevents hitting AWS quotas, but allows for some replication.

Usage

new cdk.Stack(app, `VersionedStack-${Date.now()}`);

// Inside different stack
new VersionedStackManager(this, 'VersionedStackManager', {
  dryRun: false, // Use this to test the construct, will not actually delete but will log what it would delete
  numberOfStacksToKeep: 5, // Keep this many stacks
  requestId: new Date().toISOString(), // Should change every time you want this to run.
  sortDirection: "DESCENDING", // Optional, defaults to DESCENDING, indicates how your stackNames should be sorted
  stackNamePrefix: 'VersionedStack-' // The pertinent stack names should start with this
});

Use Cases

  • Blue/Green Deployments of entire stacks

Documentation

Overview

A CDK construct for dealing with Versioned Stacks - multiple copies of the same stack that would forever grow over time without...this.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVersionedStackManager_Override

func NewVersionedStackManager_Override(v VersionedStackManager, scope constructs.Construct, id *string, props IVersionedStackManagerProps)

func VersionedStackManager_IsConstruct

func VersionedStackManager_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

Types

type IVersionedStackManagerProps

type IVersionedStackManagerProps interface {
	// Will only log what it was going to do, rather than actually doing it.
	//
	// This might make you feel better about using this tool.
	DryRun() *bool
	// The number of stacks to keep.
	NumberOfStacksToKeep() *float64
	// Change this field whenever you would like the VersionedStackManager to run.
	//
	// The value can be anything, it is simply here as a trigger, and will do so on every change.
	RequestId() *string
	// In case you want to sort the stacks in a different way than the default.
	//
	// The FIRST stacks will be kept, and the rest will be deleted.
	// Default: DESCENDING.
	//
	SortDirection() *string
	// The beginning of the stack name must be consistent for the versioned stacks.
	//
	// In this way, we can only give minimal access to ONLY the stacks needed, so it is impossible to delete the wrong stacks.
	StackNamePrefix() *string
}

type VersionedStackManager

type VersionedStackManager interface {
	constructs.Construct
	// The tree node.
	Node() constructs.Node
	// Returns a string representation of this construct.
	ToString() *string
}

This construct will create a custom resource that will manage the versioned stacks, and if too many stacks are present, it will delete the oldest.

This prevents inadvertent AWS Limit errors, and keeps your account clean.

func NewVersionedStackManager

func NewVersionedStackManager(scope constructs.Construct, id *string, props IVersionedStackManagerProps) VersionedStackManager

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL