Search code examples
serverless-frameworkaws-step-functions

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


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?


Solution

  • 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.