@@ -54,12 +54,17 @@ module.exports = function (S) {
54
54
description : 'Stage that dynamodb should be remotely executed'
55
55
} , {
56
56
option : 'table_prefix' ,
57
- shortcut : 'p ' ,
57
+ shortcut : 't ' ,
58
58
description : 'Table name prefix'
59
59
} , {
60
60
option : 'table_suffix' ,
61
61
shortcut : 'x' ,
62
62
description : 'Table name suffix'
63
+ } ,
64
+ {
65
+ option : 'profile' ,
66
+ shortcut : 'p' ,
67
+ description : 'aws profile'
63
68
}
64
69
]
65
70
} ) ;
@@ -78,12 +83,17 @@ module.exports = function (S) {
78
83
description : 'Stage that dynamodb should be remotely executed'
79
84
} , {
80
85
option : 'table_prefix' ,
81
- shortcut : 'p ' ,
86
+ shortcut : 't ' ,
82
87
description : 'Table name prefix'
83
88
} , {
84
89
option : 'table_suffix' ,
85
90
shortcut : 'x' ,
86
91
description : 'Table name suffix'
92
+ } ,
93
+ {
94
+ option : 'profile' ,
95
+ shortcut : 'p' ,
96
+ description : 'aws profile'
87
97
} ]
88
98
} ) ;
89
99
S . addAction ( this . remove . bind ( this ) , {
@@ -204,6 +214,10 @@ module.exports = function (S) {
204
214
execute ( evt ) {
205
215
let self = this ,
206
216
options = evt . options ;
217
+ if ( options . profile ) {
218
+ AWS . config . credentials =
219
+ new AWS . SharedIniFileCredentials ( { profile : options . profile } ) ;
220
+ }
207
221
return new BbPromise ( function ( resolve , reject ) {
208
222
let dynamodb = self . dynamodbOptions ( options . stage , options . region ) ,
209
223
tableOptions = self . tableOptions ( options . table_prefix , options . table_suffix ) ;
@@ -215,6 +229,11 @@ module.exports = function (S) {
215
229
executeAll ( evt ) {
216
230
let self = this ,
217
231
options = evt . options ;
232
+ if ( options . profile ) {
233
+ AWS . config . credentials =
234
+ new AWS . SharedIniFileCredentials ( { profile : options . profile } ) ;
235
+ }
236
+
218
237
return new BbPromise ( function ( resolve , reject ) {
219
238
let dynamodb = self . dynamodbOptions ( options . stage , options . region ) ,
220
239
tableOptions = self . tableOptions ( options . table_prefix , options . table_suffix ) ;
0 commit comments