Skip to content

Commit

Permalink
ensures unique names and descriptions for alarms, even if they're dis…
Browse files Browse the repository at this point in the history
…abled in a stage
  • Loading branch information
michaelbjacobson committed Oct 23, 2023
1 parent 896feb7 commit 9cd06eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions cdk/lib/__snapshots__/batch-email-sender.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ exports[`The BatchEmailSender stack matches the snapshot 1`] = `
],
},
],
"AlarmDescription": "API responded with 5xx to Salesforce meaning some emails failed to send. Logs at /aws/lambda/batch-email-sender-PROD repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/",
"AlarmName": "URGENT 9-5 - PROD: Failed to send email triggered by Salesforce - 5XXError (CDK)",
"AlarmDescription": "API responded with 5xx to Salesforce meaning some emails failed to send. Logs at /aws/lambda/batch-email-sender-CODE repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/",
"AlarmName": "URGENT 9-5 - CODE: Failed to send email triggered by Salesforce - 5XXError (CDK)",
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Dimensions": [
{
Expand Down Expand Up @@ -768,8 +768,8 @@ exports[`The BatchEmailSender stack matches the snapshot 1`] = `
],
},
],
"AlarmDescription": "Lambda crashed unexpectedely meaning email message sent from Salesforce to the Service Layer could not be processed. Logs at /aws/lambda/batch-email-sender-PROD repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/",
"AlarmName": "URGENT 9-5 - PROD: Failed to send email triggered by Salesforce - Lambda crash (CDK)",
"AlarmDescription": "Lambda crashed unexpectedely meaning email message sent from Salesforce to the Service Layer could not be processed. Logs at /aws/lambda/batch-email-sender-CODE repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/",
"AlarmName": "URGENT 9-5 - CODE: Failed to send email triggered by Salesforce - Lambda crash (CDK)",
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Dimensions": [
{
Expand Down
8 changes: 4 additions & 4 deletions cdk/lib/batch-email-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export class BatchEmailSender extends GuStack {
// ---- Alarms ---- //
new GuAlarm(this, 'FailedEmailApiAlarm', {
app,
alarmName: "URGENT 9-5 - PROD: Failed to send email triggered by Salesforce - 5XXError (CDK)",
alarmDescription: "API responded with 5xx to Salesforce meaning some emails failed to send. Logs at /aws/lambda/batch-email-sender-PROD repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/",
alarmName: `URGENT 9-5 - ${this.stage}: Failed to send email triggered by Salesforce - 5XXError (CDK)`,
alarmDescription: `API responded with 5xx to Salesforce meaning some emails failed to send. Logs at /aws/lambda/batch-email-sender-${this.stage} repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/`,
evaluationPeriods: 1,
threshold: 1,
actionsEnabled: isProd,
Expand All @@ -108,8 +108,8 @@ export class BatchEmailSender extends GuStack {

new GuAlarm(this, 'FailedEmailLambdaAlarm', {
app,
alarmName: "URGENT 9-5 - PROD: Failed to send email triggered by Salesforce - Lambda crash (CDK)",
alarmDescription: "Lambda crashed unexpectedely meaning email message sent from Salesforce to the Service Layer could not be processed. Logs at /aws/lambda/batch-email-sender-PROD repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/",
alarmName: `URGENT 9-5 - ${this.stage}: Failed to send email triggered by Salesforce - Lambda crash (CDK)`,
alarmDescription: `Lambda crashed unexpectedely meaning email message sent from Salesforce to the Service Layer could not be processed. Logs at /aws/lambda/batch-email-sender-${this.stage} repo at https://github.com/guardian/support-service-lambdas/blob/main/handlers/batch-email-sender/`,
evaluationPeriods: 1,
threshold: 1,
actionsEnabled: isProd,
Expand Down

0 comments on commit 9cd06eb

Please sign in to comment.