Currently when I create a Python Lambda Layer using the following CDK code:
_lambda.LayerVersion( self,"CommonPythonLambdaLayer", code=_lambda.Code.from_asset("src/common", bundling=cdk.BundlingOptions( image=lambda_bundling_image, # type: ignore command=["bash","-c","pip install --no-cache -r requirements.txt --platform manylinux2014_aarch64 --only-binary=:all: --upgrade -t /asset-output/python && cp -au . /asset-output/python", ], platform="linux/arm64", ), ), )
The directory structure of src/common/ is:
src/ common/ models.py
The CDK code for the current Lambda layer creates:
python/ models.py
However, what I need from the Lambda Layer is:
python/ common/ models.py
I do not want to set build_dir in the CDK code to "src/" as it has other packages that needs to be excluded.