Cloudformation external parameter file do not support YAML file
I used aws-cli to update my stacks, and want to use an external yaml file (dev.yaml) as parameters file like below:
aws cloudformation update-stack --stack-name test --template-body file://./api-test.yaml --parameters file://./dev.yaml
In dev.yaml, it only has:
---
- ParameterKey: APICacheClusterSize
ParameterValue: '1.6'
However, I got this Error message when I run the update command above:
Error parsing parameter '--parameters': Expected: '=', received: '-' for input:
---
- ParameterKey: APICacheClusterSize
^
ParameterValue: '1.6'
If I use JSON file with same context as below, and use it instead of dev.yaml, it works fine:
[
{
"ParameterKey": "APICacheClusterSize",
"ParameterValue": "1.6"
}
]
So, can the external parameters file for aws cloudformation be YAML file? or will...?
Hi, we currently don't have any plans to support YAML as part of the command line arguments. I will mark this as a feature request as I can see how it might be useful for some people.
The contents of the the file you provide to --parameters is loaded and dumped straight in as an argument so you can only have the file contents be in one of two formats:
Shorthand syntax:
ParameterKey=string,ParameterValue=string,UsePreviousValue=boolean
or JSON syntax:
[
{
"ParameterKey": "string",
"ParameterValue": "string",
"UsePreviousValue": true|false
}
]
I'll second this feature request.
I'll second it too
+1
Please. This is critical for us.
+1
absolutely +1
+1 allowing YAML formatted data for --template-body but not for --parameters is awkward
👍
+1
+1
+1
since you can provide a template in yaml, you should be able to provide the parameters in yaml too i think this feature is a must-have
+1
+100
+1
+100
+1
" https://gist.github.com/mbailey/2f7c878eed123cab6fb125117f35aecc " " yamlise - see YAML when editing JSON files in vim. " " Created for people with JSON phobia, this should " only be used when all attempts to master JSON " have failed. http://www.json.org/ " " I hope it isn't too late for these folks! " 'Please. This is critical for us.' " https://github.com/aws/aws-cli/issues/2275#issuecomment-277829948 " " Installation " ============ " 1. Install cfn-flip https://github.com/awslabs/aws-cfn-template-flip " 2. Include this file in your ~/.vimrc " 3. vim cloudformation-params.json " YOU SHOULD NOW SEE THE YAML YOU CRAVE " 4. :wq " The file should now contain the JSON Amazon CLI expects " :augroup yamlise : autocmd! : autocmd BufReadPost,FileReadPost *.json '[,']!cfn-flip : autocmd BufWritePre,FileWritePre *.json '[,']!cfn-flip : autocmd FileAppendPre *.json '[,']!cfn-flip :augroup END
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+999