From 5764aaae921812381c874a7d915aad0df00e6b9f Mon Sep 17 00:00:00 2001 From: Rishi Date: Wed, 26 Oct 2022 13:32:29 -0400 Subject: [PATCH] Updated readme file for instructions on how to package properly for a layer --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30ab1fb..fc8f166 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,13 @@ libpq library instead of the default dynamic link. #### Python2.* Just copy the psycopg2 directory into your AWS Lambda zip package. -#### Python 3.6 -Just copy the psycopg2-3.6 directory into your AWS Lambda project and rename it to psycopg2 before creating your AWS Lambda zip package. +#### Python 3.9 +When creating a lambda layer for deployment or packaging to be used as an import, follow these steps: +1. Create the following directory tree, if building for python3.6, otherwise replace ‘python3.9’ with the version choice: +2. `mkdir -p python/lib/python3.9/site-packages/psycopg2` +3. Choose the python version of interest and copy the files from the folders downloaded in step 1. to the directory tree in step 2. e.g. if building a layer for python 3.9: `cp psycopg2-3.9/* python/lib/python3.9/site-packages/psycopg2` +4. Create the zip file for the layer. e.g.: zip -r9 psycopg2-py39.zip python +5. Create a layer in the console or cli and upload the zip ### Instructions on compiling this package from scratch