Well, bash script actually uses sam-build and sam-deploy if you look at it. However, it does a few other things too. Mostly, I used json-refs to be able to split template into smaller (managable) files AND also optimize yaml for API Gateway's DefinitionBody. $ref there can only be used ina few places and with json-refs I can use it anywhere, making my definition body really small and easy to write/extend. Second reason is to make it easier to include AWS build/deploy into main build/deploy script that runs the same for both frontend (Webpack) and backend (AWS). And all that for different stages. It seemed much cleaner to separate the two instead of using sam-build in main build script.