worried-engineer-33884
09/20/2019, 7:04 PMgentle-diamond-70147
09/23/2019, 3:38 PMpreview --diff
) from when you upgrade a dependency and it wants to do the replace?worried-engineer-33884
09/26/2019, 4:52 PM+-pulumi-nodejs:dynamic:Resource: (replace)
[id=arn:aws:sns:us-west-2:279673228106:monitoring:167c2e12-d9c7-495e-a5f6-2a7f4b2a66ab]
[urn=urn:pulumi:dev1::ucboitlake::pulumi-nodejs:dynamic:Resource::monitoring-topic-email-subscription]
email : "<mailto:dustin.farris@colorado.edu|dustin.farris@colorado.edu>"
region : "us-west-2"
topicArn : "arn:aws:sns:us-west-2:279673228106:monitoring"
Resources:
+-1 to replace
50 unchanged
white-balloon-205
ignoreChanges: [“__provider”]
yet? That might work.
That said, I’m surprised this is triggering a replace in the first place unless your provider itself is written in such a way that it is requesting this. Would love a bug report with a repro if you are seeing this replace on latest versions.worried-engineer-33884
09/26/2019, 7:38 PMout
in create that was getting compared to in the diff callback — fixing that, it looks like changes to __provider do trigger an "update" operation but it does not call the create/delete (replace) callbacks. I assume that means __provider "update"s are strictly internal to the stack? Is that correct/expected?white-balloon-205
I assume that means __provider "update"s are strictly internal to the stack? Is that correct/expected?Well - you should still see the provider
Update
method be called which can have an impact if there are actually changes. But yes - it should be possible for __provider
to change and for that to not otherwise impact your dynamic resource.the last push wiped out all of my outs from the stackThat is very surprising - though depends on a lot on your dynamic provider - since dynamic providers have a lot of control over how state is managed. Do make sure that your
Create
and Update
implementations return all the state you want to manage for all the cases your provider can support.worried-engineer-33884
09/26/2019, 10:04 PMupdate
callback — possible that its absence caused an empty outs?white-balloon-205
update
, or you ensure that your diff
will only ever replace. If you have a pattern you are trying to use, and are seeing surprising results that don't feel right - definitely do open an issue and one of the folks who works more deeply in this space can take a look.worried-engineer-33884
09/26/2019, 11:56 PMchanges
defaults to true
from diff, so it sounds like i need to set that to false
, and then set replaces
for things that actually do warrant changetopicArn
as an output in the create
callback. Therefore, any time diff
was called, a "replace" operation was ordered. This only seemed to happen when the __provider changed though. I am inferring from this that pulumi does its own inspection of old inputs in the stack vs. new inputs in the program configuration — and only consults diff
if it sees that something has changed.
Fixing that, it now seems that any time __provider
changes, update
implicitly gets triggered. I did not have an update
callback defined since this AWS resource cannot be updated once created. This had the undesirable side-effect of wiping all of my outputs whenever __provider updated. I added the following callback:
async update(id, { email, topicArn, region }) {
return { outs: { email, topicArn, region } };
},
and all seems to be well now.