How to use the CloudWatch function from aws-sdk
Find comprehensive JavaScript aws-sdk.CloudWatch code examples handpicked from public code repositorys.
52 53 54 55 56 57 58 59 60 61
var AWS = require('aws-sdk'); // Set the region AWS.config.update({region: 'REGION'}); // Create CloudWatch service object var cw = new AWS.CloudWatch({apiVersion: '2010-08-01'}); cw.describeAlarms({StateValue: 'INSUFFICIENT_DATA'}, function(err, data) { if (err) { console.log("Error", err);
181
91
36
4 5 6 7 8 9 10 11 12 13
getNumberOfMentionsPast7Days, }; const { SUCCESS, UNCERTAIN } = require('./../utils'); const AWS = require('aws-sdk'); const cloudwatch = new AWS.CloudWatch(); function logResults(results) { const all = results.length; if (!all) return;
85
662
16
5 6 7 8 9 10 11 12 13 14
this.config = config || {}; AWS.config = this.config; function setEmitter() { self.cloudwatch = new AWS.CloudWatch(self.config); emitter.on('flush', function(timestamp, metrics) { self.flush(timestamp, metrics); }); } // if iamRole is set attempt to fetch credentials from the Metadata Service
53
80
5
0 1 2 3 4 5 6 7 8 9
'use strict'; const AWS = require('aws-sdk'); const CodeDeploy = new AWS.CodeDeploy(); const Lambda = new AWS.Lambda(); const CloudWatch = new AWS.CloudWatch(); const CloudFormation = new AWS.CloudFormation(); const DynamoDB = new AWS.DynamoDB(); const S3 = new AWS.S3(); const ConfigService = new AWS.ConfigService();
3
37
2
0 1 2 3 4 5 6 7 8 9
var AWS = require('aws-sdk'); var async = require('async'); var helpers = require(__dirname + '/../../../helpers/aws'); module.exports = function(AWSConfig, collection, retries, callback) { var cloudwatch = new AWS.CloudWatch(AWSConfig); async.eachLimit(collection.opensearch.listDomainNames[AWSConfig.region].data, 10, function(domain, cb){ collection.cloudwatch.getEsMetricStatistics[AWSConfig.region][domain.DomainName] = {}; var endTime = new Date();
593
0
71
15 16 17 18 19 20 21 22 23 24
// Required libraries var AWS = require('aws-sdk'); // TODO, set the region automatically var lambda = new AWS.Lambda(); var cloudwatch = new AWS.CloudWatch({apiVersion: '2010-08-01'}); // Lambda Handler console.log("Started up, waiting for someone to call the exports.handler..."); exports.handler = function(event, context, callback) {
10
42
2
2 3 4 5 6 7 8 9 10 11
var AWS = require('aws-sdk'); var memoize = require('./lib/util/memoizeWithOptions'); var promisifyAll = require('./lib/util/promisifyAll'); function cloudWatch(options) { return promisifyAll(new AWS.CloudWatch(options)); } /** * Returns an instance of AWS.CloudWatch which has Promise methods
10
26
8
0 1 2 3 4 5 6 7 8 9
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 var AWS = require('aws-sdk'); AWS.config.update({region: process.env.REGION}); var cloudWatch = new AWS.CloudWatch(); /** * Records a cloud watch custom metric */
3
13
4
25 26 27 28 29 30 31 32 33 34
region: params.region || DEFAULT_REGION }; if (params.proxy) config.httpOptions = { agent: proxy(params.proxy) }; this._cloudwatch = new AWS.CloudWatch(config); } static get name() { return DATASOURCE_NAME;
2
10
12
GitHub: logleads/LogverzCore
62 63 64 65 66 67 68 69 70 71
var autoscaling = new AWS.AutoScaling() const dynamodb = new AWS.DynamoDB() var docClient = new AWS.DynamoDB.DocumentClient() var SSM = new AWS.SSM() var cloudwatch = new AWS.CloudWatch() var message = 'ok' var RequestType = 'events' if ((Object.keys(event).length === 0) || (event.source === 'aws.events')) {
0
1
0
GitHub: dgracilieri/aws-to-slack
153 154 155 156 157 158 159 160 161 162
httpOptions: { timeout: 10000 }, }; if (this.region) { clientOpt.region = this.region; } this.cloudwatch = new AWS.CloudWatch(clientOpt); if (config.metrics) { for (const k in config.metrics) { this.addMetric(config.metrics[k]);
0
0
0
12 13 14 15 16 17 18 19 20 21
/** * @param {Object} config */ constructor (config = {}) { this._config = config; this._cloudwatch = new AWS.CloudWatch(this._config.aws || {}); this._instanceId = 'Local'; this._appName = 'unknown'; // Try to get Instance ID if possible using AWS Meta Service
0
0
5
aws-sdk.S3 is the most popular function in aws-sdk (7245 examples)