Open nagyben opened 3 years ago
Hi @nagyben thank you for reporting this.
I believe delete_before_replace
has no effect in this case because there's no "replace" operation. The provider tries to run an update-in-place and fails.
We use an annotation that Azure API is supposed to provide on properties that require replacement but those annotations are lacking in many spots, including this one, probably. We'll use this issue to track adding a manual annotation.
Are there any updates on this? I'm still seeing this behaviour in pulumi-azure-native 1.102.0
. Is there any ResourceOption
I can provide to force replacement?
I'm currently using ResourceOptions(delete_before_replace=True, replace_on_changes=["containers"])
as a workaround.
Is there any ResourceOption I can provide to force replacement?
Yes, replace_on_changes
should do that, as you mention. Does it not work for you?
I think that both delete_before_replace
and replace_on_changes
are needed to stop Pulumi trying an in-place update. It sounds like that's the best option until the upstream code adds the appropriate annotation.
Trying to modify an existing
containerinstance.ContainerGroup
resource (which was deployed using pulumi originally) and usingdelete_before_replace=True
is returning an errorSteps to reproduce
pulumi up
Expected: No errors to be thrown
Actual:
Workaround:
Manually delete container group before running
pulumi up
worksBut this is not ideal when we are using CI/CD for deployment