https://github.com/raphaelbh/lambda-local
Docker image for invoke lambda locally.
https://github.com/raphaelbh/lambda-local
development docker docker-image lambda lambda-function lambda-local local
Last synced: 5 months ago
JSON representation
Docker image for invoke lambda locally.
- Host: GitHub
- URL: https://github.com/raphaelbh/lambda-local
- Owner: raphaelbh
- Created: 2022-03-11T20:45:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T01:03:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-25T20:11:30.196Z (11 months ago)
- Topics: development, docker, docker-image, lambda, lambda-function, lambda-local, local
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lambda Local
[](#)
Docker image for invoke lambda locally.
> AWS Lambda is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers. You can trigger Lambda from over 200 AWS services and software as a service (SaaS) applications, and only pay for what you use. [Documentation](https://aws.amazon.com/lambda)
https://hub.docker.com/r/raphaelbh/lambda
Available actions:
- invoke ${event}
- update-code ${lambda-name}
`update-code`: update lambda code created in the [localstack](https://localstack.cloud/)
## Requirements
[](https://www.docker.com/)
## Installation
```bash
$ docker build -t raphaelbh/lambda:latest .
```
## Usage
A folder with the lambda function must be informed through a volume:
`{your_folder}:/lambda`
Important:
- `/var/run/docker.sock` should be shared as volume
- Local network should be shared `--net=host`
```bash
# create alias for container run
alias lambda="docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/sample/lambda:/lambda --net=host raphaelbh/lambda"
```
```bash
# call invoke action
$ lambda invoke '{"key":"value"}'
or
$ lambda invoke $(cat sample/events/event.json | tr -d " \t\n\r")
```
```bash
# call update-code action
$ lambda update-code 'LambdaFunctionName'
```
## Tech Stack
[](https://www.docker.com/)
[](https://www.shellscript.sh/)
## Reference
- https://docs.aws.amazon.com/lambda/latest/dg/images-create.html
## Feedback
If you have any feedback, please contact me at raphaeldias.ti@gmail.com
[](https://github.com/raphaelbh)
[](https://www.linkedin.com/in/raphaelbh/)