When writing CDK, I find myself wanting to use env...
# sst
s
When writing CDK, I find myself wanting to use environment variables locally (e.g. .env.local), but use ssm for long lived environments like stage/prod. Prioritizing env variables over parameter store values seems like a common pattern. Before I go writing a method to do this, is there a common recipe or util available for this purpose?
t
I do this in my ssm loader code, it checks to see if there's a matching env and uses that
we're getting close to releasing this as part of SST we just need to make some final decisions
s
I thought you were going to say "use SSM for everything" 😆
t
haha well use ssm for everything but sometimes you need to flip a value for a bit and env tends to be easy
I still recommend using ssm for the majority of the time, personally hate managing .env files