AWS Lab 9

Using Notification to trigger AWS Lambda

First things first I created an SNS topic. Then I launched an EC2 instance and used the Auto-Scaling group provided by AWS. Then I set up an IAM role and gave it S3FullAccess and AWS Lambda execute.

lab9

Then I set up the Lambda function with a script provided to me by AWS. The code will extract the EC2 instance ID from the notification message, create a snapshot of att the EBS volumes attached to the instance and add a tag to the instance to indicate that the snapshot was created. I also added a trigger to the Lambda function.

lab9snap.png

For the last task, I had to Scale-out the Auto Scaling group to trigger the Lambda function. After running the function there were created 2 snapshots.

lab-9-done.png

This lab was easy to run through and showed that setting up Auto Scaling to work through Notification is not that hard. Auto Scaling is an important function, especially if the businesses servers vary in demand because they can scale up and down based on the user traffic. This can save the business a lot of money by decreasing the services if they are not in use.

Legg igjen en kommentar