https://github.com/laaraujo/aws-serverless-go-with-cdk
Serverless Go function in AWS
https://github.com/laaraujo/aws-serverless-go-with-cdk
api-gateway aws cdk golang lambda
Last synced: 2 months ago
JSON representation
Serverless Go function in AWS
- Host: GitHub
- URL: https://github.com/laaraujo/aws-serverless-go-with-cdk
- Owner: laaraujo
- License: mit
- Created: 2024-04-27T18:34:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-30T19:53:37.000Z (about 2 years ago)
- Last Synced: 2024-12-31T14:43:26.440Z (over 1 year ago)
- Topics: api-gateway, aws, cdk, golang, lambda
- Language: TypeScript
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/laaraujo/aws-serverless-go-with-cdk/actions/workflows/deployment.yml)
# 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](#pre-requisites)
* [Local setup](#local-setup)
* [Manual deployment](#manual-deployment)
* [Cleanup](#cleanup)
* [Possible improvements](#possible-improvements-not-covered-in-this-repo)
* [License](#license)
## Pre-requisites
* [Node.js](https://nodejs.org/en) (version 20 or higher)
* [Go](https://go.dev/) (version 1.20 or higher)
* AWS CDK CLI [installed and configured](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html)
## Local setup
Install go package and cdk npm dependencies
```sh
$ make setup
```
To see all available commands go ahead and run
```sh
$ make help
```
```log
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
```sh
$ make cdk-deploy
```

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

## Cleanup
```sh
$ make cdk-cleanup
```

## 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/`](./cdk/) or [`src/`](./src/) contents change
## License
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.