Skip to content

Instantly share code, notes, and snippets.

@marianoc84
marianoc84 / index.js
Created May 15, 2019 17:21
Lambda function that create a CloudWatch Dashboard with some metrics
// To works proberly we need to:
// - configure Lambda Environment Variable
// - Add an execution role with DescribeInstances and PutDashboard
let AWS = require('aws-sdk');
let ec2 = new AWS.EC2();
let cw = new AWS.CloudWatch();
exports.handler = async (event) => {
var instances_description = await describeAllInstances();