Use Environment Variables in Lambda Functions


#1

Link to chapter - https://serverless-stack.com/chapters/use-environment-variables-in-lambda-functions.html


#2

Small bit of confusion - this chapter references the environment variable in our serverless.yml as the following:

# These environment variables are made available to our functions
# under process.env.
environment:
    tableName:
        Ref: NotesTable

When (I believe) it should look like:

environment:
    tableName: ${self:custom.tableName}

#3

Oh you are right. Must have missed it when we made the last correction.

Edit: I see what happened, when we made the last change we moved this part to an earlier chapter - https://serverless-stack.com/chapters/configure-dynamodb-in-serverless.html and forgot to fix it here.