1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

AWS: Add command for setting credentials profile

This commit is contained in:
Jermolene 2019-03-22 09:20:25 +00:00
parent 9f0d726f7d
commit fffd0ee9e1
2 changed files with 19 additions and 0 deletions

View File

@ -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.

View File

@ -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,