An open API service indexing awesome lists of open source software.

https://github.com/adrian-lin-1-0-0/local-go-lambda

Run AWS Lambda locally with Golang and docker image - provided:al2023
https://github.com/adrian-lin-1-0-0/local-go-lambda

al2023 aws-lambda aws-lambda-golang docker docker-image go golang lambda local provided

Last synced: 3 months ago
JSON representation

Run AWS Lambda locally with Golang and docker image - provided:al2023

Awesome Lists containing this project

README

        

# Local go lambda

## Build Docker image

```bash
make build-image
```

or

```bash
docker build --platform linux/amd64 -t local-go-lambda:latest .
```

## Run Docker image

```bash
make run-image
```

or

```bash
docker run -p 8080:8080 \
--entrypoint /usr/local/bin/aws-lambda-rie \
local-go-lambda:latest ./main
```

## Test

```bash
curl "http://localhost:8080/2015-03-31/functions/function/invocations" -d '{}'
```
## Ref
- [AWS Lambda Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/)
- [Event Models](https://github.com/aws/aws-lambda-go/tree/main/events)
- [Using AWS Lambda with other services](https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html)