/golang-lambda-apigw-terraform-poc

Deploying Golang lambda and API Gateway in Localstack with Terraform

Primary LanguageGo

golang-lambda-apigw-terraform-poc

Running and testing AWS Lambda (Golang), API Gateway and DynamoDB in local environment using Terraform and LocalStack

Requirements

  1. Golang
  2. Docker Desktop
  3. Terraform
  4. Localstack
  5. AWS CLI
  6. Just

Getting Started

Clone the repo:

git clone https://github.com/AntonioMartinezFernandez/golang-lambda-apigw-terraform-poc && cd golang-lambda-apigw-terraform-poc

Start Serverless Mode (it will provide an output with the lambda URL):

# You need to have Docker started and then execute the next command
just start-serverless

Run unit tests:

just test-unit

Run integration tests:

# You need to start serverless mode first in order to have deployed all the necessary components and then execute the next command
just test-integration

Start Independent Service Mode:

# You need to start serverless mode first in order to have deployed all the necessary components and then execute the next command
just start-local

ℹ️ The OpenAPI definition for this project is available here and is also available in the api\swagger.yaml file of this repository.

Resources