简体   繁体   中英

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.

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"
                        }
                    }
                }
            }
        }
    }
}

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM