cdk-drift-monitor
TypeScript icon, indicating that this package has built-in type declarations

0.2.329 • Public • Published

CDK Drift Monitor

Monitors for CloudFormation stack drifts. By default, detects drifts for all stacks:

new DriftMonitor(driftDetectStack, 'DriftMonitor');

You can also specify a list of stacks to detect drifts:

new DriftMonitor(driftDetectStack, 'DriftMonitor', {
  stacks: [myStack1, myStack2],
});

It can also be initialized by providing stack names:

new DriftMonitor(driftDetectStack, 'DriftMonitor', {
  stackNames: ['myStack1', 'myStack2'],
});

By default, the drift detection will run every hour. This can be customized:

new DriftMonitor(driftDetectStack, 'DriftMonitor', {
  runEvery: Duration.hours(24),
});

The construct creates an alarm with no actions. Here's an example for adding an alarm action:

import * as sns from 'aws-cdk-lib/aws-sns';
import { SnsAction } from 'aws-cdk-lib/aws-cloudwatch-actions';

const driftMonitor = new DriftMonitor(driftDetectStack, 'DriftMonitor');
const topic = new sns.Topic(this, 'errorTopic');
driftMonitor.alarm.addAlarmAction(new SnsAction(topic));

Roadmap

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Readme

Keywords

Package Sidebar

Install

npm i cdk-drift-monitor

Weekly Downloads

267

Version

0.2.329

License

Apache-2.0

Unpacked Size

23.3 MB

Total Files

20

Last publish

Collaborators

  • haimlit
  • cdklabs-automation