Skip to content

Commit

Permalink
Disable alarm on CODE
Browse files Browse the repository at this point in the history
  • Loading branch information
tkgnm committed Nov 9, 2023
1 parent a58d74e commit 5d5ac16
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,39 @@ Object {
},
"Type": "AWS::CloudWatch::Alarm",
},
"androidSenderTooFewInvocationsAlarmC306ECD5": Object {
"Properties": Object {
"ActionsEnabled": false,
"AlarmActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"AlarmDescription": "Triggers if the android sender lambda is not frequently invoked in PROD.",
"ComparisonOperator": "LessThanOrEqualToThreshold",
"Dimensions": Array [
Object {
"Name": "FunctionName",
"Value": Object {
"Ref": "androidSenderLambdaCtr85CB623B",
},
},
],
"EvaluationPeriods": 1,
"MetricName": "Invocations",
"Namespace": "AWS/Lambda",
"OKActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"Period": 360,
"Statistic": "Sum",
"Threshold": 0,
"TreatMissingData": "breaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
"androidbetaExecutionRoleFA113395": Object {
"Properties": Object {
"AssumeRolePolicyDocument": Object {
Expand Down Expand Up @@ -947,6 +980,39 @@ Object {
},
"Type": "AWS::CloudWatch::Alarm",
},
"androidbetaSenderTooFewInvocationsAlarm7B50CD4B": Object {
"Properties": Object {
"ActionsEnabled": false,
"AlarmActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"AlarmDescription": "Triggers if the android-beta sender lambda is not frequently invoked in PROD.",
"ComparisonOperator": "LessThanOrEqualToThreshold",
"Dimensions": Array [
Object {
"Name": "FunctionName",
"Value": Object {
"Ref": "androidbetaSenderLambdaCtrB3CF7FC4",
},
},
],
"EvaluationPeriods": 1,
"MetricName": "Invocations",
"Namespace": "AWS/Lambda",
"OKActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"Period": 360,
"Statistic": "Sum",
"Threshold": 0,
"TreatMissingData": "breaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
"androideditionExecutionRoleDEF8ADAE": Object {
"Properties": Object {
"AssumeRolePolicyDocument": Object {
Expand Down Expand Up @@ -1384,6 +1450,39 @@ Object {
},
"Type": "AWS::CloudWatch::Alarm",
},
"androideditionSenderTooFewInvocationsAlarmE4AB00FB": Object {
"Properties": Object {
"ActionsEnabled": false,
"AlarmActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"AlarmDescription": "Triggers if the android-edition sender lambda is not frequently invoked in PROD.",
"ComparisonOperator": "LessThanOrEqualToThreshold",
"Dimensions": Array [
Object {
"Name": "FunctionName",
"Value": Object {
"Ref": "androideditionSenderLambdaCtrF0169D16",
},
},
],
"EvaluationPeriods": 1,
"MetricName": "Invocations",
"Namespace": "AWS/Lambda",
"OKActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"Period": 360,
"Statistic": "Sum",
"Threshold": 0,
"TreatMissingData": "breaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
"iosExecutionRoleEE25DF12": Object {
"Properties": Object {
"AssumeRolePolicyDocument": Object {
Expand Down Expand Up @@ -1821,6 +1920,39 @@ Object {
},
"Type": "AWS::CloudWatch::Alarm",
},
"iosSenderTooFewInvocationsAlarm14117FE9": Object {
"Properties": Object {
"ActionsEnabled": false,
"AlarmActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"AlarmDescription": "Triggers if the ios sender lambda is not frequently invoked in PROD.",
"ComparisonOperator": "LessThanOrEqualToThreshold",
"Dimensions": Array [
Object {
"Name": "FunctionName",
"Value": Object {
"Ref": "iosSenderLambdaCtr6053C1F8",
},
},
],
"EvaluationPeriods": 1,
"MetricName": "Invocations",
"Namespace": "AWS/Lambda",
"OKActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"Period": 360,
"Statistic": "Sum",
"Threshold": 0,
"TreatMissingData": "breaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
"ioseditionExecutionRole61247F06": Object {
"Properties": Object {
"AssumeRolePolicyDocument": Object {
Expand Down Expand Up @@ -2258,6 +2390,39 @@ Object {
},
"Type": "AWS::CloudWatch::Alarm",
},
"ioseditionSenderTooFewInvocationsAlarmD32BB28C": Object {
"Properties": Object {
"ActionsEnabled": false,
"AlarmActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"AlarmDescription": "Triggers if the ios-edition sender lambda is not frequently invoked in PROD.",
"ComparisonOperator": "LessThanOrEqualToThreshold",
"Dimensions": Array [
Object {
"Name": "FunctionName",
"Value": Object {
"Ref": "ioseditionSenderLambdaCtr2410D4D7",
},
},
],
"EvaluationPeriods": 1,
"MetricName": "Invocations",
"Namespace": "AWS/Lambda",
"OKActions": Array [
Object {
"Ref": "AlarmTopicArn",
},
],
"Period": 360,
"Statistic": "Sum",
"Threshold": 0,
"TreatMissingData": "breaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
},
}
`;
2 changes: 1 addition & 1 deletion notificationworkerlambda/cdk/lib/senderworker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class SenderWorker extends cdkcore.Construct {
senderErrorAlarm.addAlarmAction(snsTopicAction)
senderErrorAlarm.addOkAction(snsTopicAction)

if (scope.stage === 'CODE') {
if (scope.stage !== 'CODE') {
const senderTooFewInvocationsAlarm = new cloudwatch.Alarm(this, 'SenderTooFewInvocationsAlarm', {
alarmDescription: `Triggers if the ${id} sender lambda is not frequently invoked in ${scope.stage}.`,
comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_OR_EQUAL_TO_THRESHOLD,
Expand Down

0 comments on commit 5d5ac16

Please sign in to comment.