Bootstrap project to quickly kick off your serverless projects running with Node.js and AWS SAM framework.
Features:
- Type checking and compilation for TypeScript code
Click on the green button that says "Use this template", then chose a name for your new repository. This will create a new repository using this one.
- Copy the
configs/.env.example
variable file toconfigs/.env
and change the project name, username, aws profile.
cp configs/.env.example configs/.env
-
Go to AWS console -> IAM -> Users -> Create, and create new user with programmatic access.
-
Run the following commands, and use the IAM key / secret you generated.
make setup
make docker-build
make install
To invoke the function locally through API Gateway
make run
When this command runs successfully, you will see the endpoints you can invoke
To deploy the application to your aws account, invoke the following command
make deploy
- The default profile for deploy command is the aws profile in your .env, You can override it as follow:
make deploy STAGE=staging
help Prints this help screen
setup Create the s3 bucket that will host the artifcats in aws environment
docker-build Build the docker image to execute make commands locally
install install npm dependencies
lint Run linter
format Format code
tests Run tests
deploy Deploy application code (template.yml) to aws environment
run Run the lambda functions locally
logs Display logs of certain function (ex: make logs function=FUNCTION-NAME)
destroy Destroy the stacks (resources & application)