docs
docs copied to clipboard
Managing Environment Variables "At Scale"
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
envconsulwith HashiCorpvault - Use
DockerfilewithENVparameters - Use
.tfvarfiles (with or withoutterragrunt) - Use
direnvwith.envrcfiles
Ultimately, we want to achieve DRYness, but with clarity on when to use what.
.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.
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.