用于设置 AWS 步骤函数的无服务器文档中的 "hellostepfunc1" 是什么?

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

在无服务器网站的这些文档中 - How to manage your AWS Step Functions with Serverless and GiTHUb - serverless-step-functions,我们可以在 serverless.yml 文件中找到这个词 hellostepfunc1:。我找不到它的参考。我不明白它是什么,也找不到任何参考,即使在 AWS 中创建了状态机之后也是如此。

如果我删除它,我会收到跟随错误

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

但是,如果我将其名称更改为 someName,则我没有错误,状态机将正常工作。

我可以假设它只是一个标识符,但我不确定。 我在哪里可以找到它的参考资料?

这非常特定于您正在使用的 library 以及它如何根据 hellostepfunc1: 下是否提供 name: 字段来命名正在创建的状态机.

查看测试用例 here and here 以更好地理解。

简而言之就是一个类似

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

状态机的名称类似于 hellostepfunc1StepFunctionsStateMachine,因为未指定名称。

而对于像

这样的 .yaml
stateMachines:
    hellostepfunc1:
        name: 'alpha'
        definition:
            Comment: 'comment 1'
            .....

statemachine 的名称是 alpha,因为您已经指定了名称。