/aws-serverless-go-with-cdk

Serverless Go function in AWS

Primary LanguageTypeScriptMIT LicenseMIT

Deployment

Hello World - Go Serverless endpoint in AWS

Golang Hello, World! app deployed with AWS Lambda function behind AWS API Gateway endpoint via Github Actions.

Table of contents

Pre-requisites

Local setup

Install go package and cdk npm dependencies

$ make setup

To see all available commands go ahead and run

$ make help
setup       : Configure local environment
build       : Build Go package
zip         : Compress Go package for deployment
cdk-deploy  : Deploy latest version through CDK
cleanup     : Clean up cloud environment

Manual deployment

Build the go source code, compress it and deploy it

$ make cdk-deploy

alt text

  • Take note of your new endpoint in the CDK Outputs section

alt text

Cleanup

$ make cdk-cleanup

alt text

Possible improvements not covered in this repo

  • Pre-commit hooks for Go and Typescript code (linting, formatting, etc)
  • Automated testing for Go and Typescript code
  • Monitoring / Healthchecks
  • Multi-environment setup
  • Running CD pipeline only when relevant cdk/ or src/ contents change

License

This project is licensed under the MIT License - see the LICENSE file for details.