简体   繁体   English

该参数未应用于 sam 模板

[英]The parameter is not applied in the sam template

First of all, I ask for your patience that I am not familiar with English.首先,我不熟悉英语,请您耐心等待。

I am trying to deploy a serverless app through AWS' Codepipiline feature.我正在尝试通过 AWS 的 Codepipiline 功能部署无服务器应用程序。 However, in the codebuild stage, the sam template does not work properly.但是在codebuild阶段,sam模板无法正常工作。 Below are some of my templates.下面是我的一些模板。

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
  filename:
    Type: String
    Default: test
Description: !Ref filename

Obviously, despite the declaration of the filename parameter, I get the following error:显然,尽管声明了 filename 参数,但我收到以下错误:

Template format error: Every Description member must be a string.

And the template applied to the stack is as follows.应用于堆栈的模板如下。

Description:
  Fn::Ref: filename

But what I want is the following output.但我想要的是以下输出。

Description: test

There is also a problem with the sam deploy parameter "--paramater-overrides", but this doesn't work, so there's no progress. sam deploy 参数“--paramater-overrides”也有问题,但这不起作用,所以没有进展。

If you look at the AWS SAM Template Anatomy , you will find that:如果您查看AWS SAM 模板剖析,您会发现:

Description (optional) This section corresponds directly with the Description section of AWS CloudFormation templates.说明(可选) 此部分AWS CloudFormation 模板的说明部分直接对应

Parameters (optional) This section corresponds directly with the Parameters section of AWS CloudFormation templates.参数(可选) 此部分AWS CloudFormation 模板的参数部分直接对应

Subsequently, you can't reference a parameter in a Description .随后,您无法在 Description 中引用参数 This is because :这是因为

You can reference parameters from the Resources and Outputs sections of the same template.您可以从同一模板的资源和输出部分引用参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM