File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,19 @@ function getDynamoDBPermissions(action, state) {
186
186
? '*'
187
187
: getDynamoDBArn ( state . Parameters . TableName ) ;
188
188
189
+ const indexName = state . Parameters [ 'IndexName.$' ]
190
+ ? '*'
191
+ : state . Parameters . IndexName ;
192
+
193
+ let resource ;
194
+ if ( indexName ) {
195
+ resource = `${ tableArn } /index/${ indexName } ` ;
196
+ } else {
197
+ resource = tableArn ;
198
+ }
189
199
return [ {
190
200
action,
191
- resource : tableArn ,
201
+ resource,
192
202
} ] ;
193
203
}
194
204
@@ -466,6 +476,8 @@ function getIamPermissions(taskStates) {
466
476
return getDynamoDBPermissions ( 'dynamodb:DeleteItem' , state ) ;
467
477
case 'arn:aws:states:::aws-sdk:dynamodb:updateTable' :
468
478
return getDynamoDBPermissions ( 'dynamodb:UpdateTable' , state ) ;
479
+ case 'arn:aws:states:::aws-sdk:dynamodb:query' :
480
+ return getDynamoDBPermissions ( 'dynamodb:Query' , state ) ;
469
481
470
482
case 'arn:aws:states:::aws-sdk:redshiftdata:executeStatement' :
471
483
return getRedshiftDataPermissions ( 'redshift-data:ExecuteStatement' , state ) ;
You can’t perform that action at this time.
0 commit comments