diff --git a/plugins/tiddlywiki/aws/docs/help.tid b/plugins/tiddlywiki/aws/docs/help.tid index c6b294e07..dc07f24f3 100644 --- a/plugins/tiddlywiki/aws/docs/help.tid +++ b/plugins/tiddlywiki/aws/docs/help.tid @@ -9,6 +9,16 @@ Perform operation on Amazon Web Services --aws [ ...] ``` +! "profile" subcommand + +Sets the AWS credentials profile to be used for subsequent commands. + +``` +--aws profile +``` + +* ''profile-name'': AWS profile name + ! "s3-load" subcommand Load tiddlers from files in an S3 bucket. diff --git a/plugins/tiddlywiki/aws/modules/command.js b/plugins/tiddlywiki/aws/modules/command.js index 3c62e87d9..294f182bd 100644 --- a/plugins/tiddlywiki/aws/modules/command.js +++ b/plugins/tiddlywiki/aws/modules/command.js @@ -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,