Skip to content

3musketeersio/musketeers-lambda-go-sam

Repository files navigation

musketeers-lambda-go-sam

pipeline status

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.

Prerequisites

  • Docker
  • Compose
  • Make
  • AWS credentials in ~/.aws or environment variables (only for deploying to AWS)

For Windows users, PowerShell is recommended and make can be installed with scoop.

Usage

# 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

About

SAM Lambda Go template project using 3Musketeers and GitLab CI/CD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published