pulumi-azure
pulumi-azure copied to clipboard
DiagnosticSetting for LoadBalancer shows changes on every up
I'm currently trying to add DiagnosticSettings for my LoadBalancer. Adding them works fine, but on the next up Pulumi shows me changes for all log and metric categories although nothing changed.
I tested it with Terraform directly and it works as expected there. I'm using the latest Pulumi version (3.9.0) and the latest provider version (4.11.0).
Steps to reproduce
Here is my example code:
import * as azure from "@pulumi/azure";
const resourceGroup = new azure.core.ResourceGroup("resourceGroup");
const law = new azure.operationalinsights.AnalyticsWorkspace("test-law", {
resourceGroupName: resourceGroup.name,
sku: "PerGB2018",
})
const lb = new azure.lb.LoadBalancer("test", {
resourceGroupName: resourceGroup.name,
})
new azure.monitoring.DiagnosticSetting("lb", {
targetResourceId: lb.id,
logAnalyticsWorkspaceId: law.id,
logs:[{
category: "LoadBalancerAlertEvent",
enabled: true,
}, {
category: "LoadBalancerProbeHealthStatus",
enabled: true
}],
metrics: [{
category: "AllMetrics",
enabled: true,
}]
})
- Run pulumi up to create all resources.
- Run pulumi up again. It will show the following diff:
~ logs : [
~ [0]: {
~ category: "LoadBalancerAlertEvent" => "LoadBalancerAlertEvent"
~ enabled : true => true
}
~ [1]: {
~ category: "LoadBalancerProbeHealthStatus" => "LoadBalancerProbeHealthStatus"
~ enabled : true => true
}
]
~ metrics: [
~ [0]: {
~ category: "AllMetrics" => "AllMetrics"
~ enabled : true => true
}
]
Applying the change doesn't help or running pulumi up with the --refresh option.
Expected: The plan should show no changes. Actual: See above.
I'm using Pulumi.Azure 4.42.0
and am experiencing the exact same issue
@Freakazoid182 FYI: As a workaround I used the DiagnosticSetting resource by the Azure Native provider: https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting/
Thanks! I'll be doing that as well then 🙂