Last updated 26 seconds ago

Notes for


serverless create --template aws-nodejs-typescript --path project-name

Best Practices / Learnings So Far

AWS - Invoke Local

serverless invoke local --function functionName

If you want to pass a url into the event.body

JSON.stringify({ body: JSON.stringify($value)})


serverless invoke local --function functionName --data $string

API Gateway Gotchas

API Gateway Bad Naming

By default Serverless names the API Gateway as $stage-$service

This is not scaleable when you have many services. To fix this update your serverless.yml:

Type: AWS::ApiGateway::RestApi
Name: ${self:service}-${self:provider.stage}



WARNING: Changing table names drops the original database.

Be very careful.

Cannot reuse existing DynamoDBs

Serverless cannot reuse existing DyanmoDB tables. It will error our if you try to use it:

An error occurred: eventsTable - $table already exists.

Billing Mode: Pay Per Request

I ran into bugs trying to move to "PAY_PER_REQUEST" mode, and then I couldn't deploy, and when I think I fixed this, I got this error:

An error occurred: $table - Subscriber limit exceeded: Update to PayPerRequest mode are limited to once in 1 day(s). Last update at Sat Feb 23 03:07:45 UTC 2019. Next update can be made at Sun Feb 24 03:07:45 UTC 2019 (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: LimitExceededException; Request ID: E2GS9JLCCLIUH8BNIPQN32UEDBVV4KQNSO5AEMVJF66Q9ASUAAJG).

Plugin: serverless-dynamodb-local

This seems like a poor plugin.

  • Have to use v0.2.30

  • Constantly has problems running

    • Have to consistently remove and install

Useful locally for:

  • migrations

  • seeding

Use v0.2.30, there are problems with the latest version.

yarn add --dev [email protected]

Serverless Alternatives

AWS Serverless Application Model (SAM)


  • Directly define CloudFormation naming


  • More complex flags to use for deploying

  • No templating

Personal Prototypes / Toys / Experiments