I have an infinite update loop and it’s driving me...
# general
d
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
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
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
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
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).