A sample project demonstrating the use of a single DynamoDB table in nest.
You need to create a .env file prior to building or running this app with the following variables:
AWS_ACCESS_KEY = XXXXX
AWS_ACCESS_SECRET_KEY = XXXXX
AWS_REGION = us-east-1 (for example)
DYNAMO_INDEX_READ_CAPACITY_UNITS = 1 (for example)
DYNAMO_INDEX_WRITE_CAPACITY_UNITS = 1
DYNAMO_TABLE_READ_CAPACITY_UNITS = 1
DYNAMO_TABLE_WRITE_CAPACITY_UNITS = 1
Migrations are not really possible with DynamoDB. createTable
/ensureTableExists
wants options for indexes defined on the entity, so theoretical "previous migrations" where an index was previously not defined will fail to run because the options were not specified for that migration. Just use the migration-runner.ts
file to update the table definition with index options specified as they change.
To create or update the table, run the command:
npm run mig:run
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.