From 7a5cc814c77287099e1de2fbe7d88995bec33555 Mon Sep 17 00:00:00 2001 From: Natasha <67543397+NovemberTang@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:42:19 +0000 Subject: [PATCH] formatting --- cdk/lib/snyk-tag-monitor.ts | 48 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/cdk/lib/snyk-tag-monitor.ts b/cdk/lib/snyk-tag-monitor.ts index ca9321f..ec21bd2 100644 --- a/cdk/lib/snyk-tag-monitor.ts +++ b/cdk/lib/snyk-tag-monitor.ts @@ -25,26 +25,26 @@ export class SnykTagMonitor extends GuStack { new EmailSubscription('devx.security@guardian.co.uk'), ); - const metricProps: MetricProps = { - namespace: 'snyk-tag-monitor', - metricName: 'snykTagCount', - dimensionsMap: { - 'stage': this.stage - }, - period: Duration.days(1), - statistic: "Minimum" - } - const tagMetric = new Metric(metricProps) + const metricProps: MetricProps = { + namespace: 'snyk-tag-monitor', + metricName: 'snykTagCount', + dimensionsMap: { + stage: this.stage, + }, + period: Duration.days(1), + statistic: 'Minimum', + }; + const tagMetric = new Metric(metricProps); - const tagAlarmProps: GuAlarmProps = { - comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD, - threshold: 4500, - evaluationPeriods: 1, - snsTopicName: topic.topicName, - metric: tagMetric, - app: app, - } - const tagAlarm = new GuAlarm(this, `${app}-alarm`, tagAlarmProps) + const tagAlarmProps: GuAlarmProps = { + comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 4500, + evaluationPeriods: 1, + snsTopicName: topic.topicName, + metric: tagMetric, + app: app, + }; + const tagAlarm = new GuAlarm(this, `${app}-alarm`, tagAlarmProps); const lambdaProps: GuScheduledLambdaProps = { rules: [{ schedule: Schedule.rate(Duration.days(7)) }], @@ -60,13 +60,15 @@ export class SnykTagMonitor extends GuStack { SNS_TOPIC_ARN: topic.topicArn, }, timeout: Duration.minutes(5), - retryAttempts: 1 + retryAttempts: 1, }; const lambda = new GuScheduledLambda(this, app, lambdaProps); topic.grantPublish(lambda); - const policyStatement = new PolicyStatement({actions: ['cloudwatch:PutMetricData'], resources: ['*']}) - lambda.addToRolePolicy(policyStatement) - + const policyStatement = new PolicyStatement({ + actions: ['cloudwatch:PutMetricData'], + resources: ['*'], + }); + lambda.addToRolePolicy(policyStatement); } }