This project uses ✨ magic of git-branch and npm scripts 🪄
- After git clone, run npm install to install dependencies
- The project uses git branches to manage environments
- It needs a unique .env file per git branch - (ex: .env.)
- Currently there are two branches - main and develop
- Duplicate the .env.example file as .env.main and .env.develop
- Modify the
DEFAULT_ACCOUNTandDEFAULT_REGIONvalues
So every time you have different branches, you can add a corresponding aws sandbox or prod account
- If you want to deploy to your
devaws account, you only have to - Populate the relevant values in
.env.develop
git checkout develop && npm run deploy- If you want to deploy to your
prodaws account, you only have to - Populate the relevant values in
.env.main
git checkout main && npm run deployBRANCH=develop
ENVIRONMENT=dev
AWS_PROFILE = "burner"
DEFAULT_REGION = "ap-southeast-2"
DEFAULT_ACCOUNT = 123456789101
npm run buildcompile typescript to jsnpm run setup-hooksto update changes done to the git-hook/postinstall filenpm run watchwatch for changes and compilenpm run testperform the jest unit testsnpx cdk diffcompare deployed stack with current statenpx cdk synthemits the synthesized CloudFormation template
npm run bootstrapAutomatically picks the branch name and approprirate .env file and bootstrapsnpm run deployAutomatically picks the branch name and approprirate .env file and deploysnpm run destroyAutomatically picks the branch name and approprirate .env file and destroys