musketeers-lambda-go-sam is a sample project demonstrating using 3 Musketeers and GitLab CI/CD pipeline as code.
Go project is an AWS Lambda in Go binded to an API Gateway which returns the value of the environment variable ECHO_MESSAGE
on a GET /echo
request.
The 3 Musketeers pattern is being used to test, build, and deploy the Lambda function. AWS SAM is the chosen framework to handle AWS deployment. GitLab CI/CD then calls the exact same test, build and deploy commands.
For Windows users, PowerShell is recommended and make can be installed with scoop.
# create .env file based on .env.example with sample values
$ make envfile
# test
$ make test
# compile the go function and create package for SAM
$ make build pack
# deploy to aws
$ make deploy
# remove the aws stack (api gateway, lambda)
$ make remove
# clean your folder and docker
$ make clean