Download the Code of an AWS Lambda Function


Borislav Hadzhiev

Sun Sep 26 20212 min read

How to Download the Code of an AWS Lambda Function #

To download the code for a Lambda function:

  1. Open the AWS Lambda console and click on your function's name
  2. Click on the Actions button and click Export function

export function

  1. Select Download deployment package on the popup screen

download deployment package

  1. Extract the .zip file and you will find the code for the lambda function
If you're on Windows the file might not have the .zip extension, in fact it might not have any extension. If it doesn't you have to add it yourself.

When you're downloading the source code for a lambda function, check whether the function has layers.

To see if a lambda function has layers, select the Code tab of the function and scroll down until you see the Layers section.

function layers

If your function has layers, you have to download the layer code as well.

In the screenshot above the function has a layer named yupFCE70298 with the Layer version 18.

In this case we have to open the layers page from the sidebar and filter for the layer by its name:

find layer

Click on the layer's name and scroll down to the All versions section. Click on the version number that corresponds to your function's layer version.

Finally, click on the Download button.

download layer

Extract the zip file and add the lambda layer to your layers directory.

Further Reading #

Use the search field on my Home Page to filter through my more than 1,000 articles.