Download the Code of an AWS Lambda Function

avatar
Borislav Hadzhiev

Last updated: Feb 26, 2024
2 min

banner

# 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, click on the Code tab on the function's page 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.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.