Skip to content

Commit

Permalink
Merge pull request #636 from zirkelc/jsonata
Browse files Browse the repository at this point in the history
feat: support JSONata query language
  • Loading branch information
horike37 authored Dec 26, 2024
2 parents c49697b + d2555b7 commit 2472cc0
Show file tree
Hide file tree
Showing 3 changed files with 496 additions and 174 deletions.
22 changes: 18 additions & 4 deletions lib/deploy/stepFunctions/compileIamRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,22 @@ function getLambdaPermissions(state) {
}];
}

function getStateMachineArn(state) {
let stateMachineArn;

if (state.Arguments) {
stateMachineArn = state.Arguments.StateMachineArn.trim().startsWith('{%')
? '*'
: state.Arguments.StateMachineArn;
} else {
stateMachineArn = state.Parameters['StateMachineArn.$']
? '*'
: state.Parameters.StateMachineArn;
}

return stateMachineArn;
}

function getStepFunctionsPermissions(state) {
let stateMachineArn = state.Mode === 'DISTRIBUTED' ? {
'Fn::Sub': [
Expand All @@ -416,8 +432,7 @@ function getStepFunctionsPermissions(state) {
} : null;

if (!stateMachineArn) {
stateMachineArn = state.Parameters['StateMachineArn.$'] ? '*'
: state.Parameters.StateMachineArn;
stateMachineArn = getStateMachineArn(state);
}

return [{
Expand Down Expand Up @@ -449,8 +464,7 @@ function getStepFunctionsSDKPermissions(state) {
} : null;

if (!stateMachineArn) {
stateMachineArn = state.Parameters['StateMachineArn.$'] ? '*'
: state.Parameters.StateMachineArn;
stateMachineArn = getStateMachineArn(state);
}

return [{
Expand Down
Loading

0 comments on commit 2472cc0

Please sign in to comment.