Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. var out = require('./out.json').Parameters
  2. var eachLimit = require('async').eachLimit
  3. var AWS = require("aws-sdk");
  4. var ssm = new AWS.SSM();
  5.  
  6. // Copy parameters locally
  7. // aws ssm get-parameters-by-path --path /your/path/ --recursive --with-decryption > out.json
  8.  
  9. eachLimit(out, 2, function({Name, Value, Type}, callback) {
  10. console.log('parm:', Name)
  11.  
  12.  
  13. var params = {Name, Value, Type, Overwrite: true}
  14. ssm.putParameter(params, function(err, data) {
  15. if (err) console.log("Error Loading: ", Name, err, err.stack); // an error occurred
  16. else console.log('Loaded: ', Name)
  17. callback()
  18. });
  19.  
  20. }, function(err) {
  21. // if any of the file processing produced an error, err would equal that error
  22. if( err ) {
  23. // One of the iterations produced an error.
  24. // All processing will now stop.
  25. console.log('A file failed to process');
  26. } else {
  27. console.log('All files have been processed successfully');
  28. }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement