aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.34k stars 4.09k 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...?

elkolo commented 6 years ago

+1

mlcloudsec commented 6 years ago

+1

corpix-net commented 6 years ago

++

dowdell commented 6 years ago

+0.5

ayatsynych commented 6 years ago

+1

brianconcannon commented 6 years ago

++

mda590 commented 6 years ago

+1!

reidca commented 6 years ago

Don't understand why you would have the template in YAML but then the parameters in JSON. Seems an odd omission and would I hope that AWS are working on....please?

mbryne commented 6 years ago

+1

rogerlou66 commented 6 years ago

+1

ASayre commented 6 years ago

Good Morning!

We're closing this issue here on GitHub, as part of our migration to UserVoice for feature requests involving the AWS CLI.

This will let us get the most important features to you, by making it easier to search for and show support for the features you care the most about, without diluting the conversation with bug reports.

As a quick UserVoice primer (if not already familiar): after an idea is posted, people can vote on the ideas, and the product team will be responding directly to the most popular suggestions.

We’ve imported existing feature requests from GitHub - Search for this issue there!

And don't worry, this issue will still exist on GitHub for posterity's sake. As it’s a text-only import of the original post into UserVoice, we’ll still be keeping in mind the comments and discussion that already exist here on the GitHub issue.

GitHub will remain the channel for reporting bugs.

Once again, this issue can now be found by searching for the title on: https://aws.uservoice.com/forums/598381-aws-command-line-interface

-The AWS SDKs & Tools Team

This entry can specifically be found on UserVoice at: https://aws.uservoice.com/forums/598381-aws-command-line-interface/suggestions/33168310-cloudformation-external-parameter-file-do-not-supp

gustavomf-cit commented 6 years ago

+1

jamesls commented 6 years ago

Based on community feedback, we have decided to return feature requests to GitHub issues.

ghost commented 6 years ago

+1

jmaciasluque commented 6 years ago

+1

suxor42 commented 6 years ago

+1

yapale commented 6 years ago

+100

cslamar commented 6 years ago

+1

krmettu commented 6 years ago

+1

kharkevich commented 6 years ago

+1

badgerspoke commented 6 years ago

+1 and +1000 for more consistency overall please ;)

LordSnooz commented 6 years ago

+1

matthewflannery commented 6 years ago

This issue is 2 years old ;_;

Yaowenjie commented 6 years ago

@matthewflannery nope, it's only 587 days actually.

tianmarin commented 6 years ago

+1

@Yaowenjie 587/365 = 1.608 ~ 2 years

jcallin commented 6 years ago

+1

nemo83 commented 6 years ago

plus 11!1!1one!!1!11

gustavomf-cit commented 6 years ago

:+1:

oshmyrko commented 6 years ago

:heavy_plus_sign: :100:

mtomic commented 6 years ago

πŸ‘

Fluro commented 6 years ago

+1

Yaowenjie commented 6 years ago

there are two months left for the second-anniversary celebration of this issue, folks! πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦πŸŽ‰πŸŽ‰πŸŽŠπŸŽŠπŸ‘¨β€πŸ‘¨β€πŸ‘§β€πŸ‘¦

Fluro commented 6 years ago

Because my team are used to YAML (all our templates are in YAML) I have some shell automation that turns a YAML file into a json file, then passes that to CF. That shows (to me at least) how wanted this feature is - having customers build their own automation around basic functionality like this isn't an answer.

Also, we should note that the whole parametersKey/ParamaterValue way of working for CloudFormation is stupid.

Yashswarnkar commented 6 years ago

Could we have the CloudFormation template in YAML and provide parameters file in JSON ?

reidca commented 6 years ago

@Yashswarnkar Yes - you can have the template in YAML and the parameters in JSON. This issue is because the parameters can only be in JSON - YAML files are not supported despite the template being in YAML.

jwdinkel commented 6 years ago

+1 Really would like to be able to add comments to my parameters files and run them from the CLI. Any plans yet to add .yaml support for the create-stack CLI command with --parameters to support yaml?

qiwu7 commented 5 years ago

Any ETA for this feature?

codycodes commented 5 years ago

+1

jav-12 commented 5 years ago

Almost 2 years and still no yaml for parameters... :(

karl-barbour commented 5 years ago

+1

akshaykrjain commented 5 years ago

+1

natemacinnes-okta commented 5 years ago

+1

jwdinkel commented 5 years ago

With SSM now available with secure strings and ways to decode them, I am entertaining the idea of running a script to place the variables into the AWS account, and then to reference them from the cloudformation template... Anybody have other ideas such as this?

micklove commented 5 years ago

As per comments above, you could use cfn-flip https://github.com/awslabs/aws-cfn-template-flip

In bash - Display parameters.yaml as a json file with <( ) operator

pip install cfn_flip

cat <(cfn-flip parameters.yaml)

Use, with <( ) in the cli command

aws cloudformation update-stack --stack-name test --template-body file://./api-test.yaml --parameters file://<(cfn-flip parameters.yaml)

michael-crawford commented 5 years ago

+100

This is obviously a feature in high demand - why has there been no movement on this despite what looks like hundreds of people requesting it?

djbrightman commented 5 years ago

+1 REAL use case, is where having to specify JSON within a parameter, in which case JSON is a nightmare with having to escape quotes...

[
    {
        "ParameterKey": "DistributionJSON",
        "ParameterValue": "{\"Account_ID_1\":\"region_1,region_2\",\"Account_ID_2\":\"region_1\"}"
    }
]

Compared to:

- ParameterKey: DistributionJSON
  ParameterValue: '{"Account_ID_1":"region_1,region_2","Account_ID_2":"region_1"}'
deanoj commented 5 years ago

Well? No more updates?

the0ffh commented 5 years ago

Well? No more updates?

Calm down, it's only January 2019

njoannidi commented 5 years ago

Hey, how are these guys with merging in PRs?

I'd consider writing this if I knew the team regularly merged in PRs from those outside their org.

michael-crawford commented 5 years ago

No idea. I figure there’s enough demand for this, they will implement it eventually.