Reputation: 719
I am using
aws cloudformation validate-template --template-body file://template.json
and then getting error:
CloudFormation Parameter Template Error : Parameter is non alphanumeric
Following code shows my params.json
and template.json
files.
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"
}
}
}
}
}
}
}
Upvotes: 21
Views: 31194
Reputation: 719
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.
From the AWS documentation:
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.
Upvotes: 37