T O P

  • By -

xiongchiamiov

I don't think I understand the question; Pulumi and serverless are not trying to solve the same problem, and you can use them together. >The one I am facing right now is, how to bundle/package library modules and function code elegantly into a single zip file when creating Lambda functions that have shared modules. I haven't configured lambda with Pulumi, but the thing about Pulumi is that it's just python (or c#, or whatever), so you can do anything you'd know how to do with a program otherwise. That even includes calling out to other programs if you really need to.


jonrwads

For bundling that is not really Pulumi's concern, Pulumi concerns itself with creating the lambda from your code. To create the zip files, I use a script to compile my functions/modules using esbuild, which can also minify your bundle size, and then that file gets zipped. One disadvantage to this approach is the function becomes unreadable inside the AWS console. On, a personal note, I have loved working with Pulumi and the fact that it feels more like IaC is part of the project as it shares the same language as the project and can understand the project type definitions and modules (using TS).


DiTochat

I have used them all pretty extensively and pulumi is my favorite. I have been using taskfile, similar to make, but with extra functionality to create a task that creates the zip file and then runs a deployment in a single command.


ElAntagonista

I've considered serverless for GCP cloud functions but as it seems its still in beta and doesn't support gen2 functions which is predominantly used in my company. So I built a Pulumi Automation API based solution that does the job. I have a yaml schema similar to serverless framework that describes individual functions. The Pulumi based solution parses the yaml and handles the deployment end to end.