You need to:
- Configure the aws credentials
- Serverless framework installed.
- Node.js
- Yarn or Npm
- Run
npm install
oryarn
to install all the necessary dependencies. - Run
npm start:local
oryarn start:local
use serverless offline to test locally.
The expected result should be similar to:
Serverless: Bundling with Webpack...
Time: 659ms
Built at: 10/27/2020 7:18:32 PM
Asset Size Chunks Chunk Names
src/index.js 5.99 KiB src/index [emitted] src/index
src/index.js.map 4.58 KiB src/index [emitted] [dev] src/index
Entrypoint src/index = src/index.js src/index.js.map
[./src/helpers/response.js] 238 bytes {src/index} [built]
[./src/index.js] 209 bytes {src/index} [built]
[source-map-support/register] external "source-map-support/register" 42 bytes {src/index} [built]
Serverless: Watching for changes...
offline: Starting Offline: local/us-east-1.
offline: Offline [http for lambda] listening on http://localhost:3002
┌────────────────────────────────────────────────────────────────────────────┐
│ │
│ GET | http://localhost:3000/local/test │
│ POST | http://localhost:3000/2015-03-31/functions/getTeste/invocations │
│ │
└────────────────────────────────────────────────────────────────────────────┘
offline: [HTTP] server ready: http://localhost:3000 🚀
offline:
offline: Enter "rp" to replay the last request
$ npm run deploy:{yourStage}
or
$ yarn deploy:{yourStage}
send an HTTP request directly to the endpoint using a tool like curl
curl https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/{stage}/test
By default, AWS Lambda limits the total concurrent executions across all functions within a given region to 100. The default limit is a safety limit that protects you from costs due to potential runaway or recursive functions during initial development and testing. To increase this limit above the default, follow the steps in To request a limit increase for concurrent executions.