在SAM的template.yaml中,是否可以定义一组参数,使它们成为云形成参数?
我想要这样做的原因是我想要创建一个允许用户提供Cloudformation参数值的启动堆栈Url。
发布于 2018-08-09 05:28:59
在兜圈子之后,这看起来是有可能的。您需要定义根级Parameters,就像定义普通cloudformation模板一样。因此,这里是我的样子:
AWSTemplateFormatVersion: '2010-09-09'
Globals:
Function:
Timeout: 300
...
Parameters:
MyUserParameter:
Type: String
Resources:
HelloWorldFunction:
Properties:
CodeUri: s3://blah/blah
Environment:
Variables:
FOO: bar
Events:
CatchAll:
Properties:
Method: GET
Path: /hello
Type: Api
Handler: hello-world
Runtime: go1.x
Tracing: Active
Type: AWS::Serverless::Function
Transform: AWS::Serverless-2016-10-31发布于 2018-08-09 17:40:05
正如n00b所说
您需要定义根级参数。
但这些参数在配置中按字母顺序排列。如果您想按链接中的方式组织它们,则必须使用元数据:
Metadata:
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
default: Name of your parameter group
Parameters:
- Parameter
ParameterLabels:
ParameterName:
default: Complete name of your parameter with spaces if you wanthttps://stackoverflow.com/questions/51758919
复制相似问题