amazon-web-services - 参数值在 aws cli Cloudformation 中不起作用

标签 amazon-web-services aws-cloudformation devops aws-cli aws-cloudformation-custom-resource

我正在通过 AWS CLI 运行我的云形成模板。它工作正常并在 AWS 门户上创建堆栈,但我面临一个问题,即无法更改默认参数值。我正在使用 CLI 传递我自己的参数,但只有最后一个参数值从堆栈中发生变化(即 30),其余的没有变化,而是从中选择默认值 模板主体。我已经通过更改参数的位置尝试了所有可能的方法,但它仍然相同。 所以请让我知道我将如何解决这个恼人的问题。这是我的命令:-

aws --region eu-north-1 cloudformation  create-stack --stack-name cli4  --template-body file://app_cli.json --parameters "ParameterKey"="Maxvalue","ParameterValue"="7","ParameterKey"="increment","ParameterValue"="1","ParameterKey"="incrementtime","ParameterValue"="30"

"Parameters": {
        "EnvironmentName": {
            "Description": "An environment name that will be prefixed to resource names",
            "Type": "String",
            "Default": "Codavel"
        },
        "amiID": {
        "Description": "Put ami-id in this",
        "Type": "String",
        "Default": "ami-085045326daf7e309"
        },
        "Maxvalue": {
        "Description": "Put max value in this",
        "Type": "String",
        "Default": "100"
        },
        "increment": {
        "Description": "Put No. of incremental instance this",
        "Type": "String",
        "Default": "2"
        },
        "incrementtime": {
          "Description": "Put incremental time this",
        "Type": "String",
        "Default": "60"
          
        },
        "VpcCIDR": {
            "Description": "Please enter the IP range (CIDR notation) for this VPC",
            "Type": "String",
            "Default": "10.0.0.0/16"
        },
        "PublicSubnet1CIDR": {
            "Description": "Please enter the IP range (CIDR notation) for the public subnet in the first Availability Zone",
            "Type": "String",
            "Default": "10.0.0.0/24"
        },
        "PublicSubnet2CIDR": {
            "Description": "Please enter the IP range (CIDR notation) for the public subnet in the second Availability Zone",
            "Type": "String",
            "Default": "10.0.1.0/24"
        },
        "PrivateSubnet1CIDR": {
            "Description": "Please enter the IP range (CIDR notation) for the private subnet in the first Availability Zone",
            "Type": "String",
            "Default": "10.0.2.0/24"
        },
        "PrivateSubnet2CIDR": {
            "Description": "Please enter the IP range (CIDR notation) for the private subnet in the second Availability Zone",
            "Type": "String",
            "Default": "10.0.3.0/24"
        }
    }

最佳答案

我能够重现此 CloudFormation 行为,删除参数对之间的逗号 ( as shown here ) 为我解决了这个问题:

--parameters ParameterKey=Maxvalue,ParameterValue=7 ParameterKey=increment,ParameterValue=1 ParameterKey=incrementtime,ParameterValue=30

关于amazon-web-services - 参数值在 aws cli Cloudformation 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63119465/

相关文章:

python - 从 S3 下载大量文件

amazon-s3 - 如何修复 S3 中的 "Exactly one of TransitionDate and TransitionInDays must be specified"

amazon-web-services - 使用 CreateChangeSet API 创建 CloudFormation 堆栈时如何上传 Assets ?

用于环境版本控制的 Docker 镜像存储库名称或标签

amazon-web-services - 如何在无服务器中的 aws 嵌套堆栈之间传递输出值?

php - 亚马逊AWS S3目录结构效率

amazon-web-services - 依赖不能跨越阶段边界

amazon-web-services - 用户登录时登录抛出 'Incorrect username or password' 错误

kubernetes - 如何将 nodeSelector 添加到 Deployment yaml 文件?

azure - 我们如何才能找到在特定订阅中使用 azure 中的 kubernetes pod 所产生的成本?