aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Cloudformation external parameter file do not support YAML file

Open Yaowenjie opened this issue 9 years ago • 171 comments

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...?

Yaowenjie avatar Nov 03 '16 10:11 Yaowenjie

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

stealthycoin avatar Nov 17 '16 22:11 stealthycoin

I'll second this feature request.

lorengordon avatar Jan 10 '17 01:01 lorengordon

I'll second it too

jlm742 avatar Feb 01 '17 23:02 jlm742

+1

csgyuricza avatar Feb 06 '17 22:02 csgyuricza

Please. This is critical for us.

dcw329 avatar Feb 06 '17 22:02 dcw329

+1

thijsdev avatar Feb 09 '17 12:02 thijsdev

absolutely +1

ddepaoli3 avatar Feb 10 '17 08:02 ddepaoli3

+1 allowing YAML formatted data for --template-body but not for --parameters is awkward

codeasone avatar Feb 23 '17 09:02 codeasone

👍

youngpm avatar Feb 23 '17 23:02 youngpm

+1

amitlalani avatar Mar 29 '17 12:03 amitlalani

+1

andymotta avatar Apr 04 '17 22:04 andymotta

+1

jdbass avatar Apr 11 '17 16:04 jdbass

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

mazerty avatar Apr 22 '17 09:04 mazerty

+1

KWSeamanCerner avatar May 05 '17 14:05 KWSeamanCerner

+100

nungster avatar May 11 '17 18:05 nungster

+1

bombadiltom avatar May 15 '17 13:05 bombadiltom

+100

sidja avatar May 23 '17 22:05 sidja

+1

nthansen avatar May 25 '17 09:05 nthansen

" 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

mbailey avatar May 30 '17 09:05 mbailey

+1

rudolf-trinimbus avatar Jun 12 '17 18:06 rudolf-trinimbus

+1

stefnovabasiq avatar Jun 27 '17 06:06 stefnovabasiq

+1

therin avatar Jun 28 '17 21:06 therin

+1

shlompy avatar Jun 29 '17 11:06 shlompy

+1

KatherineTomkins avatar Jul 03 '17 14:07 KatherineTomkins

+1

aterentic-basiq avatar Jul 04 '17 13:07 aterentic-basiq

+1

nhmaha avatar Jul 06 '17 00:07 nhmaha

+1

giuppo avatar Jul 06 '17 08:07 giuppo

+1

g-io avatar Jul 06 '17 15:07 g-io

+1

199911 avatar Jul 11 '17 11:07 199911

+999

shlompy avatar Jul 11 '17 13:07 shlompy