https://pulumi.com logo
#general
Title
# general
c

cool-egg-852

08/22/2019, 10:18 PM
Why does pulumi try to recreate the DB cluster if you add
availabilityType: 'REGIONAL'
? Should it not simply make it an HA cluster?
c

creamy-potato-29402

08/23/2019, 12:38 AM
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

cool-egg-852

08/23/2019, 1:30 AM
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

creamy-potato-29402

08/23/2019, 5:07 PM
@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

white-balloon-205

08/23/2019, 5:36 PM
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

cool-egg-852

08/23/2019, 5:39 PM
This is a gcp.sql.DatabaseInstance
Specifically postgres, as that is the only DB that
availabilityType
applies to.
b

broad-dog-22463

08/23/2019, 6:22 PM
Can you show me what you ate chanomf?
Changing*
(Sorry autocorrect!)
c

cool-egg-852

08/23/2019, 7:14 PM
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.