[英]CloudFormation Parameter Template Error : Parameter is non alphanumeric
i am using我在用
aws cloudformation validate-template --template-body file://template.json
and then facing "CloudFormation Parameter Template Error: Parameter is non alphanumeric" error, following code shows my params.json
and template.json
files.然后面对“CloudFormation Parameter Template Error:Parameter is non alphanumeric”错误,以下代码显示了我的
params.json
和template.json
文件。
params.json参数.json
[
{
"ParameterKey": "name_for_abc",
"ParameterValue": "abc"
}
]
template.json模板.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"
}
}
}
}
}
}
}
To fix the problem, rename the parameter name_of_abc
to nameofabc
in the params.json
file and the Parameters
section of the CloudFormation template.要解决此问题,请在
params.json
文件和 CloudFormation 模板的Parameters
部分中将参数name_of_abc
重命名为nameofabc
。
From the AWS documentation :来自AWS 文档:
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.
必须为每个参数指定一个逻辑名称(也称为逻辑 ID),该名称必须是字母数字并且在模板内的所有逻辑名称中是唯一的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.