【问题标题】:What is "hellostepfunc1" in the serverless documenation for setup AWS stepfunctions?用于设置 AWS stepfunctions 的无服务器文档中的“hellostepfunc1”是什么?
【发布时间】:2018-08-07 21:03:08
【问题描述】:

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

如果我删除它,我会收到以下错误

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

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

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

【问题讨论】:

    标签: serverless-framework aws-step-functions


    【解决方案1】:

    这完全取决于您正在使用的library,以及它如何根据name: 字段是否在hellostepfunc1: 下提供而命名正在创建的状态机。

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

    简而言之 .yaml 之类的

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

    由于未指定名称,因此具有类似 hellostepfunc1StepFunctionsStateMachine 的状态机名称。

    而对于像 .yaml 这样的 .yaml

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

    状态机的名称是alpha,因为您指定了名称。

    【讨论】:

    • 好的,如果我得到它只是一个替代品,以防 name: 不存在。但我可以更改任何名称。我的意思是它可能是hellostepfunc1:hellostepfunc2:anynameiwant3:。对吗?
    猜你喜欢
    • 2020-05-04
    • 1970-01-01
    • 2018-11-24
    • 1970-01-01
    • 2021-12-24
    • 1970-01-01
    • 2019-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多