【问题标题】:CloudFormation Parameter Template Error : Parameter is non alphanumericCloudFormation 参数模板错误:参数不是字母数字
【发布时间】:2019-05-06 15:54:03
【问题描述】:

我正在使用

aws cloudformation validate-template --template-body file://template.json

然后遇到“CloudFormation Parameter Template Error : Parameter is non alphanumeric”错误,下面的代码显示了我的params.json 和template.json 文件。

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

【问题讨论】:

标签: amazon-web-services parameters amazon-cloudformation


【解决方案1】:

要解决此问题,请将 params.json 文件和 CloudFormation 模板的 Parameters 部分中的参数 name_of_abc 重命名为 nameofabc。

来自AWS documentation:

必须为每个参数指定一个逻辑名称(也称为逻辑 ID),该名称必须是字母数字,并且在模板内的所有逻辑名称中是唯一的。

【讨论】:

    猜你喜欢
    • 2016-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-14
    相关资源
    最近更新 更多