any tips for getting my lambda env vars to pick up...
# help
m
any tips for getting my lambda env vars to pick up changes when i modify the value of a secretstring in a secretsmanager secret?
t
yeah this is a pain point. The two options are to making your cache in the lambda env expire after some time and refetch so it picks up on changes other option is to manually update the lambda function if it's a one off by adding VERSION=blahblah to force a redeploy
m
yeah i tried adding an env var default but it didn't seem to force it to pick up the new secret value
i guess i can comment out the addEnvironment call one time
t
wait what are you adding to the environment?
m
func.addEnvironment(EnvVars.databaseUrl, db.makeDatabaseUrl())
t
the secret isn't fetched inside the lambda?
m
no i have a TODO to do that
t
ah gotcha my initial response was for fetching inside lambda
m
i'm trying to think how to restructure my shit to be able to do that
it would mean everywhere i get a prisma DB client i need to do an
await
call
t
that was the main motivator for supporting esm in sst so that you can use top level await
you can load ssm /secrets once and then everything can use it without awaiting it
m
yeah i know. i tried doing ESM, some lame deps don't support it yet, they use dynamic require
i can probably find a replacement for this module but theres probably a lot more i have to slog through https://github.com/hugomrdias/iso-url/issues/271
t
what I was using before esm was deasync....which is horrible but i fyou're desperate...