Skip to content

How conld I set a CloudWatch alarm to monitor the Lambda function invocation over a period of a week?

0

Hi,

Our team has a Lambda function to conduct a weekly task. We want to monitor whether this Lambda function is triggered at least once during a week. I try to create a CloudWatch alarm based on the invocation metric over a period of 7 days. However, the console only allows a period of no longer than a day. How to fulfill this requirement in this situation?

I would be appreciated if anyone could provide any help. Thanks!

2 Answers
1

Hello.

I have handled something similar in the past, but at that time I created a Lambda that checked the Lambda's CloudWatch Logs every day, and created code that sent data to CloudWatch metrics only if the execution was successful.

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
1

Hi,

I think that what you're looking for is Amazon EventBridge scheduler: it allows you to run specific tasks at given moment.

See https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html

In your case, you can schedule your existing lambda via the scheduler to execute what it has to do, if needed and a least once a week.

Or you can schedule a second one that monitors the CloudWatch invocation metric for this Lambda.

Best,

Didier

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.