Skip to content

Commit 229ca6f

Browse files
committed
feat: dynamodb update table iam policy
1 parent ab5ac68 commit 229ca6f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/deploy/stepFunctions/compileIamRole.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ function getIamPermissions(taskStates) {
433433
return getDynamoDBPermissions('dynamodb:GetItem', state);
434434
case 'arn:aws:states:::dynamodb:deleteItem':
435435
return getDynamoDBPermissions('dynamodb:DeleteItem', state);
436+
case 'arn:aws:states:::aws-sdk:dynamodb:updateTable':
437+
return getDynamoDBPermissions('dynamodb:UpdateTable', state);
436438

437439
case 'arn:aws:states:::batch:submitJob.sync':
438440
case 'arn:aws:states:::batch:submitJob':

lib/deploy/stepFunctions/compileIamRole.test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,17 @@ describe('#compileIamRole', () => {
549549
},
550550
End: true,
551551
},
552+
E: {
553+
Type: 'Task',
554+
Resource: 'arn:aws:states:::aws-sdk:dynamodb:updateTable',
555+
Parameters: {
556+
TableName: tableName,
557+
},
558+
End: true,
559+
},
552560
},
553561
},
554562
});
555-
556563
serverless.service.stepFunctions = {
557564
stateMachines: {
558565
myStateMachine1: genStateMachine('StateMachine1', helloTable, ['arn:aws:states:::dynamodb:updateItem', 'arn:aws:states:::dynamodb:putItem']),
@@ -577,6 +584,7 @@ describe('#compileIamRole', () => {
577584
'dynamodb:PutItem',
578585
'dynamodb:GetItem',
579586
'dynamodb:DeleteItem',
587+
'dynamodb:UpdateTable',
580588
]);
581589
});
582590

0 commit comments

Comments
 (0)