如何在无服务器中连接AWS堆栈名称与其他字符串?

时间:2019-09-13 19:25:39

标签: amazon-web-services amazon-cloudformation serverless

考虑serverless模板

stepFunctions:
  stateMachines:

    MyStateMachine:
      name: "#{AWS::StackName}SomeName"

给我:

Error: The CloudFormation template is invalid: Template format error: Resource name #{AWS::StackName}SomeName is non alphanumeric.

因此,此内联不起作用。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

没什么神奇的,您不需要引号,请尝试以下操作:

stepFunctions:
  stateMachines:

    MyStateMachine:
      name: #{AWS::StackName}SomeName