https://pulumi.com logo
#automation-api
Title
# automation-api
k

kind-hamburger-15227

08/03/2022, 11:25 AM
Cross post from general, as this channel seems to be more appropriate: 👋 Hi everyone! Does anyone managed to run Pulumi automation as function under AWS Lambda? I think this sample https://github.com/pulumi/automation-api-examples/tree/main/python/pulumi_over_http can be easily packaged, except it have Pulumi cli in requirements, which I am not sure how to package into lambda image. (I mean easily). If anyone tried and succeed or failed would be good to discuss.
l

little-cartoon-10569

08/03/2022, 8:16 PM
Given that you'd need the Pulumi binaries, the plugin binaries, and all the libraries, I'd guess that the end result would be too big for a lambda. This might be better suited to containers.
k

kind-hamburger-15227

08/03/2022, 8:20 PM
At some point I managed to squeeze pytorch library into lambda, I doubt size would be an issue - I think it would additional hassle to package it, unless there is a Pulumi supported.
you are right limit still 250 MB for custom runtime. I am still hopeful pulumi is not on par with numpy/pandas/pytorch (1 GB library)
To rephrase the question: are any known obstacles which will prevent packaging Pulumi into container as any other Python program?
l

little-cartoon-10569

08/03/2022, 8:23 PM
You would also need a user and a home directory. Do lambdas support that? Honestly, even if this were possible, it's unlikely to be worth it. When the automation-api is changed to not rely on the CLI it might be worth trying, but until then, stick with containers.
BTW Pulumi isn't a python program. Pulumi programs can be python programs, but Pulumi is a golang program.
k

kind-hamburger-15227

08/04/2022, 3:38 PM
Thank you, I will make is easy for myself by sticking to small dedicated server for automation or containers.
f

famous-magician-5742

08/05/2022, 4:34 PM
We created a custom AWS container to run our lambda in and install the Pulumi CLI in that container: https://docs.aws.amazon.com/lambda/latest/dg/images-create.html
k

kind-hamburger-15227

08/05/2022, 4:35 PM
@famous-magician-5742 so there are no challenges and there is at least one success story. Thank you.