You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lambda Layers allow for updating of libraries/mobdules for Lambda quickly, without the efforts of creating a custom Lambda runtime. These bash scripts help automate the download of libraries/modules and optionally, upload the layer and associate with a Lambda function.
4
+
5
+
This is particularily helpful when adding [AWS X-Ray SDK](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html), latest versions of the AWS SDK or older/newer versions of other libraries/modules needed when troubleshooting or deploying functions for A/B type testing.
6
+
7
+
For more information on managing [Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
8
+
9
+
## Requirements
10
+
If you wish the script to upload the Lambda layer and deploy the layer to a Lambda function you will need [jq](https://stedolan.github.io/jq/) and zip.
11
+
12
+
[AWSCLI](https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html) will need to be installed and configured if you wish to upload layers and/or associate layers with Lambda functions.
13
+
14
+
Each runtime will need to have the relevant package manager installed. Details are in the relevant README.md of each runtime.
15
+
16
+
## Permissions
17
+
18
+
The following User/Role IAM permissions are required in your AWS Account to upload the layer and associate the layer with a Lambda function:
19
+
* Layer Development and Use [https://docs.aws.amazon.com/lambda/latest/dg/access-control-identity-based.html#permissions-user-layer]
20
+
* This script does NOT assign resource policy's to the Lambda, you may need to consider adding permissions in certain scenarios. [https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-permissions]
21
+
22
+
## Usage
23
+
24
+
Each runtime has variences in how it is used - please check the README:
25
+
[python/README.md]()
26
+
[nodejs/README.md]()
27
+
28
+
This script will use the credentials and region configured with the AWS CLI if available. If not, AWSCLI it will ask for an AWS access key and secret key.
29
+
30
+
### NOTE: Please test these sample scripts thoroughly to see if they suit your use case.
This bash script will help with downloading modules and libraries to a local folder, zip and optionally upload the layer as a new version and associate with a Lambda Function if desired.
- requirements.txt is the list of python packages you wish to add to the layer.
12
+
- node-version is the version of runtime the modules are downloaded for, eg 10.16.3
13
+
*https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html for the runtime currently supported.
14
+
- lambda-version-name (optional) if you want to upload the zip as a new version of an existing layer or as a new layer if no layer yet exists.
15
+
- function-name (optional) if you want to add the layer to the $lastest of a lambda function. This updates the Lambda immediately!
16
+
17
+
This script will use the credentials and region configured with the AWS CLI if available. If not, AWSCLI it will ask for an AWS access key and secret key.
18
+
19
+
## Requirements
20
+
* If you wish the script to upload the Lambda layer and deploy the layer to a Lambda function you will need [jq](https://stedolan.github.io/jq/) and zip.
*[AWSCLI](https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html) will need to be installed and configured if you wish to upload layers and/or associate layers with Lambda functions.
26
+
27
+
## Permissions
28
+
The following User/Role IAM permissions are required in your AWS Account to upload the layer and associate the layer with a Lambda function:
29
+
* Layer Development and Use [https://docs.aws.amazon.com/lambda/latest/dg/access-control-identity-based.html#permissions-user-layer]
30
+
* This script does NOT assign resource policy's to the Lambda layer, you may need to consider adding permissions in certain scenarios. [https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-permissions]
31
+
32
+
### NOTE: Please test these sample scripts thoroughly to see if they suit your use case.
This bash script will help with downloading modules and libraries using a python virtual environment, zip and optionally upload the layer as a new version and associate with a Lambda Function if desired.
- requirements.txt is the list of python packages you wish to add to the layer.
12
+
- lambda-version-name (optional) if you want to upload the zip as a new version of an existing layer or as a new layer if no layer yet exists.
13
+
- function-name (optional) if you want to add the layer to the $lastest of a lambda function. This updates the Lambda immediately!
14
+
15
+
This script will use the credentials and region configured with the AWS CLI if available. If not, AWSCLI it will ask for an AWS access key and secret key.
16
+
17
+
## Requirements
18
+
* If you wish the script to upload the Lambda layer and deploy the layer to a Lambda function you will need [jq](https://stedolan.github.io/jq/) and zip.
19
+
* python 2.7 will need [virtualenv](https://pip.pypa.io/en/stable/installing/)
20
+
* python 3.x will need [venv](https://docs.python.org/3/library/venv.html)
21
+
*[pip](https://virtualenv.pypa.io/en/latest/)
22
+
*[AWSCLI](https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html) will need to be installed and configured if you wish to upload layers and/or associate layers with Lambda functions.
23
+
24
+
## Permissions
25
+
The following User/Role IAM permissions are required in your AWS Account to upload the layer and associate the layer with a Lambda function:
26
+
* Layer Development and Use [https://docs.aws.amazon.com/lambda/latest/dg/access-control-identity-based.html#permissions-user-layer]
27
+
* This script does NOT assign resource policy's to the Lambda layer, you may need to consider adding permissions in certain scenarios. [https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-permissions]
28
+
29
+
### NOTE: Please test these sample scripts thoroughly to see if they suit your use case.
0 commit comments