0

I am running my cloud-formation template by AWS CLI. It is working properly and creating stack on the AWS portal but I am facing one issue i.e not able to change the default parameter values. I am passing my own parameters with CLI but only last parameter value is changing from the stack(i.e 30) rest is not changing instead picking the default values from the template body. I have tried every possible thing by changing the positions of parameter but it still the same. So please let me know how will i resolve this annoying issue. This is my command:-

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

2 Answers 2

6

I was able to reproduce this CloudFormation behavior, removing the commas between the parameter pairs (as shown here) fixed it for me:

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

You dont need all that Double Quotes. Try

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
3
  • Hi Oxi, Appreciate for your reply I have tried this already but didn't work for me. Commented Jul 27, 2020 at 16:46
  • Can you Share the Parameters part of Cloudformation ?
    – Jaffer
    Commented Jul 27, 2020 at 16:51
  • I have made changes in the question please have a look. Commented Jul 27, 2020 at 17:05

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.