razorpay / alohomora

alohomora is razorpay's secret distribution system
32 stars 3 forks source link

[feature] Add support for file based cast #16

Open captn3m0 opened 7 years ago

captn3m0 commented 7 years ago

Basically allow this:

alohomora cast template.ini.j2 --file input.json
alohomora cast template.ini.j2 --file input.yml

Pick up values from the input file if present, otherwise pick them up from credstash.

captn3m0 commented 6 years ago

input.yml

SECRET_VAR_1: HELLO
secret2: world

And then if you try to render:

input.j2.py

super_secret = "{{file('secret2') || lookup('secret_fallback'}}"
export ENV=prod
alohomora cast input.j2.py --env $ENV --app hooli --file $ENV.input.yml