ECS Container Logs to Slack via AWS Lambda
This was more of a discovery article to document the process for getting logs from ECS containers into a messaging service (Slack in this case). I used data from this website’s logs, specifically when the contact form receives spam data and when people go to suspicious paths that don’t exist (primarily automated scanners looking for the WordPress login page or phpMyAdmin…). The below topics are covered: Configuring containers running in AWS ECS to send logs to AWS CloudWatch Setting the AWS CloudWatch Log Group to Stream the data to an AWS Lambda function The Lambda function code for sending the data as Slack messages Configuring ECS Containers to Send Logs to CloudWatch I’m assuming if your reading this you have familiarity with AWS ECS and so I’ll jump straight to the good bit.