https://pulumi.com logo
Title
b

brief-alligator-51254

10/18/2022, 10:17 AM
How can I "_hot reload_" my lambda functions using Pulumi? I have been using
aws.lambda.Function
to deploy to my localstack setup and I was hoping I could have a fast way to iterate over local changes, but I couldn't find a way to do so. I noticed that
aws.lambda.Function
zips the code (
pulumi.asset.AssetArchive
), which means that enabling hot swapping in localstack won't make any difference unless we have a way to make Pulumi repack the content of the lambda on demand. • I have tried using pulumi watch, but with no success. It seems that only the pulumi code is being watched, not the code of the lambda functions. • I have also tried running
pulumi up
every time a change was made on the lambda code, but that has extreme bad performance and possibly other side effects. What should I be looking at? Are there workarounds I could be trying?
Looks like nobody is aware of a way to achieve that, so I created a discussion under "Ideas" suggesting that it gets implemented
I have also posted this as a question in StackOverlow. So far, no reactions on any of the channels. https://stackoverflow.com/questions/74121832/how-can-i-hot-reload-my-code-using-pulumi
b

brave-planet-10645

10/19/2022, 9:30 AM
What are the performance issues you’re seeing when you run Pulumi up? What are you using as a back end for the state?
c

colossal-diamond-64391

10/21/2022, 9:45 PM
@brief-alligator-51254 I gave me two cents for a solution in the discussion thread: https://github.com/pulumi/pulumi/discussions/11065#discussioncomment-3937307
b

brief-alligator-51254

10/23/2022, 3:04 PM
What are the performance issues you’re seeing when you run Pulumi up?
I would say that
pulumi up
is just not designed to perform such action. The
Previewing update
phase takes 39s and the actual
Updating
phase takes 47s. The performance is comparable to running
pulumi up
in a clean state, so no hot reload by definition.
What are you using as a back end for the state?
Local Filesystem
I gave me two cents for a solution in the discussion thread
Thanks @colossal-diamond-64391!
b

brave-planet-10645

10/23/2022, 4:16 PM
So couple of things would help us here: 1. Can you run
pulumi up --logtostderr --logflow -v=9 2> logs.txt
2. Can you run (you might want to destroy the stack before you run it):
pulumi up --tracing=file:./up.trace
And then send over the
logs.txt
and the
up.trace
file that you produced to me: piers@pulumi.com Just as an aside, Pulumi does write a lot of checkpoints and if you’re using the local file system as your backend, especially on your local computer, you might find it’s not as performant as using the Pulumi service.