bland-dog-47600
05/16/2023, 3:41 PMname
.
For example, gcp.Address
++gcp:compute/address:Address: (create-replacement)
[id=projects/sandbox-pulumi/regions/us-central1/addresses/retool-b629537]
[urn=urn:pulumi:sandbox::infra::gcp:compute/address:Address::retool]
~ name: "retool-b629537" => "retool-5775aba"
+-gcp:compute/address:Address: (replace)
[id=projects/sandbox-pulumi/regions/us-central1/addresses/retool-b629537]
[urn=urn:pulumi:sandbox::infra::gcp:compute/address:Address::retool]
~ name: "retool-b629537" => "retool-5775aba"
Even though this Address
has no dependencies. pulumi refresh --yes
didn’t help.
The only workaround I found is leaving pulumi.IgnoreChanges([]string{"name"})
everywhere like here
ip, err := compute.NewAddress(ctx, "retool", nil,
pulumi.DependsOn([]pulumi.Resource{enabledServices.Compute}),
pulumi.IgnoreChanges([]string{"name"}))
name
is different in outputs
and inputs
in the json state file. If I make them congruent, Pulumi doesn’t want to replace this resource anymore. I am not sure what broke these name
in the state. Could have been updates to Pulumi and GCP provider. 🤷♀️🏻little-cartoon-10569
05/16/2023, 8:56 PMname
is the reason that the replacement was suggested. To answer your original question: if an attribute changes in your preview, and if that attribute has the recycle icon in the registry docs, then a replace is required.
For example, in this case, the docs are here: https://www.pulumi.com/registry/packages/gcp/api-docs/compute/address/#properties
And name
has the recycle icon:bland-dog-47600
05/16/2023, 10:54 PMname
didn’t change in GCP. For some reasons they regenerated in inputs
of the state.little-cartoon-10569
05/16/2023, 10:56 PMpulumi refresh
eventually fixes it, but the effort involved is significant. I generally associate this with changing providers, but I have no proof.