forked from awslabs/aws-lambda-redshift-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateConfig.js
More file actions
executable file
·31 lines (25 loc) · 798 Bytes
/
updateConfig.js
File metadata and controls
executable file
·31 lines (25 loc) · 798 Bytes
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
#!/usr/bin/env node
var common = require('./common');
var args = require('minimist')(process.argv.slice(2));
var aws = require('aws-sdk');
aws.config.update({
region: args.region
});
// configure dynamo db, kms, s3 and lambda for the correct region
dynamoDB = new aws.DynamoDB({
apiVersion: '2012-08-10',
region: args.region
});
common.updateConfig(args.s3Prefix, args.configAttribute, args.configValue, dynamoDB, function (err) {
if (err) {
console.log(err);
process.exit(-1);
} else {
if (args.configValue) {
console.log("Updated Attribute " + args.configAttribute + " = " + args.configValue + " OK");
} else {
console.log("Removed Attribute " + args.configAttribute);
}
process.exit(0);
}
});