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

strong-match-67698

02/21/2023, 4:47 PM
Hi, what is the recommended approach for updating resources that... well, can't be updated 😄 . Let's say we have a role assignment in Azure, that doesn't allow changing some properties, but it can be replaced with a new instance of the same, but different properties. When pulumi tries to update it, it fails as provider doesn't allow update operation. Is there any way to force pulumi to remove the old object and create a new one instead? I can also imagine an ugly way where we delete the resource manually, and let pulumi recreate updated version, but form my experience Pulumi doesn't like changes, which aren't reflected in stack state. Any hints?
b

billowy-army-68599

02/21/2023, 4:48 PM
this is likely a bug, can you show me what errors your see?
s

strong-match-67698

02/21/2023, 4:49 PM
image.png
b

billowy-army-68599

02/21/2023, 4:50 PM
could you file an issue in the azure-native repo with code repro
s

strong-match-67698

02/21/2023, 4:50 PM
b

billowy-army-68599

02/21/2023, 4:52 PM
in the meantime, you can work around this using this https://www.pulumi.com/docs/intro/concepts/resources/options/replaceonchanges/
s
@billowy-army-68599 replaceOnChange seems to help pulumi do the right thing, but still fails to complete the replacement 😛
Diagnostics: azure-nativedocumentdb/v20220815SqlResourceSqlRoleAssignment (management-cosmos-rw-rbac-assignment): error: cannot create already existing resource '/subscriptions/ad7f52f6-6c6a-4e2a-bb4e-a4b61353d213/resourceGroups/mk-beacon-platform/providers/Microsoft.DocumentDB/databaseAccounts/management-store-accounta5c440a0/sqlRoleAssignments/245cd1b9-ffb4-7eb7-5f22-865e9947c705'
b

billowy-army-68599

02/21/2023, 6:01 PM
s

strong-match-67698

02/21/2023, 6:54 PM
ok, so this actually has done the job, and even though it feels like it should have been handled by the provider, as it's always the same for this type of entity, it's not a bad workaround
on the other hand we've figured out that some changes to dapr components aren't even picked up by pulumi, and resource is 'unchanged', so I'll report it as another issue
b

billowy-army-68599

02/21/2023, 7:04 PM
feels like it should have been handled by the provider
we’ll triage that bug