Hello, I just discovered Pulumi. I am trying to fi...
# general
h
Hello, I just discovered Pulumi. I am trying to figure out how to use it instead of serverless framework. However I am not too keen on the blending of the infrastructure and application code. Is there a way to have pulumi handle bundling and the setting up of the function but the application code live inside a separate file. \
w
h
Very cool, since serverless handles the bundling of the application prior to deploying it, is there a process or tool to have pulumi do the same?
Something like pulumi.builder.Rollup that could bundle the application to an archive that pulumi can use? With some sort of knowledge on whether it needs to be re-bundled in the first place.
w
The code there more or less does that already - the
AssetArchive
you see there builds an archive from code in the filesystem, and this will be incremental (if there are no diffs on the filesystem, there will not be a diff on this resource and the Lambda will not need to be redeployed). There is somewhat less "middleware" in this process - for example, we don't have a built-in mechanism to kick off a build prior to packaging, etc. That's something that would be really nice to add as a library on top of this.
h
Do you have a plugin system or hooks into any middleware process now if I develop something that can package the app prior to deployment? I use serverless for everything now, but the giant YAML files with a mix of cloudformation is so frustrating. Pulumi seems to be in the perfect spot to solve this if I can solve for the packaging problem.
Pulumi shouldn't be burdened with all the complex bundling workflows, so I imagine it would be a way to spawn a process as part of packaging but can tap into pulumi state. The separate process could do anything as long as it returned an error or a zip file.