How to deploy Lambda to AWS with Digger

How to deploy Lambda to AWS with Digger
Photo by Mehmet Ali Peker / Unsplash

This tutorial shows you how to deploy an AWS Lambda function with Digger.


Before starting the tutorial, please do the following:

  1. Create a Digger account.
  2. Create an AWS account.
  3. Create a GitHub account.
  4. Create an AWS user with administrator permissions.

What exactly infrastructure we are trying to create?

Let's try to deploy a simple AWS lambda function with AWS API Gateway in front of it. We should be able to call lambda function using http request. Source code for the lambda is here.

Let's log into Digger account and connect it to GitHub first.

Let's connect to github and choose a repo with lambda function we are going to deploy.
Digger will try to identify what kind of application in the repo.
Let's choose Lambda function.
Give a name to the project and choose node.js as runtime.
Put AWS key and secret.
Review all configuration parameters and click "Deploy" button.

At this stage Digger will generate terraform code for the project and try to create infrastructure in AWS.

We can check the state of deployment and terraform output if needed.
Infrastructure and software deployment have finished!
Let's add a route so we can call lambda via http requests.
Click "Update" button.
API Gateway is going to be created and configured.
We can check the status of deployments.
And we can see the url of API Gateway in logs.
Let's send a http request.


We've created a lambda function with API Gateway in front of it, just in a few clicks. Now we can easily create a new test "environments" if needed.