Azure Native

v1.48.0 published on Monday, Nov 29, 2021 by Pulumi

ManagementGroupDiagnosticSetting

The management group diagnostic setting resource. API Version: 2020-01-01-preview.

Example Usage

Creates or Updates the management group diagnostic setting

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var managementGroupDiagnosticSetting = new AzureNative.Insights.ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", new AzureNative.Insights.ManagementGroupDiagnosticSettingArgs
        {
            EventHubAuthorizationRuleId = "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
            EventHubName = "myeventhub",
            Logs = 
            {
                new AzureNative.Insights.Inputs.ManagementGroupLogSettingsArgs
                {
                    Category = "Administrative",
                    Enabled = true,
                },
                new AzureNative.Insights.Inputs.ManagementGroupLogSettingsArgs
                {
                    Category = "Policy",
                    Enabled = true,
                },
            },
            ManagementGroupId = "testChildMG7",
            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/go/azure/insights"
	"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/eventhubs/myeventhub/authorizationrules/myrule"),
			EventHubName:                pulumi.String("myeventhub"),
			Logs: []insights.ManagementGroupLogSettingsArgs{
				&insights.ManagementGroupLogSettingsArgs{
					Category: pulumi.String("Administrative"),
					Enabled:  pulumi.Bool(true),
				},
				&insights.ManagementGroupLogSettingsArgs{
					Category: pulumi.String("Policy"),
					Enabled:  pulumi.Bool(true),
				},
			},
			ManagementGroupId: pulumi.String("testChildMG7"),
			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
	})
}

import pulumi
import pulumi_azure_native as azure_native

management_group_diagnostic_setting = azure_native.insights.ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting",
    event_hub_authorization_rule_id="/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    event_hub_name="myeventhub",
    logs=[
        azure_native.insights.ManagementGroupLogSettingsArgs(
            category="Administrative",
            enabled=True,
        ),
        azure_native.insights.ManagementGroupLogSettingsArgs(
            category="Policy",
            enabled=True,
        ),
    ],
    management_group_id="testChildMG7",
    name="setting1",
    storage_account_id="/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5",
    workspace_id="/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const managementGroupDiagnosticSetting = new azure_native.insights.ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", {
    eventHubAuthorizationRuleId: "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    eventHubName: "myeventhub",
    logs: [
        {
            category: "Administrative",
            enabled: true,
        },
        {
            category: "Policy",
            enabled: true,
        },
    ],
    managementGroupId: "testChildMG7",
    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",
});

Create a ManagementGroupDiagnosticSetting Resource

new ManagementGroupDiagnosticSetting(name: string, args: ManagementGroupDiagnosticSettingArgs, opts?: CustomResourceOptions);
@overload
def ManagementGroupDiagnosticSetting(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     event_hub_authorization_rule_id: Optional[str] = None,
                                     event_hub_name: Optional[str] = None,
                                     location: Optional[str] = None,
                                     logs: Optional[Sequence[ManagementGroupLogSettingsArgs]] = None,
                                     management_group_id: Optional[str] = None,
                                     name: Optional[str] = None,
                                     service_bus_rule_id: Optional[str] = None,
                                     storage_account_id: Optional[str] = None,
                                     workspace_id: Optional[str] = None)
@overload
def ManagementGroupDiagnosticSetting(resource_name: str,
                                     args: ManagementGroupDiagnosticSettingArgs,
                                     opts: Optional[ResourceOptions] = None)
func NewManagementGroupDiagnosticSetting(ctx *Context, name string, args ManagementGroupDiagnosticSettingArgs, opts ...ResourceOption) (*ManagementGroupDiagnosticSetting, error)
public ManagementGroupDiagnosticSetting(string name, ManagementGroupDiagnosticSettingArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ManagementGroupDiagnosticSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ManagementGroupDiagnosticSettingArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ManagementGroupDiagnosticSettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ManagementGroupDiagnosticSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ManagementGroupDiagnosticSetting Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ManagementGroupDiagnosticSetting resource accepts the following input properties:

ManagementGroupId string
The management group id.
EventHubAuthorizationRuleId string
The resource Id for the event hub authorization rule.
EventHubName string
The name of the event hub. If none is specified, the default event hub will be selected.
Location string
Location of the resource
Logs List<Pulumi.AzureNative.Insights.Inputs.ManagementGroupLogSettingsArgs>
The list of logs settings.
Name string
The name of the diagnostic setting.
ServiceBusRuleId string
The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
StorageAccountId string
The resource ID of the storage account to which you would like to send Diagnostic Logs.
WorkspaceId string
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
ManagementGroupId string
The management group id.
EventHubAuthorizationRuleId string
The resource Id for the event hub authorization rule.
EventHubName string
The name of the event hub. If none is specified, the default event hub will be selected.
Location string
Location of the resource
Logs []ManagementGroupLogSettingsArgs
The list of logs settings.
Name string
The name of the diagnostic setting.
ServiceBusRuleId string
The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
StorageAccountId string
The resource ID of the storage account to which you would like to send Diagnostic Logs.
WorkspaceId string
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
managementGroupId string
The management group id.
eventHubAuthorizationRuleId string
The resource Id for the event hub authorization rule.
eventHubName string
The name of the event hub. If none is specified, the default event hub will be selected.
location string
Location of the resource
logs ManagementGroupLogSettingsArgs[]
The list of logs settings.
name string
The name of the diagnostic setting.
serviceBusRuleId string
The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
storageAccountId string
The resource ID of the storage account to which you would like to send Diagnostic Logs.
workspaceId string
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
management_group_id str
The management group id.
event_hub_authorization_rule_id str
The resource Id for the event hub authorization rule.
event_hub_name str
The name of the event hub. If none is specified, the default event hub will be selected.
location str
Location of the resource
logs Sequence[ManagementGroupLogSettingsArgs]
The list of logs settings.
name str
The name of the diagnostic setting.
service_bus_rule_id str
The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
storage_account_id str
The resource ID of the storage account to which you would like to send Diagnostic Logs.
workspace_id str
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

Outputs

All input properties are implicitly available as output properties. Additionally, the ManagementGroupDiagnosticSetting resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Type string
Azure resource type
Id string
The provider-assigned unique ID for this managed resource.
Type string
Azure resource type
id string
The provider-assigned unique ID for this managed resource.
type string
Azure resource type
id str
The provider-assigned unique ID for this managed resource.
type str
Azure resource type

Supporting Types

ManagementGroupLogSettings

Category string
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
Enabled bool
a value indicating whether this log is enabled.
Category string
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
Enabled bool
a value indicating whether this log is enabled.
category string
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
enabled boolean
a value indicating whether this log is enabled.
category str
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
enabled bool
a value indicating whether this log is enabled.

ManagementGroupLogSettingsResponse

Category string
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
Enabled bool
a value indicating whether this log is enabled.
Category string
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
Enabled bool
a value indicating whether this log is enabled.
category string
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
enabled boolean
a value indicating whether this log is enabled.
category str
Name of a Management Group Diagnostic Log category for a resource type this setting is applied to.
enabled bool
a value indicating whether this log is enabled.

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/testChildMG7/providers/microsoft.insights/diagnosticSettings/setting1 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0