This Python code send notification to Slack about AWS SecurityGroup changes for list of CloudWatch Rule events:
"eventName": [
"CreateSecurityGroup",
"DeleteSecurityGroup",
"AuthorizeSecurityGroupEgress",
"AuthorizeSecurityGroupIngress",
"RevokeSecurityGroupIngress",
"RevokeSecurityGroupEgress"
]
In the beggining you need to create chaint AWS CloudTrail -> AWS CloudWatch -> AWS SNS -> AWS Lambda part of tutorial from youtube video - https://www.youtube.com/watch?v=lD8tIkrJeZU
Environment variables for AWS Lambda:
- SLACK_CHANNEL: channel-name
- SLACK_USER: AWS
- SLACK_WEBHOOK_URL: https://hooks.slack.com/services/XXX/XXX/XXX