Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thesmartmonkey/create-serverless-dynamodb-ts-service
Template of a serverless typescript api service with dynamodb
https://github.com/thesmartmonkey/create-serverless-dynamodb-ts-service
aws-lambda aws-lambda-node dynamodb serverless serverless-framework typescript
Last synced: 19 days ago
JSON representation
Template of a serverless typescript api service with dynamodb
- Host: GitHub
- URL: https://github.com/thesmartmonkey/create-serverless-dynamodb-ts-service
- Owner: TheSmartMonkey
- License: mit
- Created: 2022-07-16T10:36:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-16T10:43:17.000Z (over 2 years ago)
- Last Synced: 2024-11-05T13:13:47.612Z (2 months ago)
- Topics: aws-lambda, aws-lambda-node, dynamodb, serverless, serverless-framework, typescript
- Language: TypeScript
- Homepage:
- Size: 40.9 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serverless dynamodb typescript service template
Template of a serverless typescript api service with dynamodb
## Installation
```bash
npx degit https://github.com/TheSmartMonkey/create-serverless-dynamodb-ts-service serverless-ts-service
```Changes to be done
1. package.json config name
1. serverless.ts service name
1. Change the region in `serverless.ts` provider/region (current region: Paris)
## Getting started
1. Install serverless framework : [serverless framework Get Started](https://www.serverless.com/framework/docs/getting-started)
1. Setup your aws credentials : [aws config](https://www.serverless.com/framework/docs/providers/aws/guide/credentials)
Create a cloud formation stack on aws : `npm run deploy`
Remove a cloud formation stack on aws : `npm run undeploy`
## Manual test locally
In order to test the lambda functions locally, after you have deployed the stack a first times
for dependencies like dynamodb, run the following command:- `npx sls invoke local -f create --path src/functions/create/mock.json`
- `npx sls invoke local -f del --path src/functions/del/mock.json`
- `npx sls invoke local -f get --path src/functions/get/mock.json`
- `npx sls invoke local -f list --path src/functions/list/mock.json`
- `npx sls invoke local -f update --path src/functions/update/mock.json`Check the [sls invoke local command documentation](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/) for more information.
## To simulate remote locally
In serverless.ts put environment/OFFLINE to 'true'
Then run `npm run offline`
Your `sls invoke local` commands now target your offline stack