aws-samples / cdk-lambda-powertools-python-layer

CDK Construct library to create Lambda layer with Powertools for Python library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: directory structure inside layer zip is wrong

am29d opened this issue · comments

We currently use Code.fromDockerBuild to build the layer during synth step and package the code. As a result everything that is inside /asset folder during docker build step will be zipped. This mean the zip step inside the Dockerfile is unnecessary, because it will be zipped again by fromDockerBuild method:

RUN zip -qr /asset/layer.zip /python --exclude \*/tests/\* \*/doc/\* \*/__pycache__/\* \*.pyc

As a fix we can simply run pip install with a target /assets/python and the python directory will be zipped.