forked from dnavarrom/aws-cost-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·34 lines (22 loc) · 812 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
process.env.SUPPRESS_NO_CONFIG_WARNING = 'y';
var awsCostExp = require("./lib/CostExplorer.js");
var configuration = require('config');
module.exports = function (config) {
if (!config) {
console.log("AWS Cost Explorer Init.. using configuration file from ./config folder")
if (!configuration.has('AWS')) {
console.log("Config Key AWS not found!!");
}
if (!configuration.has('AWS.CostExplorer')) {
console.log("Config Key AWS not found!!");
}
if (configuration.has('AWS.CostExplorer')) {
config = configuration.get("AWS.CostExplorer");
}
}
else {
console.log("AWS Cost Explorer Init.. using constructor configuration object")
}
var ace = new awsCostExp(config);
return ace;
}