Created
September 27, 2019 17:46
-
-
Save justengland/452e3b2d693627e96ff8e0adc8675c8d to your computer and use it in GitHub Desktop.
Copy SSM Paramertes from account to account.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var out = require('./out.json').Parameters | |
var eachLimit = require('async').eachLimit | |
var AWS = require("aws-sdk"); | |
var ssm = new AWS.SSM(); | |
eachLimit(out, 2, function({Name, Value, Type}, callback) { | |
console.log('parm:', Name) | |
var params = {Name, Value, Type, Overwrite: true} | |
ssm.putParameter(params, function(err, data) { | |
if (err) console.log("Error Loading: ", Name, err, err.stack); // an error occurred | |
else console.log('Loaded: ', Name) | |
callback() | |
}); | |
}, function(err) { | |
// if any of the file processing produced an error, err would equal that error | |
if( err ) { | |
// One of the iterations produced an error. | |
// All processing will now stop. | |
console.log('A file failed to process'); | |
} else { | |
console.log('All files have been processed successfully'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment