From 856084032eec1b0ae7ab7c43d934df594e5499e6 Mon Sep 17 00:00:00 2001 From: Perttu Savolainen Date: Wed, 9 Dec 2020 12:53:28 +0200 Subject: [PATCH] feat: add support for slack alert notifications * Update template files to match with the slack notification changes in mca-monitoring --- .../monitoring/aws-template/package.json.hbs | 25 +++++++++++-------- src/lib/monitoring/config.ts | 1 + src/lib/monitoring/types.ts | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/assets/monitoring/aws-template/package.json.hbs b/assets/monitoring/aws-template/package.json.hbs index 03b78cd..7c82542 100644 --- a/assets/monitoring/aws-template/package.json.hbs +++ b/assets/monitoring/aws-template/package.json.hbs @@ -8,21 +8,24 @@ "deploy": "cdk {{#if profile}}--profile {{ profile }} {{/if}}deploy" }, "devDependencies": { - "@aws-cdk/aws-cloudformation": "^1.67.0", - "@aws-cdk/aws-cloudwatch": "^1.67.0", - "@aws-cdk/aws-cloudwatch-actions": "^1.67.0", - "@aws-cdk/aws-dynamodb": "^1.67.0", - "@aws-cdk/aws-lambda": "^1.67.0", - "@aws-cdk/aws-logs": "^1.67.0", - "@aws-cdk/aws-sns": "^1.67.0", - "@aws-cdk/aws-sns-subscriptions": "^1.67.0", - "@aws-cdk/core": "^1.67.0", + "@aws-cdk/aws-cloudformation": "~1.75.0", + "@aws-cdk/aws-cloudwatch": "~1.75.0", + "@aws-cdk/aws-cloudwatch-actions": "~1.75.0", + "@aws-cdk/aws-dynamodb": "~1.75.0", + "@aws-cdk/aws-lambda": "~1.75.0", + "@aws-cdk/aws-lambda-nodejs": "~1.75.0", + "@aws-cdk/aws-logs": "~1.75.0", + "@aws-cdk/aws-sns": "~1.75.0", + "@aws-cdk/aws-sns-subscriptions": "~1.75.0", + "@aws-cdk/core": "~1.75.0", "@types/node": "^12.12.62", - "aws-cdk": "^1.67.0", + "aws-cdk": "~1.75.0", + "esbuild": "^0.8.15", + "node-fetch": "^2.6.1", "ts-node": "^9.0.0", "typescript": "^4.0.3" }, "dependencies": { - "mca-monitoring": "https://github.com/nordcloud/mca-monitoring/releases/download/v0.1.1/mca-monitoring-0.1.1.tgz" + "mca-monitoring": "https://github.com/nordcloud/mca-monitoring/releases/download/v0.1.1/mca-monitoring-0.1.2.tgz" } } diff --git a/src/lib/monitoring/config.ts b/src/lib/monitoring/config.ts index e4dd83e..cf4afe4 100644 --- a/src/lib/monitoring/config.ts +++ b/src/lib/monitoring/config.ts @@ -40,6 +40,7 @@ export class ConfigGenerator { id: args.profile ? `${args.profile}-alerts-alarm-${args.stage}` : `alerts-alarm-${args.stage}`, endpoints: [], emails: [], + slackWebhook: '', }, }, }, diff --git a/src/lib/monitoring/types.ts b/src/lib/monitoring/types.ts index a3bf85f..dfea1bd 100644 --- a/src/lib/monitoring/types.ts +++ b/src/lib/monitoring/types.ts @@ -197,6 +197,7 @@ export interface ConfigCustomSNS { name: string; emails?: string[]; endpoints?: string[]; + slackWebhook?: string; } export interface ConfigCustom {