Open DaveLo opened 2 years ago
Just adding my two cents as i've also been trying to get this working. Based on this page should not StateMachineArn be specified in a Parameters object ? https://docs.aws.amazon.com/step-functions/latest/dg/sample-start-workflow.html
This is what i've been using to try to get this working.
However using that format results in another error where the referenced state machine resource is set to null in the generated role. Leading to the error
The CloudFormation template is invalid: [/Resources/NestedTestRole/Type/Policies/0/PolicyDocument/Statement/0/Resource/0] 'null' values are not allowed in templates
I've tried some different ways to reference the state machine but even when using a hardcoded ARN results in the same error.
This is the generated role
This is a Bug report (or question?)
Description
For bug reports:
serverless.yml
```yaml service: sfn-test-case frameworkVersion: '2' provider: name: aws runtime: nodejs12.x lambdaHashingVersion: 20201221 region: us-east-1 stage: dev eventBridge: useCloudFormation: true package: individually: true patterns: - "!*.json" - "!*.md" stepFunctions: stateMachines: goodbye: type: STANDARD name: someMachineName-dev id: goodbyeMachine definition: StartAt: ending States: ending: Type: Pass End: true hello: type: STANDARD definition: StartAt: invokeChild States: invokeChild: Type: Task End: true Resource: arn:aws:states:::states:startExecution StateMachineArn: Ref: goodbyeMachine plugins: - serverless-step-functions ```StackTrace
```shell TypeError: Cannot read property 'StateMachineArn.$' of undefined at getStepFunctionsPermissions (/Users/**/**/sfn-test-case/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:268:43) at /Users/**/**/sfn-test-case/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:441:16 at arrayMap (/Users/**/**/sfn-test-case/node_modules/lodash/lodash.js:653:23) at map (/Users/**/**/sfn-test-case/node_modules/lodash/lodash.js:9622:14) at Function.flatMap (/Users/**/**/sfn-test-case/node_modules/lodash/lodash.js:9325:26) at ServerlessStepFunctions.getIamPermissions (/Users/**/**/sfn-test-case/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:401:12) at /Users/**/**/sfn-test-case/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:504:56 at Array.forEach (Additional Data