DiagnosticSettingArgs

data class DiagnosticSettingArgs(val eventHubAuthorizationRuleId: Output<String>? = null, val eventHubName: Output<String>? = null, val logs: Output<List<LogSettingsArgs>>? = null, val name: Output<String>? = null, val serviceBusRuleId: Output<String>? = null, val storageAccountId: Output<String>? = null, val workspaceId: Output<String>? = null) : ConvertibleToJava<DiagnosticSettingArgs>

The diagnostic setting resource. Uses Azure REST API version 2017-04-01. In version 1.x of the Azure Native provider, it used API version 2017-04-01. Other available API versions: 2017-04-01-preview.

Example Usage

BatchAccountDelete

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var diagnosticSetting = new AzureNative.AadIam.DiagnosticSetting("diagnosticSetting", new()
{
EventHubAuthorizationRuleId = "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
EventHubName = "myeventhub",
Logs = new[]
{
new AzureNative.AadIam.Inputs.LogSettingsArgs
{
Category = AzureNative.AadIam.Category.AuditLogs,
Enabled = true,
RetentionPolicy = new AzureNative.AadIam.Inputs.RetentionPolicyArgs
{
Days = 0,
Enabled = false,
},
},
},
Name = "mysetting",
StorageAccountId = "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
WorkspaceId = "",
});
});
package main
import (
aadiam "github.com/pulumi/pulumi-azure-native-sdk/aadiam/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aadiam.NewDiagnosticSetting(ctx, "diagnosticSetting", &aadiam.DiagnosticSettingArgs{
EventHubAuthorizationRuleId: pulumi.String("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule"),
EventHubName: pulumi.String("myeventhub"),
Logs: aadiam.LogSettingsArray{
&aadiam.LogSettingsArgs{
Category: pulumi.String(aadiam.CategoryAuditLogs),
Enabled: pulumi.Bool(true),
RetentionPolicy: &aadiam.RetentionPolicyArgs{
Days: pulumi.Int(0),
Enabled: pulumi.Bool(false),
},
},
},
Name: pulumi.String("mysetting"),
StorageAccountId: pulumi.String("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"),
WorkspaceId: pulumi.String(""),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.aadiam.DiagnosticSetting;
import com.pulumi.azurenative.aadiam.DiagnosticSettingArgs;
import com.pulumi.azurenative.aadiam.inputs.LogSettingsArgs;
import com.pulumi.azurenative.aadiam.inputs.RetentionPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var diagnosticSetting = new DiagnosticSetting("diagnosticSetting", DiagnosticSettingArgs.builder()
.eventHubAuthorizationRuleId("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule")
.eventHubName("myeventhub")
.logs(LogSettingsArgs.builder()
.category("AuditLogs")
.enabled(true)
.retentionPolicy(RetentionPolicyArgs.builder()
.days(0)
.enabled(false)
.build())
.build())
.name("mysetting")
.storageAccountId("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1")
.workspaceId("")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:aadiam:DiagnosticSetting mysetting /providers/microsoft.aadiam/diagnosticSettings/{name}

Constructors

Link copied to clipboard
constructor(eventHubAuthorizationRuleId: Output<String>? = null, eventHubName: Output<String>? = null, logs: Output<List<LogSettingsArgs>>? = null, name: Output<String>? = null, serviceBusRuleId: Output<String>? = null, storageAccountId: Output<String>? = null, workspaceId: Output<String>? = null)

Properties

Link copied to clipboard
val eventHubAuthorizationRuleId: Output<String>? = null

The resource Id for the event hub authorization rule.

Link copied to clipboard
val eventHubName: Output<String>? = null

The name of the event hub. If none is specified, the default event hub will be selected.

Link copied to clipboard
val logs: Output<List<LogSettingsArgs>>? = null

The list of logs settings.

Link copied to clipboard
val name: Output<String>? = null

The name of the diagnostic setting.

Link copied to clipboard
val serviceBusRuleId: Output<String>? = null

The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.

Link copied to clipboard
val storageAccountId: Output<String>? = null

The resource ID of the storage account to which you would like to send Diagnostic Logs.

Link copied to clipboard
val workspaceId: Output<String>? = null

The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2

Functions

Link copied to clipboard
open override fun toJava(): DiagnosticSettingArgs