Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Expose AWS EC2 scheduled events as a CloudWatch Metric

An AWS Lambda function to expose AWS EC2 scheduled events as a CloudWatch Metric

Prerequisites:

Setup:

  • Check out this project
  • Modify the role setting in function.json to point to your AWS IAM Lambda execution role with the appropriate settings. The value should be the IAM role's ARN.
  • Deploy the Lambda function to your AWS account using the apex command line tool.
  • In the AWS Lambda console, setup a scheduled event trigger for the deployed function
  • Optional: After running the Lambda function at least once, configure a CloudWatch alert on the new metric

Example IAM Lambda Execution Role:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:*:*:*"
    },
    {
       "Effect": "Allow",
       "Action": [
         "ec2:DescribeInstanceStatus"
       ],
       "Resource":"*"
     },
     {
       "Sid": "Stmt1463486944000",
       "Effect": "Allow",
       "Action": [
         "cloudwatch:PutMetricData"
       ],
       "Resource": [
         "*"
       ]
     }
  ]
}    

About

An AWS Lambda function to expose AWS EC2 scheduled events as a CloudWatch Metric

Topics

Resources

License

Releases

No releases published

Packages

No packages published