Configuring a CloudWatch Alarm for Lambda Invocation Errors with SNS Notifications

Lab Details

  1. This lab walks you through the steps to configure a CloudWatch alarm to know when Lambda invocation experiences errors.

  2. In this lab, you will create two EC2 instances and attach them to the Elastic load balancer.

  3. Duration: 1 Hour

  4. AWS Region: US East (N. Virginia) us-east-1

Introduction

CloudWatch

  1. AWS Cloudwatch is a service that is used to monitor and collect the metrics from other AWS services periodically.

  2. It collects data in the form of logs, events, and metrics and provides you with an organized view of your AWS resources.

  3. You can use CloudWatch to detect anomalous behavior in your environments to set alarms. You can also vizualize the logs and take actions to troubleshoot issues and make sure everything works smoothly.

  4. You can monitor AWS resources such as Amazon EC2, Amazon RDS, Amazon DynamoDB tables , and many others using Cloudwatch.

  5. You can monitor the resource utilization in your account by setting up rules and events that will stop or terminate underutilized resources.

Lambda

  1. The AWS Lambda service allows you to run code without provisioning or managing dedicated servers. 

  2. Lambda functions are an example of "serverless" computing.

  3. The interesting feature about lambda is you only need to pay for the compute time you consume and you do not need to pay when your code is not running.

  4. You can run code for virtually any type of application with zero administration with the help of AWS Lambda functions.

  5. Just upload your code to Lambda and it will take care of everything required to run and scale your code with high availability

  6. We can set triggering events for our Lambda function so it can be triggered off an event-based action.

  7. Lambda currently supports various languages such as java, python, node js. 

Lab Tasks

  1. Creating a simple Lambda function

  2. Testing the function

  3. Configuring an alarm in CloudWatch to get alerted if the lambda function encounters any issue at time of execution.

  4. Make a breaking-change to the Lambda (purposefully).

  5. Execute the Lambda function to see the error code and check for an alert via email.

Architecture Diagram



Join Whizlabs_Hands-On to Read the Rest of this Lab..and More!

Step 1 : Login to My-Account
Step 2 : Click on "Access Now" to view the course you have purchased
Step 3 : You will be taken to our Learn Management Solution (LMS) to access your Labs,Quiz and Video courses