Skip to content

Commit

Permalink
US72282 - move common libraries to al-collector-js
Browse files Browse the repository at this point in the history
  • Loading branch information
ikemsley committed Jan 17, 2018
1 parent def6596 commit 4a9754d
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 440 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cfn: $(AWS_TEMPLATES)

package: test package.zip

package.zip: node_modules/ lib/ *.js package.json
package.zip: node_modules/ *.js package.json
zip -r $(AWS_LAMBDA_CWE_PACKAGE_NAME) $^

deploy:
Expand Down
24 changes: 12 additions & 12 deletions checkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

const AWS = require('aws-sdk');
const async = require('async');
const m_alServiceC = require('./lib/al_servicec');
const m_alServiceC = require('al-collector-js/al_servicec');
const m_packageJson = require('./package.json');

const AZCOLLECT_ENDPOINT = process.env.azollect_api;
Expand All @@ -23,13 +23,13 @@ function checkCloudFormationStatus(event, callback) {
return callback(errorMsg('CWE00001', stringify(err)));
} else {
var stackStatus = data.Stacks[0].StackStatus;
if (stackStatus == 'CREATE_COMPLETE' ||
stackStatus == 'UPDATE_COMPLETE' ||
stackStatus == 'UPDATE_IN_PROGRESS' ||
stackStatus == 'UPDATE_ROLLBACK_COMPLETE' ||
stackStatus == 'UPDATE_ROLLBACK_IN_PROGRESS' ||
stackStatus == 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS' ||
stackStatus == 'REVIEW_IN_PROGRESS') {
if (stackStatus === 'CREATE_COMPLETE' ||
stackStatus === 'UPDATE_COMPLETE' ||
stackStatus === 'UPDATE_IN_PROGRESS' ||
stackStatus === 'UPDATE_ROLLBACK_COMPLETE' ||
stackStatus === 'UPDATE_ROLLBACK_IN_PROGRESS' ||
stackStatus === 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS' ||
stackStatus === 'REVIEW_IN_PROGRESS') {
return callback(null);
} else {
return callback(errorMsg('CWE00002', 'CF stack has wrong status: ' + stackStatus));
Expand All @@ -46,8 +46,8 @@ function checkCloudWatchEventsRule(event, finalCallback) {
if (err) {
return callback(errorMsg('CWE00003', stringify(err)));
} else {
if (data.State == 'ENABLED' &&
data.EventPattern == event.CweRulePattern) {
if (data.State === 'ENABLED' &&
data.EventPattern === event.CweRulePattern) {
return callback(null);
} else {
return callback(errorMsg('CWE00004', 'CWE Rule is incorrectly configured: ' + stringify(data)));
Expand All @@ -60,8 +60,8 @@ function checkCloudWatchEventsRule(event, finalCallback) {
if (err) {
return callback(errorMsg('CWE00005', stringify(err)));
} else {
if (data.Targets.length == 1 &&
data.Targets[0].Arn == event.KinesisArn) {
if (data.Targets.length === 1 &&
data.Targets[0].Arn === event.KinesisArn) {
return callback(null);
} else {
return callback(errorMsg('CWE00006', 'CWE rule ' + event.CloudWatchEventsRule + ' has incorrect target set'));
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const AWS = require('aws-sdk');
const async = require('async');
const zlib = require('zlib');

const m_alServiceC = require('./lib/al_servicec');
const m_alAws = require('./lib/al_aws');
const m_alServiceC = require('al-collector-js/al_servicec');
const m_alAws = require('al-collector-js/al_aws');
const m_checkin = require('./checkin');
const m_packageJson = require('./package.json');

Expand Down
106 changes: 0 additions & 106 deletions lib/al_aws.js

This file was deleted.

Loading

0 comments on commit 4a9754d

Please sign in to comment.