DiagnosticSetting

The diagnostic setting resource. API Version: 2017-04-01.

Example Usage

BatchAccountDelete

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var diagnosticSetting = new AzureNative.AadIam.DiagnosticSetting("diagnosticSetting", new AzureNative.AadIam.DiagnosticSettingArgs
        {
            EventHubAuthorizationRuleId = "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
            EventHubName = "myeventhub",
            Logs = 
            {
                new AzureNative.AadIam.Inputs.LogSettingsArgs
                {
                    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/go/azure/aadiam"
	"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("AuditLogs"),
					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
	})
}

import pulumi
import pulumi_azure_native as azure_native

diagnostic_setting = azure_native.aadiam.DiagnosticSetting("diagnosticSetting",
    event_hub_authorization_rule_id="/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    event_hub_name="myeventhub",
    logs=[azure_native.aadiam.LogSettingsArgs(
        category="AuditLogs",
        enabled=True,
        retention_policy=azure_native.aadiam.RetentionPolicyArgs(
            days=0,
            enabled=False,
        ),
    )],
    name="mysetting",
    storage_account_id="/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
    workspace_id="")

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

const diagnosticSetting = new azure_native.aadiam.DiagnosticSetting("diagnosticSetting", {
    eventHubAuthorizationRuleId: "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    eventHubName: "myeventhub",
    logs: [{
        category: "AuditLogs",
        enabled: true,
        retentionPolicy: {
            days: 0,
            enabled: false,
        },
    }],
    name: "mysetting",
    storageAccountId: "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
    workspaceId: "",
});

Create a DiagnosticSetting Resource

new DiagnosticSetting(name: string, args?: DiagnosticSettingArgs, opts?: CustomResourceOptions);
@overload
def DiagnosticSetting(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      event_hub_authorization_rule_id: Optional[str] = None,
                      event_hub_name: Optional[str] = None,
                      logs: Optional[Sequence[LogSettingsArgs]] = 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 DiagnosticSetting(resource_name: str,
                      args: Optional[DiagnosticSettingArgs] = None,
                      opts: Optional[ResourceOptions] = None)
func NewDiagnosticSetting(ctx *Context, name string, args *DiagnosticSettingArgs, opts ...ResourceOption) (*DiagnosticSetting, error)
public DiagnosticSetting(string name, DiagnosticSettingArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DiagnosticSettingArgs
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 DiagnosticSettingArgs
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 DiagnosticSettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DiagnosticSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

DiagnosticSetting Resource Properties

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

Inputs

The DiagnosticSetting resource accepts the following input properties:

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.
Logs List<Pulumi.AzureNative.AadIam.Inputs.LogSettingsArgs>
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 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
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.
Logs []LogSettings
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 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
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.
logs LogSettingsArgs[]
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 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
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.
logs Sequence[LogSettingsArgs]
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 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

Outputs

All input properties are implicitly available as output properties. Additionally, the DiagnosticSetting 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

Category

AuditLogs
AuditLogs
SignInLogs
SignInLogs
CategoryAuditLogs
AuditLogs
CategorySignInLogs
SignInLogs
AuditLogs
AuditLogs
SignInLogs
SignInLogs
AUDIT_LOGS
AuditLogs
SIGN_IN_LOGS
SignInLogs

LogSettings

Enabled bool
A value indicating whether this log is enabled.
Category string | Pulumi.AzureNative.AadIam.Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
RetentionPolicy Pulumi.AzureNative.AadIam.Inputs.RetentionPolicyArgs
The retention policy for this log.
Enabled bool
A value indicating whether this log is enabled.
Category string | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
RetentionPolicy RetentionPolicy
The retention policy for this log.
enabled boolean
A value indicating whether this log is enabled.
category string | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
retentionPolicy RetentionPolicyArgs
The retention policy for this log.
enabled bool
A value indicating whether this log is enabled.
category str | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
retention_policy RetentionPolicyArgs
The retention policy for this log.

LogSettingsResponse

Enabled bool
A value indicating whether this log is enabled.
Category string
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
RetentionPolicy Pulumi.AzureNative.AadIam.Inputs.RetentionPolicyResponseArgs
The retention policy for this log.
Enabled bool
A value indicating whether this log is enabled.
Category string
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
RetentionPolicy RetentionPolicyResponse
The retention policy for this log.
enabled boolean
A value indicating whether this log is enabled.
category string
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
retentionPolicy RetentionPolicyResponseArgs
The retention policy for this log.
enabled bool
A value indicating whether this log is enabled.
category str
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
retention_policy RetentionPolicyResponseArgs
The retention policy for this log.

RetentionPolicy

Days int
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled bool
A value indicating whether the retention policy is enabled.
Days int
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled bool
A value indicating whether the retention policy is enabled.
days number
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled boolean
A value indicating whether the retention policy is enabled.
days int
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled bool
A value indicating whether the retention policy is enabled.

RetentionPolicyResponse

Days int
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled bool
A value indicating whether the retention policy is enabled.
Days int
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled bool
A value indicating whether the retention policy is enabled.
days number
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled boolean
A value indicating whether the retention policy is enabled.
days int
The number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled bool
A value indicating whether the retention policy is enabled.

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/mysetting 

Package Details

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