# Deploy a lambda function

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

# Prerequisites

Before starting the tutorial, please do the following:

# What 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 (opens new window).

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.

Done!

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