ancient-eve-13947
02/07/2022, 1:13 PMpulumi refresh
command pulumi for the next pulumi up
got the idea that an sql server instance had to be re-created. (Despite our Pulumi code regarding the databases not having changed at all.)
As a result, all databases on said server were lost.
Luckily, this was our DEV environment, so no harm done, BUT I would like to investigate why this happened, to ensure something like this can never happen on PROD.
How do we go about this?
I can point you guys at the relevant pulumi up and refresh builds, I assume you can see more in your logs than I do, to figure out why this happened.
On a separate note, I think that even if pulumi decides a database server needs to be re-created, at the very least it should come with a HUGE warning that one needs to actively confirm.
Even better would be if it copied the databases, so no data gets lost.quiet-wolf-18467
protected: true
and this will block this from happening in your automation.pulumi refresh
probably found a default value on the Pulumi side that was different from the server side with your DB. The refresh/up logs should show this change and if it's irrelevant, it can be disregarded with ignoreChanges: []
ancient-eve-13947
02/07/2022, 3:03 PMpulumi preview
again.
now I see a lock-symbol for all these resources - except the sql server: it still says "-- azure-nativesqlServer (delete-replaced)" etc.quiet-wolf-18467
pulumi preview --diff
?ancient-eve-13947
02/07/2022, 3:27 PMquiet-wolf-18467
ancient-eve-13947
02/07/2022, 3:29 PMquiet-wolf-18467
ancient-eve-13947
02/07/2022, 3:30 PMquiet-wolf-18467
+-azure-native:sql:Server: (replace) 🔒
[id=/subscriptions/25110286-d288-4e46-851b-4e2bc880672f/resourceGroups/rgDEV/providers/Microsoft.Sql/servers/sqlserver85693a2b]
[urn=urn:pulumi:Development::Cloud::azure-native:sql:Server::sqlserver]
[provider=urn:pulumi:Development::Cloud::pulumi:providers:azure-native::default_1_47_0::c3446659-4061-4fee-9512-9ef38b316f93]
- administrators: {
- administratorType: "ActiveDirectory"
- login : "<mailto:hajek@deon.de|hajek@deon.de>"
- principalType : "Group"
- sid : "576a4759-7452-407f-8988-e1795b8987eb"
- tenantId : "4194f5e7-c264-402f-b50a-1771cb365744"
}
ancient-eve-13947
02/07/2022, 3:44 PMquiet-wolf-18467
ignoreChanges: ["administrators"]
to stop this replaceancient-eve-13947
02/07/2022, 3:44 PMquiet-wolf-18467
protect
ancient-eve-13947
02/07/2022, 3:45 PMquiet-wolf-18467
administrators
directlyancient-eve-13947
02/07/2022, 3:45 PMquiet-wolf-18467
ancient-eve-13947
02/07/2022, 3:46 PMquiet-wolf-18467
ancient-eve-13947
02/07/2022, 3:51 PMquiet-wolf-18467
ancient-eve-13947
02/07/2022, 4:02 PM