Open scoates opened 7 years ago
Hmmmmmmmmmmmmmm.
On one hand, I'm strongly opposed to new forms of cruft. On the other hand, I do like the idea of people being able to distribute Zappa applications which are able to intelligently zappa init
. I could see this being a good way to set environment variables in project init that could be used inside an application, but how does init
handle lists/dicts?
Curious what other people think about this. I think I'm open to it.
I also have a public project that could benefit from something like this. Currently I have a certificate ARN in zappa_settings.json
that I don't really want to share, so I am currently encrypting the whole file and committing that instead.
It would certainly be nice though to be able to provide an incomplete settings file without the actual ARN, and then have a zappa init
step that would ask for the ARN. Then zappa init
would use the provided input and the incomplete settings file to generate a complete zappa_settings.json
file locally.
It would be helpful if we could provide incomplete/default values to add to the
zappa_settings.json
onzappa init
.Context
For my public projects, I've provided
zappa_settings.example.json
which requires the developer to manually merge in and collate defaults. This is not ideal.It would be interesting if the developer could provide a data structure to populate these defaults or ask the user to provide specific values.
For example, for paste.website, I have this
zappa_settings.example.json
:But it would be nice if the user could do
zappa init
, and as part of its execution could ask users for these fields. Additionally, it would be even nicer if zappa could run some python code to help calculate these values (for things that are determined locally).Consider this "
.zappa_defaults.py
":Then
zappa init
would ask about each of these, providing the default (if notNone
) as the default for the user to just pressenter
, outputting the results tozappa_settings.json
, upon completion.If there's interest, I can work on this a bit.