[英]Add parameter to an AWS CloudFormation / CodePipeline stack
I created an application from the AWS Console, in Lambda:我从 AWS 控制台在 Lambda 中创建了一个应用程序:
That app uses sam, cloud formation, code pipeline, etc. It comes with a parameter defined in template.yml
:该应用程序使用 sam、云形成、代码管道等。它带有一个在
template.yml
中定义的参数:
Parameters:
AppId:
Type: String
but now I added a few more:但现在我又添加了一些:
Parameters:
AppId:
Type: String
CognitoUserPoolName:
Type: String
CognitoUserPoolClientName:
Type: String
Where in AWS should I define the values for those?我应该在 AWS 的哪个位置定义这些值?
You set Parameter Overrides in the sam deploy
command or in samconfig.toml , both of which apply the values at deploy-time.您在
sam deploy
命令或samconfig.toml中设置参数覆盖,两者都在部署时应用这些值。
The --parameter-overrides
option is a string of key-value pairs corresponding to the parameters in your SAM template. --parameter-overrides
选项是与 SAM 模板中的参数相对应的键值对字符串。
sam deploy --parameter-overrides 'AppId=MyReallySuperApp,CognitoUserPoolName=AppPool' ...etc
BTW, the option is called Parameter Overrides because you can set a default template value for each Parameter.顺便说一句,该选项称为参数覆盖,因为您可以为每个参数设置默认模板值。
Parameters:
AppId:
Type: String
Default: MySuperApp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.