Is there any way to alarm when there are no CloudWatch log events, but wait for a period after alarm creation?

Viewed 21

I'm trying to create a CloudWatch alarm that alerts me when there are no CloudWatch log events in a specific log group within the last 30 minutes. I have this working, but I was wondering whether there was a way to prevent the alarm from immediately going into its alarm state upon creation. I've tried increasing the number of evaluation periods and data points to alarm, but to no avail: I assume that CloudWatch includes the time before the alarm's creation in its evaluation.

I've created the alarm through CDK:

new Alarm(this, 'MyAlarm', {
    comparisonOperator: ComparisonOperator.LESS_THAN_OR_EQUAL_TO_THRESHOLD,
    treatMissingData: TreatMissingData.BREACHING,
    evaluationPeriods: 1,
    threshold: 0,
    metric: new Metric({
        dimensionsMap: {LogGroupName: logGroupName},
        metricName: 'IncomingLogEvents,
        namespace: 'AWS/Logs',
        period: Duration.minutes(30),
        statistic: 'Average',
    }),
})

(some props removed)

Is there a way to prevent the alarm from going off for say, 15 minutes after its creation?

0 Answers
Related