繁体   English   中英

CloudFormation 参数模板错误:参数不是字母数字

[英]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.jsontemplate.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.

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