From the course: AWS: Monitoring and Reporting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Lambda in response to CloudWatch alarms

Lambda in response to CloudWatch alarms - Amazon Web Services (AWS) Tutorial

From the course: AWS: Monitoring and Reporting

Start my 1-month free trial

Lambda in response to CloudWatch alarms

- [Instructor] Let's walk through the steps needed to configure AWS Lambda to respond to CloudWatch Events. Let's say we have a critical application server that always needs to be in the running state. We'll configure a CloudWatch Event rule to monitor the state of this application server and a Lambda function that will restart the instance if it moves to the stopped state. Let's start with AWS Lambda. From the Lambda Management Console, I'll click Create function. I'll use the option Author from scratch to create a new blank function. Let's give it a name. Next, I'll set the runtime to Python 2.7 and choose an existing IAM role. This IAM role will provide Lambda the required permissions to start an EC2 instance. If you'd like to view the Lambda function logs in CloudWatch, also make sure to add those permissions to the IAM role. Next, I'll click Create function. The function has now been created. I'll scroll down to…

Contents