Skip to content

This is the base container that has all the necessary resources and documentation required to setup a container that can run as a Lambda on AWS's emulator (RIE).

License

Notifications You must be signed in to change notification settings

abasu0713/local-AWSLambda-enabler

Repository files navigation

Local AWS Serverless jumpstart

This reporsitory is a template with all necessary documentation and resources to enable a team to jumpstart their Serverless journey in AWS. It is packed with AWS's Lambda emulator (RIE) and is ready for local testing of Lambda in a version controlled manner that can be shared accross teams.

PS: AWS has a Serveless Application Model (SAM) CLI toolkit that can be used to perform a lot of the things as done in this repository.. But, SAM has a steep learning curve and dependency with docker versions.. This repository on the other hand, even though requires docker to operate doesn't have any hard contsraints as it doens't interact with AWS CLI tools. Additionally it doesn't have a complex set of commands for testing local lambda environments as in a widely used Open Source tool called docker-lambda

Overview

The architectural overview can be found at the following link

The overall objective can be broken into the following:

  1. Make it simple for multiple developers to collaborate building AWS Serverless solutions using version control tools like Github.
  2. Allowing developers to user their own IDE of choice and not have to worry about logging into AWS Management Console to interact with Lambda.
  3. Providing the ability to developers to test code locally before they build, package and publish them in AWS Lambda.
  4. Provide ECS integration so that it's seamless to test containers locally.
  5. Provide logging functionality that will seamlessly port over to cloudwatch logging for lambda without any additional configuration.

This repository is currently a template for running only Python scripts locally following the Serverless Access Model. If you want to request the template repository support other languages, please drop a note to me.

Pre-requisites

You need the following:

  1. Install AWS CLI and configure it with an IAM role that allows enough permission to test your app functionality. Follow documentation to configure AWS CLI on your local machine.
  2. Install Docker.

Testing Lambda locally

Once the pre-requisites are complete, simply do the following:

  1. Run git clone <this-repository> in your local machine. And then cd <this-repository> into it.
  2. Run docker-compose up. And voila..

At this point you have access to Lambda Runtime locally. You can then send events to the Lambda to trigger your app code. For more info on Sample Triggers look at the document called execution.doc in this repository. That has CURL commands that allow you to make API Calls to Lambda runtime locally.

About

This is the base container that has all the necessary resources and documentation required to setup a container that can run as a Lambda on AWS's emulator (RIE).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published