In pulumi you can use the deleteBeforeReplace
parameter to indicate that a resource should be deleted and recreated rather than updated in place. I need to make a change to a resource that requires it to be deleted and then recreated (updating whether an AzureServiceBus subscription requires a sessions). Ideally I would like any future changes that do not require the subscription to be deleted to be update it in place. Is there another option that would allow me to specify in which circumstances the resource is deleted and recreated and in which circumstances it is updated? Obviously I could change the pulumi code after every update but that seems inefficient. I was thinking of something like this:
deleteBeforeReplace: ["requiresSession"]
Current code:
new servicebus.Subscription(subscriptionName, {
subscriptionName: subscriptionName,
resourceGroupName: resourceGroupCommonName,
namespaceName: serviceBusNamespaceName,
topicName: topicName,
maxDeliveryCount: 3,
lockDuration: lockDuration,
deadLetteringOnMessageExpiration: false,
requiresSession: true, // This has been changed
}, { deleteBeforeReplace:true }); // This was added to enable the above change