Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17331

AWS CDK Lambda Layer Python Package

$
0
0

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.


Viewing all articles
Browse latest Browse all 17331

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>