aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.34k stars 4.08k forks source link

Cloudformation external parameter file do not support YAML file #2275

Open Yaowenjie opened 7 years ago

Yaowenjie commented 7 years ago

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

stealthycoin commented 7 years ago

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
     }
]
lorengordon commented 7 years ago

I'll second this feature request.

jlm742 commented 7 years ago

I'll second it too

csgyuricza commented 7 years ago

+1

dcw329 commented 7 years ago

Please. This is critical for us.

thijsdev commented 7 years ago

+1

ddepaoli3 commented 7 years ago

absolutely +1

codeasone commented 7 years ago

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

youngpm commented 7 years ago

👍

amitlalani commented 7 years ago

+1

andymotta commented 7 years ago

+1

jdbass commented 7 years ago

+1

mazerty commented 7 years ago

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

KWSeamanCerner commented 7 years ago

+1

nungster commented 7 years ago

+100

bombadiltom commented 7 years ago

+1

sidja commented 7 years ago

+100

nthansen commented 7 years ago

+1

mbailey commented 7 years ago

" 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

rudolf-trinimbus commented 7 years ago

+1

stefnovabasiq commented 7 years ago

+1

therin commented 7 years ago

+1

shlompy commented 7 years ago

+1

KatherineTomkins commented 7 years ago

+1

aterentic-basiq commented 7 years ago

+1

nhmaha commented 7 years ago

+1

giuppo commented 7 years ago

+1

g-io commented 7 years ago

+1

199911 commented 7 years ago

+1

shlompy commented 7 years ago

+999

lucioveloso commented 7 years ago

+1

nvnivs commented 7 years ago

+1

bhegazy commented 7 years ago

+1

aaronrea commented 7 years ago

+1

andrewmyhre commented 7 years ago

+2

pyisoeyz commented 7 years ago

+1

wegel commented 7 years ago

+1

ishallbethat commented 7 years ago

+1

robgott commented 7 years ago

+1

jasonolmstead33 commented 7 years ago

+1

ozgurakan commented 7 years ago

+1

duonghanu commented 7 years ago

+1

robglarsen commented 7 years ago

+10000000

980venkat commented 7 years ago

+1

d4n13lbc commented 7 years ago

+Inf

jlongland commented 6 years ago

+1

chiptip commented 6 years ago

+1

matthewflannery commented 6 years ago

+1

gurumaia commented 6 years ago

+1

epf commented 6 years ago

+1

Here's a simple workaround using Bash process substitution and cfn-flip: aws cloudformation ... --parameters file://<(cfn-flip parameters.yml)