Skip to content

Commit 8cfe564

Browse files
committed
fix: support IAM role deleteSchedule
1 parent ca79b79 commit 8cfe564

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/deploy/stepFunctions/compileIamRole.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ function getEventBridgePermissions(state) {
563563

564564
function getEventBridgeSchedulerPermissions(action, state) {
565565
const scheduleGroupName = state.Parameters.GroupName;
566-
const scheduleTargetRoleArn = state.Parameters.Target.RoleArn;
566+
const scheduleTargetRoleArn = state.Parameters?.Target?.RoleArn;
567567

568568
return [
569569
{
@@ -575,10 +575,11 @@ function getEventBridgeSchedulerPermissions(action, state) {
575575
],
576576
},
577577
},
578-
{
578+
// create schedule needs a target role arn
579+
...(action.includes("CreateSchedule") ? {
579580
action: 'iam:PassRole',
580581
resource: scheduleTargetRoleArn,
581-
},
582+
} : {}),
582583
];
583584
}
584585

0 commit comments

Comments
 (0)