A AWS Lambda function to send a SNS notification with EC2 current State of a list of ec2 instance ID
To implement this lambda function do you need:
- Use python 3.6 or pyhton 3.7 to create lambda function
- Define an IAM lambda role with SNS, EC2, and CloudWatch. You can see an example on ec2CurrentState-policies.json
- Define a SNS topic and subscription
- Define environment variables: 4.1 Key:: ARNTopic, Value: arn:topic 4.2 Key:: EC2Instances, Value: list of instance ID separated by commas without spaces 4.3 Key:: Message, Value: Message body to sns message 4.4 Key:: MessageSubject, Value: Subject to sns message
Author: Alvaro Hernandez hernandez.alvaro@gmail.com