What is “hellostepfunc1” in the serverless documenation for setup AWS stepfunctions?

安稳与你 提交于 2021-02-11 14:59:01

问题


In these documentation from the serverless website - How to manage your AWS Step Functions with Serverless and GiTHUb - serverless-step-functions, we can find this word hellostepfunc1: in the serverless.yml file. I could not find reference to it. I dont understand what is it, and I can't find any reference to it, even after the State Machine was created into AWS.

If I delete it I get the follow error

Cannot use 'in' operator to search for 'role' in myStateMachine

But if I change its name for someName for example I have no error and the State Machine will works good.

I could assume it is only an identifier but I not sure. Where can I find reference to it?


回答1:


This is quite specific to the library you are using and how it names the statemachine which is getting created based upon whether the name: field is provided under the hellostepfunc1: or not.

Have a look at the testcases here and here to understand better.

In-short a .yaml like

stateMachines:
    hellostepfunc1:
        definition:
            Comment: 'comment 1'
            .....

has name of statemachine like hellostepfunc1StepFunctionsStateMachine as no name was specified.

Whereas for a .yaml like

stateMachines:
    hellostepfunc1:
        name: 'alpha'
        definition:
            Comment: 'comment 1'
            .....

the name of statemachine is alpha as you had name was specified.



来源:https://stackoverflow.com/questions/51714795/what-is-hellostepfunc1-in-the-serverless-documenation-for-setup-aws-stepfuncti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!