Skip to content

Latest commit

 

History

History
71 lines (44 loc) · 2.27 KB

README.md

File metadata and controls

71 lines (44 loc) · 2.27 KB

Lambda Local

Project Status

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://hub.docker.com/r/raphaelbh/lambda

Available actions:

  • invoke ${event}
  • update-code ${lambda-name}

update-code: update lambda code created in the localstack

Requirements

docker

Installation

$ 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
# 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"
# call invoke action
$ lambda invoke '{"key":"value"}'
or
$ lambda invoke $(cat sample/events/event.json | tr -d " \t\n\r")
# call update-code action
$ lambda update-code 'LambdaFunctionName'

Tech Stack

docker shellscript

Reference

Feedback

If you have any feedback, please contact me at raphaeldias.ti@gmail.com

github linkedin