I had some trouble creating a layer using the script at this repo.
According to AWS documentation, contents of package.zip will be extracted to /opt. So the correct environment variables, GDAL_DATA, and my inclusion, PROJ_LIB, should point to /opt/gdal and /opt/proj. I have included the PROJ_LIB variable to avoid the proj.db not found error.
Besides, for the python packages, instead of zipping them to the root address of the zip file, we should zip them to a python directory at root level.
In the end, it should look like this:
package.zip
├── bin # executables
├── lib # libraries
├── lib64 # libraries 64-bit
├── python # python packages
└── share # shared libraries
And last, installing rasterio with --no-binary raises the error of rasterio._shim module not existing. Installing with pip install rasterio fixes it. Also, I do not think is necessairy to install rasterio[s3] because boto3 is already included in python Lambdas by default.
After doing all the changes I have mentioned above, I've successfully created a layer that I am currently using.