As with v0.1.72, ion behavior for dotenv files seems to be:
Sst loads variables from .env and .env.{stage} if they are available (respectively, so .env values will take precedence)
Only dotenv files in the same folder as sst.config.ts are loaded (usually, the root of the project).
It would be great to be able to override this behavior in the app block of the sst.config.ts. This way the user can load any dotfiles they want, in any order and location, or not load any at all (e.g. by specifying an empty array or null/false).
Also, for those interested in more details, since it doesn't seem to be documented yet:
This behavior is true even if sst is run in subdirectories.
The values loaded are made available for the sst.config.ts but are not passed to child processes (e.g. code run with sst dev, built/deployed with sst deploy, or run with sst shell).
To inject env vars in child processes, they must be specified in the environments argument of the relevant components (e.g. StaticSite, Function, DevCommand, etc.).
Also relevant: AWS_PROFILE is not injected in child processes, instead SST injects temporary credentials generated with the profile.
As with v0.1.72, ion behavior for dotenv files seems to be:
.env
and.env.{stage}
if they are available (respectively, so.env
values will take precedence)sst.config.ts
are loaded (usually, the root of the project).It would be great to be able to override this behavior in the app block of the
sst.config.ts
. This way the user can load any dotfiles they want, in any order and location, or not load any at all (e.g. by specifying an empty array or null/false).Also, for those interested in more details, since it doesn't seem to be documented yet:
sst.config.ts
but are not passed to child processes (e.g. code run withsst dev
, built/deployed withsst deploy,
or run withsst shell
).environments
argument of the relevant components (e.g.StaticSite
,Function
,DevCommand
, etc.).AWS_PROFILE
is not injected in child processes, instead SST injects temporary credentials generated with the profile.