Description
Description
As of today the Quickstart documentation mentions under the "Setup the serverless image resizer"
section that the developer should execute the bash script located at: deployment/build-lambdas.sh
.
Apparently there are two issues with the script:
- It produces zipped files with sub folders, the zip file inner structure looks like:
lambdas/${lambda_name}/handler.py
, which breaks the commands defined indeployment/awslocal/deploy.sh
and in theterraform/main.tf
files. Both of them expect thehandler.py
file to be at the root of the zipped file. - It does not build the dependencies needed by the
resize
lambda. They are defined inlambdas/resize/requirements.txt
and need to be built before zipping the resize lambda. Which prevents the resize lambda from working properly.
Possible solution
Fortunately this repo has another build-lambdas.sh
script, this one located at: bin/build-lambdas.sh
(used to be part of the deploy.sh
in earlier versions). This script works as intended as it:
- Navigates to each lambda folder for compressing the files, avoiding the wrong inner structure mentioned in my first listed issue;
- Builds the required dependencies for the resize lambda.
It's worth noting that this script is also used by the Makefile
(the build-lambdas
function) and in the CI pipelines of this repo.
I can gladly make a PR moving things around but considering that the "correct" version of the build-lambdas.sh
is already inside the bin
folder (which makes sense) and is also used in multiple places inside this repo, it probably makes more sense to adapt the Quickstart
documentation to point to the correct build-lambdas.sh
and delete the other one.