I am looking to add Kinetic to my chicago boss app, I have added the kinetic library to the deps directory within my chicago boss app. When I run the erlang shell from within the kinetic directory I have a development.config in the root of the kinetic directory that looks like the below:
[{kinetic,
[{args, [
% All of these values are optional
% kinetic will get all of the context from the instance
{region, "us-east-1"},
{aws_access_key_id, "AKAAAAAABABABA"},
{aws_secret_access_key, "3/Fx9987sxc352728181892838bhbjkd"},
{iam_role, "kinetic"},
{lhttpc_opts, [{max_connections, 5000}]}
]}]
}].
when I start the chicago boss app and run a kinetic command Im getting an invalid credentials error so it seems the kinetic library loaded properly but not the constants for my aws keys...Any idea how to do this in chicago boss?
Thanks!
Solution
Just paste your tuple
{kinetic, [...]}
fromdevelopment.config
toboss.config
which contains list of configurations for your erlang applications.More general about configuration files
In each application which depends on configuration we can see code like
application:get_env(App, Key)
orapplication:get_env(App, Key, SomeDefault)
. It's in fact call toapplication_controller
which briefly manages application loading/unloading/starting/stoping and keeps informations about it. You can check how much it knows withio:format("~n~p~n",[ets:tab2list(ac_tab)]).
These are mostly taken from.app
files inebin/
directory which are mostly generated by rebar fromapp.src
insrc/
during compilation.The most interesting key for us in
.app.src
isenv
which should contain default configuration for application which will be loaded as first and then some of those values will be overridden by your system config which is nowboss.config
.When you were playing with
kinetic
in it's development environment you were starting it byerl -pa ebin -pa deps/*/ebin -s inets -s crypto -s ssl -s lhttpc -config development -s kinetic
with-config
you passed your system config and overridde default environment values which in this case are not specified and defaults are resolved after application is started inkinetic_config.erl
but look atlager.app.src
and compare it to one within yourboss.config
. Now you see how to tweak it. Let's start with colouring logs ;)From official documentation: Configuring an Application and config