Skip to content

Commit a535490

Browse files
Update README.md
1 parent 773bda3 commit a535490

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Build AWS Lambda Layer zip file for Python Dependancies
22

3-
Creates an AWS Lambda Layers **optimized** zip file using the [Lambda Layer directory structure](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path), ensures compiled libraries are compatible with Lambda environment, and optimized to reduce file size.
3+
Creates an AWS Lambda Layers zip file that is **optimized** for: [Lambda Layer directory structure](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path), compiled library compatibility, and minimal file size.
44

55
This function was created to address these issues:
66

7-
- Many methods of creating Lambda zip files for Python functions don't work for Lambda Layers because Lambda Layers require specific library paths within the zip
8-
- Some dependancies required compiled components, which requires that the zip is created in an environment that matches the Lambda runtime environment
9-
- Minimize the zip size by removing unnecessary items
7+
- Many methods of creating Lambda zip files for Python functions don't work for Lambda Layers
8+
- This is due to the fact Lambda Layers require specific library paths within the zip, where regular Lambda zips dont
9+
- Compiled dependancies must be created in an environment that matches the Lambda runtime
10+
- Reduce size of zip file by removing unnecessary libraries and files
1011

1112
**Note: This script requires Docker and uses a container to mimic the Lambda environment.**
1213

@@ -35,9 +36,7 @@ git clone --depth 1 https://github.com/robertpeteuil/build-lambda-layer-python _
3536
Alternatively, add as a submodule:
3637

3738
``` bash
38-
# PUBLIC USE HTTPS
3939
cd {repo root}
40-
# eventual public repo will use http
4140
git submodule add https://github.com/robertpeteuil/build-lambda-layer-python _build_layer
4241
# Update submodule
4342
git submodule update --init --recursive --remote
@@ -46,16 +45,17 @@ git submodule update --init --recursive --remote
4645
## Use
4746

4847
- Run the builder with the command `./build_layer.sh`
49-
- Optionally specify Python Version
50-
- `-p PYTHON_VER` - specifies the Python version: 2.7, 3.6, 3.7 (default 3.6)
48+
- or `_build_layer/build_layer.sh` if installed in sub-dir
5149
- It uses the first requirements.txt file found in these locations (in order):
5250
- same directory as script
5351
- parent directory of script (useful when used as submodule)
5452
- function sub-directory of the parent directory (useful when used as submodule)
53+
- Optionally specify Python Version
54+
- `-p PYTHON_VER` - specifies the Python version: 2.7, 3.6, 3.7 (default 3.6)
5555

5656
## Reference - remove submodule
5757

58-
If installed as submodule and want to remove
58+
If installed as submodule and need to remove
5959

6060
``` bash
6161
# Remove the submodule entry from .git/config

0 commit comments

Comments
 (0)