Home

Awesome

Welcome to cdk-elasticache-monitor

ElasticacheAutoMonitor allows you to send email, sms, slack, or trigger aws lambda when an alarm occurs. You will get the following monitoring:

Reference: Here

Usage


const stack = new cdk.Stack();

// or sent with sms
ElasticacheAutoMonitor.setUpWithSms(stack, 'my-elasticache-id', {
  phones: ['+15533728278'],
  nodeTypeClass: NodeType.R4_16XLARGE,
});

// or sent with slack
ElasticacheAutoMonitor.setUpWithSlack(stack, 'my-elasticache-id', {
  webHookUrl: 'http://xxx.xxx.xxx',
  nodeTypeClass: NodeType.R4_16XLARGE,
});

// or trigger lambda
const fn = new lambda.Function(stack, 'MyFunction', {
  runtime: lambda.Runtime.NODEJS_10_X,
  handler: 'index.handler',
  code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
});
ElasticacheAutoMonitor.setUpWithLambda(stack, 'my-elasticache-id', fn, {
  nodeTypeClass: NodeType.R4_16XLARGE,
});