Minimal starter template for a Go web service using Gin, MySQL, Redis, and Kafka.
git clone git@github.com:mamh1019/lambda-go-server-boilerplate.git
cd lambda-go-server-boilerplate
go mod tidy
go run ./...Lambda entrypoint is in lambda/main.go. You can deploy in two ways:
Manual build & upload
GOOS=linux GOARCH=amd64 go build -o bootstrap ./lambda
zip function.zip bootstrapUpload function.zip to AWS Lambda with:
- Runtime:
provided.al2 - Handler:
bootstrap - Connect via API Gateway HTTP API or ALB to expose the HTTP endpoints.
Using Makefile
make deploy # build build/function.zip
FUNCTION_NAME=lambda-go-server-boilerplate-dev make deploy-awsGitHub Actions (CI/CD)
On push:
mainbranch → deploys tolambda-go-server-boilerplate-proddevbranch → deploys tolambda-go-server-boilerplate-dev
Configured in .github/workflows/deploy-lambda.yml (requires AWS credentials in repository secrets).
MYSQL_DSNREDIS_ADDRKAFKA_BROKERS
Opinionated Go boilerplate for REST APIs with Gin, MySQL, Redis caching, and Kafka integration.