ManagementGroupDiagnosticSettingArgs

data class ManagementGroupDiagnosticSettingArgs(val eventHubAuthorizationRuleId: Output<String>? = null, val eventHubName: Output<String>? = null, val logs: Output<List<ManagementGroupLogSettingsArgs>>? = null, val managementGroupId: Output<String>? = null, val marketplacePartnerId: Output<String>? = null, val name: Output<String>? = null, val serviceBusRuleId: Output<String>? = null, val storageAccountId: Output<String>? = null, val workspaceId: Output<String>? = null) : ConvertibleToJava<ManagementGroupDiagnosticSettingArgs>

The management group diagnostic setting resource. Uses Azure REST API version 2021-05-01-preview. In version 1.x of the Azure Native provider, it used API version 2020-01-01-preview. Other available API versions: 2020-01-01-preview.

Example Usage

Creates or Updates the management group diagnostic setting

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var managementGroupDiagnosticSetting = new AzureNative.Insights.ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", new()
{
EventHubAuthorizationRuleId = "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule",
EventHubName = "myeventhub",
Logs = new[]
{
new AzureNative.Insights.Inputs.ManagementGroupLogSettingsArgs
{
CategoryGroup = "allLogs",
Enabled = true,
},
},
ManagementGroupId = "testChildMG7",
MarketplacePartnerId = "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1",
Name = "setting1",
StorageAccountId = "/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5",
WorkspaceId = "/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewManagementGroupDiagnosticSetting(ctx, "managementGroupDiagnosticSetting", &insights.ManagementGroupDiagnosticSettingArgs{
EventHubAuthorizationRuleId: pulumi.String("/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"),
EventHubName: pulumi.String("myeventhub"),
Logs: insights.ManagementGroupLogSettingsArray{
&insights.ManagementGroupLogSettingsArgs{
CategoryGroup: pulumi.String("allLogs"),
Enabled: pulumi.Bool(true),
},
},
ManagementGroupId: pulumi.String("testChildMG7"),
MarketplacePartnerId: pulumi.String("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"),
Name: pulumi.String("setting1"),
StorageAccountId: pulumi.String("/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5"),
WorkspaceId: pulumi.String("/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace"),
})
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.insights.ManagementGroupDiagnosticSetting;
import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSettingArgs;
import com.pulumi.azurenative.insights.inputs.ManagementGroupLogSettingsArgs;
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 managementGroupDiagnosticSetting = new ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", ManagementGroupDiagnosticSettingArgs.builder()
.eventHubAuthorizationRuleId("/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule")
.eventHubName("myeventhub")
.logs(ManagementGroupLogSettingsArgs.builder()
.categoryGroup("allLogs")
.enabled(true)
.build())
.managementGroupId("testChildMG7")
.marketplacePartnerId("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1")
.name("setting1")
.storageAccountId("/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5")
.workspaceId("/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace")
.build());
}
}

Creates or Updates the management group diagnostic setting for category

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var managementGroupDiagnosticSetting = new AzureNative.Insights.ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", new()
{
EventHubAuthorizationRuleId = "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule",
EventHubName = "myeventhub",
Logs = new[]
{
new AzureNative.Insights.Inputs.ManagementGroupLogSettingsArgs
{
Category = "Administrative",
Enabled = true,
},
new AzureNative.Insights.Inputs.ManagementGroupLogSettingsArgs
{
Category = "Policy",
Enabled = true,
},
},
ManagementGroupId = "testChildMG7",
MarketplacePartnerId = "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1",
Name = "setting1",
StorageAccountId = "/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5",
WorkspaceId = "/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewManagementGroupDiagnosticSetting(ctx, "managementGroupDiagnosticSetting", &insights.ManagementGroupDiagnosticSettingArgs{
EventHubAuthorizationRuleId: pulumi.String("/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"),
EventHubName: pulumi.String("myeventhub"),
Logs: insights.ManagementGroupLogSettingsArray{
&insights.ManagementGroupLogSettingsArgs{
Category: pulumi.String("Administrative"),
Enabled: pulumi.Bool(true),
},
&insights.ManagementGroupLogSettingsArgs{
Category: pulumi.String("Policy"),
Enabled: pulumi.Bool(true),
},
},
ManagementGroupId: pulumi.String("testChildMG7"),
MarketplacePartnerId: pulumi.String("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"),
Name: pulumi.String("setting1"),
StorageAccountId: pulumi.String("/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5"),
WorkspaceId: pulumi.String("/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace"),
})
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.insights.ManagementGroupDiagnosticSetting;
import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSettingArgs;
import com.pulumi.azurenative.insights.inputs.ManagementGroupLogSettingsArgs;
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 managementGroupDiagnosticSetting = new ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", ManagementGroupDiagnosticSettingArgs.builder()
.eventHubAuthorizationRuleId("/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule")
.eventHubName("myeventhub")
.logs(
ManagementGroupLogSettingsArgs.builder()
.category("Administrative")
.enabled(true)
.build(),
ManagementGroupLogSettingsArgs.builder()
.category("Policy")
.enabled(true)
.build())
.managementGroupId("testChildMG7")
.marketplacePartnerId("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1")
.name("setting1")
.storageAccountId("/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5")
.workspaceId("/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace")
.build());
}
}

Import

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

$ pulumi import azure-native:insights:ManagementGroupDiagnosticSetting setting1 /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/diagnosticSettings/{name}

Constructors

Link copied to clipboard
constructor(eventHubAuthorizationRuleId: Output<String>? = null, eventHubName: Output<String>? = null, logs: Output<List<ManagementGroupLogSettingsArgs>>? = null, managementGroupId: Output<String>? = null, marketplacePartnerId: Output<String>? = 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

The list of logs settings.

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

The management group id.

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

The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.

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 full ARM resource ID of the 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(): ManagementGroupDiagnosticSettingArgs