DEV Community

Discussion on: How to provision Lambda and Lambda Layer using CDK

Collapse
aldwyn profile image
Aldwyn Cabarrubias

Hi Ken. Great post! Just wondering though: would it be much more efficient to pair the lambda_python.PythonLayerVersion with lambda_.Function instead of lambda_python.PythonFunction? Because the PythonFunction creates a docker image with the Python libraries in it already and it's not basically using the layer. But with the Function and PythonLayerVersion combo, which makes more sense for no-redundancy bundling, it doesn't seem to work.

Collapse
aldwyn profile image
Aldwyn Cabarrubias

Welp it worked eventually :D

Collapse
upupkenchoong profile image
Ken Choong Author

Great. Glad you like it

Collapse
upupkenchoong profile image
Ken Choong Author • Edited

I used lambda_.Function before, for some reason, lambda_.Function you will see some very weird problem when import the library from Lambda Layer into the Lambda function. Since then I just use PythonFunction, which let me don't even need to think about the bundling stuff.