Serverless step functions
Depending on your preferred package manager, follow the instructions below to deploy your project.
Requirements: NodeJS
lts/fermium (v.14.15.0)
. If you're using nvm, runnvm use
to ensure you're using the same Node version in local and in your lambda's runtime.
- Run
npm i
to install the project dependencies - Run
npx sls deploy
to deploy this stack to AWS
- Run
yarn
to install the project dependencies - Run
yarn sls deploy
to deploy this stack to AWS
In order to test the user function locally, run the following command:
npx sls invoke local -f GetUsers
if you're using NPMyarn sls invoke local -f GetUsers
if you're using Yarn
Check the sls invoke local command documentation for more information.
The project code base is mainly located within the src
folder. This folder is divided in:
functions
- containing code base and configuration for your lambda functions
.
├── resources
| ├── functions.yml
| ├── dynamodb.yml
├── src
│ ├── functions # Lambda configuration and source code folder
│ │ ├── user-handler.ts
├── package.json
├── serverless.yml # Serverless service file
├── tsconfig.json # Typescript compiler configuration
└── webpack.config.js # Webpack configuration