/cdk-go-simple-restapi

Golang CDK For Deploying Lambda Function

Primary LanguageGo

Simple Go REST API

Deploy GO function to Lambda using CDK.

Installation

git clone https://github.com/danielcristho/cdk-simple-go-restapi.git
make install

Or

make setup

Build

make build

After the deployment is successful, testing the API:

curl https://<api_gateway_url>/prod/hello-world

Response:

{"Greeting":"Hello From API!"}

CDK

The cdk.json file tells the CDK toolkit how to execute your app.

Useful commands

  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template
  • cdk destroy destroy the stack
  • go test run unit tests