AWS: Add command for setting credentials profile

wikitext-via-macros
Jermolene 2019-03-22 09:20:25 +00:00
rodzic 9f0d726f7d
commit fffd0ee9e1
2 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -9,6 +9,16 @@ Perform operation on Amazon Web Services
--aws <sub-command> [<parameter> ...]
```
! "profile" subcommand
Sets the AWS credentials profile to be used for subsequent commands.
```
--aws profile <profile-name>
```
* ''profile-name'': AWS profile name
! "s3-load" subcommand
Load tiddlers from files in an S3 bucket.

Wyświetl plik

@ -42,6 +42,15 @@ Command.prototype.execute = function() {
Command.prototype.subCommands = {};
// Set credentials profile
Command.prototype.subCommands["profile"] = function() {
var AWS = require("aws-sdk"),
profile = this.params[1],
credentials = new AWS.SharedIniFileCredentials({profile: profile});
AWS.config.update({credentials: credentials});
this.callback(null);
};
// Load tiddlers from files in an S3 bucket
Command.prototype.subCommands["s3-load"] = function() {
var self = this,