I'm new to Scala and I'm looking for best practice of reading values such as AWS access and secret keys. In python I use dotenv to load the values into variables. Is there a similar plugin for Scala ?
Asked
Active
Viewed 198 times
0
-
1OK. So this question is contradicting itself. Environment variables come from the environment. Not from files. If you read them from a file they are not environment variables. So ... are you actually asking how to read **configuration** parameters/properties/variables from files? – Stephen C Apr 23 '22 at 02:26
-
1For what it is worth, in Scala `sys.env` is an **immutable** map. New keys or values cannot be injected into it. The equivalent of python's `dotenv` is not implementable. – Stephen C Apr 23 '22 at 02:29
-
1Does this answer your question? [How to read an Environment variable from Java code](https://stackoverflow.com/questions/36685865/how-to-read-an-environment-variable-from-java-code) – Gaël J Apr 23 '22 at 08:05