This Python code send notification to Slack about AWS SecurityGroup changes for list of CloudWatch Rule events:

    "eventName": [
      "CreateSecurityGroup",
      "DeleteSecurityGroup",
      "AuthorizeSecurityGroupEgress",
      "AuthorizeSecurityGroupIngress",
      "RevokeSecurityGroupIngress",
      "RevokeSecurityGroupEgress"
      ]

AWS_Lambda_notify_from_SNS_to_Slack

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

Script has written for Python 2.7

Environment variables for AWS Lambda: