docs icon indicating copy to clipboard operation
docs copied to clipboard

Managing Environment Variables "At Scale"

Open osterman opened this issue 6 years ago • 3 comments

what

  • Describe the problem with too many environment variables and how to manage them

why

  • There are a lot of ways to manage them. There are tradeoffs with all of them - thus a true "best practice" is hard to distill

examples

Here are a few approaches:

  • Use chamber
  • Use envconsul with HashiCorp vault
  • Use Dockerfile with ENV parameters
  • Use .tfvar files (with or without terragrunt)
  • Use direnv with .envrc files

osterman avatar Dec 11 '18 02:12 osterman

Ultimately, we want to achieve DRYness, but with clarity on when to use what.

osterman avatar Dec 11 '18 02:12 osterman

.tfvars is the most intuitive, coming from the world of terraform.

direnv has been brilliant in projects where my directory structure has had a strong correlation to the project architecture (both logical and/or infrastructure)

I want to explore using docker file env parameters more, possibly with a more multi image layer approach.

jdn-za avatar Dec 11 '18 06:12 jdn-za

I want to explore using docker file env parameters more, possibly with a more multi image layer approach.

The biggest downside with this is needing to rebuild the image, especially if using envs-inside-of-envs. We do this a lot today, but the impact on development is less desirable.

osterman avatar Dec 11 '18 06:12 osterman