我正在使用
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"
}
]
模板.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"
}
}
}
}
}
}
}
最佳答案
要解决此问题,请将 params.json
文件和 Parameters
中的参数 name_of_abc
重命名为 nameofabc
> CloudFormation 模板的部分。
Each parameter must be given a logical name (also called logical ID), which must be alphanumeric and unique among all logical names within the template.
关于amazon-web-services - CloudFormation参数模板错误: Parameter is non alphanumeric,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53626203/