![](/img/trans.png)
[英]Error when creating a parameter in Parameter Store that stores an ImageID of an AMI built in the same Cloudformation template
[英]CloudFormation Parameter Template Error : Parameter is non alphanumeric
我在用
aws cloudformation validate-template --template-body file://template.json
然后面对“CloudFormation Parameter Template Error:Parameter is non alphanumeric”错误,以下代码显示了我的params.json
和template.json
文件。
参数.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
文件和 CloudFormation 模板的Parameters
部分中将参数name_of_abc
重命名为nameofabc
。
来自AWS 文档:
必须为每个参数指定一个逻辑名称(也称为逻辑 ID),该名称必须是字母数字并且在模板内的所有逻辑名称中是唯一的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.