https://pulumi.com logo
Title
f

full-receptionist-30203

06/05/2022, 6:46 PM
๐Ÿ‘‹ Hello, team! Evaluating Pulumi for a largely serverless organization that has had some issues with SAM. In the context of Pulumi, I'm running into issues installing dependencies in python. Is there are pattern to do this with Pulumi? AWS Lambda documentation is recommending essentially vendoring the packages at the root of the codebase. I still find it strange that Lambda doesn't manage dependencies at all. If anyone has recommendations on how to handle this (as long as layers) I'd be very interested!
s

stocky-restaurant-98004

06/06/2022, 5:25 PM
That's correct - you have to vendor deps under
package/
for a Python Lambda. Some ideas: 1. Use something like Make or https://taskfile.dev/ to vendor your deps before running Pulumi. (This is what I did when I did worked with Lambdas in TF.) 2. Try the pulumi-command provider (https://www.pulumi.com/registry/packages/command/) to run your
pip install
command. Layers are "eh" in my (non-expert, would defer to someone who has done a ton of Lambda development work) opinion. If you have stable dependencies in multiple Lambdas they can be good and will save time in your development feedback cycle, but if they change often, they can become a headache. I'd suggest not using layers until you're sure that your deps are stable and used in multiple places, and then consider Layers.
โœ… 1
f

full-receptionist-30203

06/06/2022, 5:29 PM
Thanks Josh thatโ€™s helpful. I did use the command package to do this but coming from a container based world it seems that vendoring is a bit of a step back. Thanks for confirming my assumptions!
๐Ÿ‘ 1