When running lambdas locally, will environment var...
# help
g
When running lambdas locally, will environment variables be available via
process.env
? Based on reading these docs (https://serverless-stack.com/examples/how-to-create-a-crud-api-with-serverless-using-dynamodb.html) it seems like they should be, however I'm getting
undefined
values
ouch, I think I may have used sstTable.tableName instead of sstTable.dynamodbTable.tableName. lets see if thats it
t
During local development mode we pass through whatever env variables
sst start
has
Additionally we also load
.env
files
g
Nope, still getting undefined 😞
in the lambda at toplevel I have
const table = process.env["DB_TABLE"]
Ok, I found it. Never mind - and sorry!
I passed the env var to the wrong lambda 😅
t
haha no worries 🙂