How to write SNS topic into CloudWatch log within AWS console?

Viewed 5080

I set up an email address within SES and I added SNS topic to the notifications sections.

SES topics

I can then subscribe to the SNS topic via email and I will receive the notifications but is there an easy way for me to write these notifications into CloudWatch logs within the console?

2 Answers

There is no automated facility to direct that information into logs. You could:

  • Create an AWS Lambda function that writes the data to CloudWatch Logs
  • Subscribe the Lambda function to the Amazon SNS topic

This would be a fairly simple function to write, since the SNS notification would be passed into the function. The function would simply call CloudWatch Logs to store the information.

However, depending upon your use-case for the information, it might be better stored in a database so that it can be easily queried and accessed.

The method that I did for a solution is to use console.log() in a node lambda and finally a scheduled daily lambda will export from cloud watch to s3 for a 24 hour period.

Related