Use this to send an slack message when a new instance ec2 is created with a SSD disk.
- python 3.6
- boto3 (pip install boto3)
- Slack webhook (see https://api.slack.com/incoming-webhooks)
- AWS Credentials (AWS KEY and SECRET KEY)
Step 1: Create a lambda function using the alertNewSSDInstance.py
Step 2: Create a CloudWatch Events > Rule to trigger a lambda function
Event Pattern:
{
"source": [
"aws.ec2"
],
"detail-type": [
"EBS Volume Notification"
],
"detail": {
"event": [
"createVolume",
"modifyVolume"
]
}
}