Skip to content

Commit 97f2f63

Browse files
author
horike37
committed
Merge branch 'master' of github.com:serverless-operations/serverless-step-functions
2 parents 0600c10 + 2472cc0 commit 97f2f63

File tree

4 files changed

+501
-179
lines changed

4 files changed

+501
-179
lines changed

.github/workflows/config.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-20.04
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-node@v2.1.4
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
1111
with:
12-
node-version: 14
12+
node-version: 18
1313
- run: |
14-
npm install
14+
npm install --legacy-peer-deps
1515
- run: |
1616
npm run lint
1717
- run: |

lib/deploy/stepFunctions/compileIamRole.js

+18-4
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,22 @@ function getLambdaPermissions(state) {
407407
}];
408408
}
409409

410+
function getStateMachineArn(state) {
411+
let stateMachineArn;
412+
413+
if (state.Arguments) {
414+
stateMachineArn = state.Arguments.StateMachineArn.trim().startsWith('{%')
415+
? '*'
416+
: state.Arguments.StateMachineArn;
417+
} else {
418+
stateMachineArn = state.Parameters['StateMachineArn.$']
419+
? '*'
420+
: state.Parameters.StateMachineArn;
421+
}
422+
423+
return stateMachineArn;
424+
}
425+
410426
function getStepFunctionsPermissions(state) {
411427
let stateMachineArn = state.Mode === 'DISTRIBUTED' ? {
412428
'Fn::Sub': [
@@ -416,8 +432,7 @@ function getStepFunctionsPermissions(state) {
416432
} : null;
417433

418434
if (!stateMachineArn) {
419-
stateMachineArn = state.Parameters['StateMachineArn.$'] ? '*'
420-
: state.Parameters.StateMachineArn;
435+
stateMachineArn = getStateMachineArn(state);
421436
}
422437

423438
return [{
@@ -449,8 +464,7 @@ function getStepFunctionsSDKPermissions(state) {
449464
} : null;
450465

451466
if (!stateMachineArn) {
452-
stateMachineArn = state.Parameters['StateMachineArn.$'] ? '*'
453-
: state.Parameters.StateMachineArn;
467+
stateMachineArn = getStateMachineArn(state);
454468
}
455469

456470
return [{

0 commit comments

Comments
 (0)