I have an infinite update loop and it’s driving me nuts. I started investigating it a few months ago and I can’t remember what I ended up figuring out. But basically I have two different resources that both exhibit this behavior. Both are
aws.lambda_.Function
resources, but one has code passed explicitly to it (and every run produces
[diff: ~code]
even though nothing on my filesystem is changing) and the other has a docker image and its
Invocation
has a
[diff: ~qualifier]
—anyone have any ideas or can point me in a the right direction? 🙏🏽
l
little-cartoon-10569
03/04/2025, 11:47 PM
I recommend against the inline code lambda function sugar. I've never been able to get it to not show a code diff. Lambdas are pretty tough to get exactly right; building a zip file during the deployment also does the wrong thing. I have more success when I remove the zip-building part from the deployment, and moved it to the build/package phase. Then the Pulumi code just fetches a zip from a registry somewhere, and it's only ever changed when the code in the zip actually changes.
There may be a masterclass YouTube on how to build lambdas in the deployment step, but I haven't found it yet.
d
dry-journalist-60579
03/04/2025, 11:49 PM
I feel like this worked at some point but then stopped after an update… I can’t quite remember what happened and the history is lost because it was over 90 days ago
dry-journalist-60579
03/05/2025, 5:41 AM
yeah so I added
ignore_changes=["code"],
to the opts and my diff shows
~ aws:lambda/function:Function: (update)
with nothing else displayed as different… 😞
l
little-cartoon-10569
03/05/2025, 6:02 AM
Highly likely that no update will be pushed. That might be a logic issue: maybe there's a hash being computed from the code, and it's not being ignored (during the preview).
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.