Why does pulumi try to recreate the DB cluster if ...
# general
c
Why does pulumi try to recreate the DB cluster if you add
availabilityType: 'REGIONAL'
? Should it not simply make it an HA cluster?
c
cc @white-balloon-205@cool-egg-852 I believe we accurately report whether the underlying cloud provider allows us to do an in-place update of any particular property.
c
I can change it in the console without it being recreated
Are you saying their API doesn’t allow for what you can do in the console? If so, that’s quite stupid of them.
c
@cool-egg-852 I’m not an expert—just, generally, my understanding is that a property is not marked for replacement unless we have to replace the resource. perhaps @stocky-spoon-28903 @broad-dog-22463 have more information?
w
Which resource is this specifically? There are frequently either cloud provider issues or upstream provider issues that lead to overly conservative treatments of replacement requirements - but would have to look into a specific resource to be sure.
c
This is a gcp.sql.DatabaseInstance
Specifically postgres, as that is the only DB that
availabilityType
applies to.
b
Can you show me what you ate chanomf?
Changing*
(Sorry autocorrect!)
c
All I did was add
availabilityType: config.environment == 'production' ? 'REGIONAL' : 'ZONAL'
to an existing
DatabaseInstance
And of course the value was production, so
REGIONAL
was set. This caused pulumi to think it needs to be recreated
It’s not trying to replace the DatabaseInstance, at least not anymore. Instead, it’s trying to replace the user and the database
This doesn’t make any sense. The instance isn’t being recreated, but at minimum the previous is saying it will do a create-replacement on the user and Database.
I’m testing this out. I’m beginning to think this is based upon the limitation of the preview. The preview seems to assume changes are required that are not actually required when executing.
This same thing scared me a few minutes ago when updating a configMap. It caused the deployment to show it was going to be replaced. It was only updated in the end.
Yep, that’s exactly what happened.
Is there no way to fix this? The preview should not be this off from reality.
I’m curious why this has gotten worse rather than better. I never experienced this previously where the diff was so off.