【发布时间】:2019-05-06 15:54:03
【问题描述】:
我正在使用
aws cloudformation validate-template --template-body file://template.json
然后遇到“CloudFormation Parameter Template Error : Parameter is non alphanumeric”错误,下面的代码显示了我的params.json 和template.json 文件。
params.json
[
{
"ParameterKey": "name_for_abc",
"ParameterValue": "abc"
}
]
template.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Transform": "AWS::Serverless-2016-10-31",
"Description": "some text",
"Parameters": {
"name": {
"Description": "name_of_abc",
"Type": "String"
}
},
"Resources": {
"LambdaFunctionAuto": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Environment": {
"Variables": {
"name_of_abc": {
"Ref": "name_of_abc"
}
}
}
}
}
}
}
【问题讨论】:
-
考虑使用 SSM 保存的参数,如本文aws.amazon.com/blogs/mt/…中所述
-
避免在资源、参数等名称中使用 _ 和 - 字符。
标签: amazon-web-services parameters amazon-cloudformation