cdk-aspects-removal-policy
v1.0.0
Published
Apply RemovalPolicy using aws-cdk aspects.
Downloads
3
Maintainers
Readme
cdk-aspects-removal-policy
Apply RemovalPolicy using aws-cdk aspects.
Install
npm i -D cdk-aspects-removal-policy
Usage
import { App, Aspects, RemovalPolicy } from 'aws-cdk-lib';
import { ApplyRemovalPolicy } from 'cdk-aspects-removal-policy';
import { StatelessStack } from './YourStatelessStack';
import { StatefulStack } from './YourStatefulStack';
const app = new App();
const statefulStack = new StatefulStack(app, 'StatefulStack');
const statelessStack = new StatelessStack(app, 'StatelessStack');
// Apply RemovalPolicy.
Aspects.of(statefulStack).add(new ApplyRemovalPolicy(RemovalPolicy.RETAIN));
Aspects.of(statelessStack).add(new ApplyRemovalPolicy(RemovalPolicy.DESTROY));
app.synth();