Stiva
September 1, 2022 ยท View on GitHub
These stacks create a cognito user pool with two defined group (user and admin) and a Stiva DynamoDB table configured as one table, using AppSync for backend
Requirements
- AWS CDK v2
- NodeJS > 16
Installation
- Install npm packages:
npm install
Useful commands
npm run buildcompile typescript to jsnpm run cleanclean builded jsnpm run watchwatch for changes and compilenpm run testperform the jest unit testscdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits the synthesized CloudFormation template
CDK commands env Variables
Env variables to use in cdk commands:
TABLE_NAME: define DynamoDB table name (optional defaultStiva)APP_NAME: define app name (optional defaultStiva)COGNITO_SUBDOMAIN: cognito domain prefix (subdomain) (optional)AWS_REGIONCDK_DEFAULT_ACCOUNTCDK_DEFAULT_REGION
TEST
To run rest api test (canary test to use only after deployed stack on aws): AWS_PROFILE=myprofile TEST_REST=true npm test rest
IMP Need a rebuild before every test
Note Based on your OS config you should add aws environment variables
Thanks
- Borislav Hadzhiev for useful informations and reading