This cookbook maintains a .env
file in each respective app's deploy directory. E.g.:
FOO: "http://www.yahoo.com"
BAR: "1001"
Your application can then load its settings directly from this file using dotenv (https://github.com/bkeepers/dotenv).
Expects attributes of the form:
{
"custom_env": {
"my_app": {
"FOO": "http://www.yahoo.com",
"BAR": "1001"
},
"your_app": {
"BAZ": "99"
}
}
}
The opsworks_custom_env::configure
recipe should be added as a custom recipe to the Setup, Configure, and Deploy events.
A deploy is not necessary to update custom application environment values. Instead, update the Stack's custom JSON,
then choose to Run Command > execute recipes and enter opsworks_custom_env::update
into the Recipes to execute field.
Executing this recipe will write an updated .env
file and restart web server process.