> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/lambda/lambda-layers.md). Agents can also search and read this documentation through its [MCP server](https://docs.duplocloud.com/docs/~gitbook/mcp).

# Lambda Layers

Package code libraries for sharing with Lambda Functions

A Lambda Layer is a Zip archive that can contain additional code or other content. A Lambda Layer may contain libraries, a custom runtime, data, or configuration files.

Lambda Layers provide a convenient and effective way to package code libraries for sharing with Lambda functions in your account. Using layers can help reduce the size of uploaded archives and make it faster to deploy your code.

## Enabling Lambda Layer creation

You must add a Key/Value pair in the DuploCloud Portal's **System Config** settings to display Lambda Layers in DuploCloud.

1. In the DuploCloud Portal, navigate to **Administrator** -> **System Settings**.
2. Click the **System Config** tab.
3. Click **Add**. The **Add Config** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FFJqJqxVojFQzBP7QWCbn%2FL5.png?alt=media&amp;token=6069c0cc-64d4-4e51-8f6b-c754095ad580" alt=""><figcaption><p><strong>Add Config</strong> pane</p></figcaption></figure></div>
4. From the **Config Type** list box, select **Other**. The **Other Config Type** field displays.
5. In the **Other Config Type** field, select **AppConfig**.
6. In the **Key** field, enter `ListAllLambdaLayers`.
7. In the **Value** field, enter `true`.
8. Click **Submit**. The **Key**/**Value** pair is displayed in the **System Config** tab.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FhxGc5RyeNb8TgY4ndqFa%2FL4.png?alt=media&amp;token=a8eb652f-f428-40cf-9726-d01f42a6c088" alt=""><figcaption><p><strong>System Settings</strong> with <strong>ListAllLambdaLayers AppConfig Type</strong> set to <strong>Value</strong> of <strong>True</strong></p></figcaption></figure></div>

After you set `ListAllLambdaLayers` to `true`:

* Layer names prefixed with `duplo-` display for all Tenants in the DuploCloud Portal.
* Layer names prefixed with `duploservices-TENANT_NAME` display in the `TENANT_NAME` Tenant.

## Creating Lambda Layers

Follow the [AWS instructions to create layers](https://docs.aws.amazon.com/lambda/latest/dg/creating-deleting-layers.html#layers-create).

## Adding Lambda Layers to a Lambda Function

You can add layers to a new or existing [Lambda Function](https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/lambda.md). For example, to add a layer to an existing function:

1. In the DuploCloud Portal, navigate to C**loud Services** -> **Serverless**.
2. In the **Lambda** tab, select the Lambda Function to which you want to add Lambda Layers.
3. Click the **Actions** menu and select **Edit**. The **Edit Lambda Function** page displays.
4. In the **Layers** area, click the + button. The **Add Lambda Layer** pane displays.\ <br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FYYtP7WfwWzfGGYxY12Xe%2Flam_eph5.png?alt=media&amp;token=26daa40c-eef2-4876-a625-402ee43528c4" alt=""><figcaption><p>Lambda Layers area with add (<strong>+</strong>) and <strong>Delete</strong> options<br><br></p></figcaption></figure></div>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FQGZ7ZWa8LTMrQjUT5Nit%2Flam_eph6.png?alt=media&amp;token=65cb1cab-df60-464f-b4dc-9cf27672fdfc" alt=""><figcaption><p><strong>Add a Lambda Layer</strong> pane<br></p></figcaption></figure></div>
5. From the **Layer** list box, select the Lambda Layer to add.
6. From the **Version** list box, select the layer version.
7. Click **Add Layer**. The layer you added is displayed in the **Layers** area of the **Edit Lambda Function** page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/lambda/lambda-layers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
