简体   繁体   English

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

[英]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.然后面对“CloudFormation Parameter Template Error:Parameter is non alphanumeric”错误,以下代码显示了我的params.jsontemplate.json文件。

params.json参数.json

[
    {
        "ParameterKey": "name_for_abc",
        "ParameterValue": "abc"
    }
]

template.json模板.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.要解决此问题,请在params.json文件和 CloudFormation 模板的Parameters部分中将参数name_of_abc重命名为nameofabc

From the AWS documentation :来自AWS 文档

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.必须为每个参数指定一个逻辑名称(也称为逻辑 ID),该名称必须是字母数字并且在模板内的所有逻辑名称中是唯一的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在存储在同一 Cloudformation 模板中构建的 AMI 的 ImageID 的 Parameter Store 中创建参数时出错 - Error when creating a parameter in Parameter Store that stores an ImageID of an AMI built in the same Cloudformation template 用于多个参数文件和单个模板的 CloudFormation - CloudFormation for multiple parameter files and a single template CloudFormation模板-通过参数选择设置容器镜像 - CloudFormation Template - Setting Container Image by Parameter Selection 在 CloudFormation 模板中指定 VPC 参数后查找 IGW - Lookup IGW after specifying VPC parameter in CloudFormation template Cloudformation KeyValuePair 列表作为参数 - Cloudformation KeyValuePair List as a parameter AMI 列表的 Cloudformation 参数 - Cloudformation parameter for list of AMIs 在 Cloudformation 脚本中为 CommaDelimitedList 类型的参数强制执行 AllowedPattern - Enforce AllowedPattern for parameter of type CommaDelimitedList in Cloudformation script 我可以使用 CloudFormation 中的映射来定义参数吗? - Can I define a parameter by using mappings in CloudFormation? 如何在 cloudformation 的参考参数中使用 AWS principal - How to use AWS principal in reference parameter in cloudformation 如何在 CfnInclude 期间将(可选)参数直接从 CloudFormation 模板传递到 CDK 资源而不对参数列表进行硬编码? - How can I pass (optional) parameters directly from CloudFormation template to CDK resource during CfnInclude without hardcoding the parameter list?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM