0

how is the best solution to create a alert with athena data?

the loadbalance logs is saved in S3 and acessed with Athena. I want alert me based on a athena query. I thinking about populate Cloudwatch metrics with athena result, and create a alert in cloudwatch. Can I create a metric direct with athena result?

I can resolve with lambda, but I'm search a better solution.

1 Answers1

0

Your question is a little bit ambiguous.

Do you want to create an alert when Athena writes to an S3 bucket?

You can achieve this through SNS and the S3 bucket config. Check this tutorial:

Example Walkthrough 1: Configure a Bucket for Notifications (Message Destination: SNS Topic and SQS Queue)

Then you can launch a different AWS service (like a Lambda function) through SNS to react to this event.

Keep in mind that you will have to wait for Athena to finish the query as it will run asynchronously. Here an example in Java to achieve this:

Athena Query execution Handling

Diego Serrano
  • 846
  • 2
  • 15
  • 34