首先,请您耐心等待我不熟悉英语。
我正在尝试通过AWS的Codepipiline功能部署无服务器应用程序。但是,在代码构建阶段,sam模板无法正常工作。以下是我的一些模板。
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
filename:
Type: String
Default: test
Description: !Ref filename
很明显,尽管声明了filename参数,但还是出现了以下错误:
Template format error: Every Description member must be a string.
应用于堆栈的模板如下。
Description:
Fn::Ref: filename
但是我想要的是以下输出。
Description: test
sam部署参数“ --paramater-overrides”也存在问题,但这不起作用,因此没有任何进展。
答案 0 :(得分:0)
如果您查看AWS SAM Template Anatomy,将会发现:
描述(可选),此部分直接对应与AWS CloudFormation模板的“描述”部分。
参数(可选),此部分直接对应与AWS CloudFormation模板的“参数”部分。
随后,您无法在“说明”中引用参数。这是because:
您可以引用同一模板的资源和输出部分中的参数。