When changing the value in a `.env.local` file, wh...
# help
s
When changing the value in a
.env.local
file, when does that change get picked up? I've noticed that changes to that file are not always reflected when I re-deploy my infrastructure
I'm guessing the underlying CDK synth step doesn't see the change in the value of the environment variable and doesn't trigger a re-deploy of the infrastructure
In other words, it looks the same to Cloudformation
f
Hey @Seth Geoghegan, are you seeing this on
sst start
?
The
.env
files are loaded once when
sst start
starts up. Changes to the
.env
files are not picked up until
sst start
restarts.
Is that what u r seeing?
s
I'm onboarding a co-worker to SST and she noticed her environment variables weren't getting refreshed between
sst start
. However, I think this may be due to confusion about how dotenv is working. We have stage specific dotenv files (.env.prod, .env.stage) a .env.local for local development, and a .env file for preview deploys in CI/CD. My suspicion is that she deployed to a specific stage in her local environment, then later ran
sst start
on the same environment and got confused when different .env files were used. I'll keep an eye on this and report back if something doesn't look right. For now, it looks SST is performing as expected