Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.5.0 published on Wednesday, May 4, 2022 by Pulumi

DiagnosticSetting

Manages a Diagnostic Setting for an existing Resource.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var exampleAccount = Azure.Storage.GetAccount.Invoke(new Azure.Storage.GetAccountInvokeArgs
        {
            Name = "examplestoracc",
            ResourceGroupName = exampleResourceGroup.Name,
        });
        var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new Azure.KeyVault.GetKeyVaultInvokeArgs
        {
            Name = "example-vault",
            ResourceGroupName = exampleResourceGroup.Name,
        });
        var exampleDiagnosticSetting = new Azure.Monitoring.DiagnosticSetting("exampleDiagnosticSetting", new Azure.Monitoring.DiagnosticSettingArgs
        {
            TargetResourceId = exampleKeyVault.Apply(exampleKeyVault => exampleKeyVault.Id),
            StorageAccountId = exampleAccount.Apply(exampleAccount => exampleAccount.Id),
            Logs = 
            {
                new Azure.Monitoring.Inputs.DiagnosticSettingLogArgs
                {
                    Category = "AuditEvent",
                    Enabled = false,
                    RetentionPolicy = new Azure.Monitoring.Inputs.DiagnosticSettingLogRetentionPolicyArgs
                    {
                        Enabled = false,
                    },
                },
            },
            Metrics = 
            {
                new Azure.Monitoring.Inputs.DiagnosticSettingMetricArgs
                {
                    Category = "AllMetrics",
                    RetentionPolicy = new Azure.Monitoring.Inputs.DiagnosticSettingMetricRetentionPolicyArgs
                    {
                        Enabled = false,
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAccount := storage.LookupAccountOutput(ctx, storage.GetAccountOutputArgs{
			Name:              pulumi.String("examplestoracc"),
			ResourceGroupName: exampleResourceGroup.Name,
		}, nil)
		exampleKeyVault := keyvault.LookupKeyVaultOutput(ctx, keyvault.GetKeyVaultOutputArgs{
			Name:              pulumi.String("example-vault"),
			ResourceGroupName: exampleResourceGroup.Name,
		}, nil)
		_, err = monitoring.NewDiagnosticSetting(ctx, "exampleDiagnosticSetting", &monitoring.DiagnosticSettingArgs{
			TargetResourceId: exampleKeyVault.ApplyT(func(exampleKeyVault keyvault.GetKeyVaultResult) (string, error) {
				return exampleKeyVault.Id, nil
			}).(pulumi.StringOutput),
			StorageAccountId: exampleAccount.ApplyT(func(exampleAccount storage.GetAccountResult) (string, error) {
				return exampleAccount.Id, nil
			}).(pulumi.StringOutput),
			Logs: monitoring.DiagnosticSettingLogArray{
				&monitoring.DiagnosticSettingLogArgs{
					Category: pulumi.String("AuditEvent"),
					Enabled:  pulumi.Bool(false),
					RetentionPolicy: &monitoring.DiagnosticSettingLogRetentionPolicyArgs{
						Enabled: pulumi.Bool(false),
					},
				},
			},
			Metrics: monitoring.DiagnosticSettingMetricArray{
				&monitoring.DiagnosticSettingMetricArgs{
					Category: pulumi.String("AllMetrics"),
					RetentionPolicy: &monitoring.DiagnosticSettingMetricRetentionPolicyArgs{
						Enabled: pulumi.Bool(false),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        final var exampleAccount = StorageFunctions.getAccount(GetAccountArgs.builder()
            .name("examplestoracc")
            .resourceGroupName(exampleResourceGroup.getName())
            .build());

        final var exampleKeyVault = KeyvaultFunctions.getKeyVault(GetKeyVaultArgs.builder()
            .name("example-vault")
            .resourceGroupName(exampleResourceGroup.getName())
            .build());

        var exampleDiagnosticSetting = new DiagnosticSetting("exampleDiagnosticSetting", DiagnosticSettingArgs.builder()        
            .targetResourceId(exampleKeyVault.apply(getKeyVaultResult -> getKeyVaultResult).apply(exampleKeyVault -> exampleKeyVault.apply(getKeyVaultResult -> getKeyVaultResult.getId())))
            .storageAccountId(exampleAccount.apply(getAccountResult -> getAccountResult).apply(exampleAccount -> exampleAccount.apply(getAccountResult -> getAccountResult.getId())))
            .logs(DiagnosticSettingLog.builder()
                .category("AuditEvent")
                .enabled(false)
                .retentionPolicy(DiagnosticSettingLogRetentionPolicy.builder()
                    .enabled(false)
                    .build())
                .build())
            .metrics(DiagnosticSettingMetric.builder()
                .category("AllMetrics")
                .retentionPolicy(DiagnosticSettingMetricRetentionPolicy.builder()
                    .enabled(false)
                    .build())
                .build())
            .build());

        }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_account = azure.storage.get_account_output(name="examplestoracc",
    resource_group_name=example_resource_group.name)
example_key_vault = azure.keyvault.get_key_vault_output(name="example-vault",
    resource_group_name=example_resource_group.name)
example_diagnostic_setting = azure.monitoring.DiagnosticSetting("exampleDiagnosticSetting",
    target_resource_id=example_key_vault.id,
    storage_account_id=example_account.id,
    logs=[azure.monitoring.DiagnosticSettingLogArgs(
        category="AuditEvent",
        enabled=False,
        retention_policy=azure.monitoring.DiagnosticSettingLogRetentionPolicyArgs(
            enabled=False,
        ),
    )],
    metrics=[azure.monitoring.DiagnosticSettingMetricArgs(
        category="AllMetrics",
        retention_policy=azure.monitoring.DiagnosticSettingMetricRetentionPolicyArgs(
            enabled=False,
        ),
    )])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAccount = azure.storage.getAccountOutput({
    name: "examplestoracc",
    resourceGroupName: exampleResourceGroup.name,
});
const exampleKeyVault = azure.keyvault.getKeyVaultOutput({
    name: "example-vault",
    resourceGroupName: exampleResourceGroup.name,
});
const exampleDiagnosticSetting = new azure.monitoring.DiagnosticSetting("exampleDiagnosticSetting", {
    targetResourceId: exampleKeyVault.apply(exampleKeyVault => exampleKeyVault.id),
    storageAccountId: exampleAccount.apply(exampleAccount => exampleAccount.id),
    logs: [{
        category: "AuditEvent",
        enabled: false,
        retentionPolicy: {
            enabled: false,
        },
    }],
    metrics: [{
        category: "AllMetrics",
        retentionPolicy: {
            enabled: false,
        },
    }],
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleDiagnosticSetting:
    type: azure:monitoring:DiagnosticSetting
    properties:
      targetResourceId: ${exampleKeyVault.id}
      storageAccountId: ${exampleAccount.id}
      logs:
        - category: AuditEvent
          enabled: false
          retentionPolicy:
            enabled: false
      metrics:
        - category: AllMetrics
          retentionPolicy:
            enabled: false
variables:
  exampleAccount:
    Fn::Invoke:
      Function: azure:storage:getAccount
      Arguments:
        name: examplestoracc
        resourceGroupName: ${exampleResourceGroup.name}
  exampleKeyVault:
    Fn::Invoke:
      Function: azure:keyvault:getKeyVault
      Arguments:
        name: example-vault
        resourceGroupName: ${exampleResourceGroup.name}

Create a DiagnosticSetting Resource

new DiagnosticSetting(name: string, args: DiagnosticSettingArgs, opts?: CustomResourceOptions);
@overload
def DiagnosticSetting(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      eventhub_authorization_rule_id: Optional[str] = None,
                      eventhub_name: Optional[str] = None,
                      log_analytics_destination_type: Optional[str] = None,
                      log_analytics_workspace_id: Optional[str] = None,
                      logs: Optional[Sequence[DiagnosticSettingLogArgs]] = None,
                      metrics: Optional[Sequence[DiagnosticSettingMetricArgs]] = None,
                      name: Optional[str] = None,
                      storage_account_id: Optional[str] = None,
                      target_resource_id: Optional[str] = None)
@overload
def DiagnosticSetting(resource_name: str,
                      args: DiagnosticSettingArgs,
                      opts: Optional[ResourceOptions] = None)
func NewDiagnosticSetting(ctx *Context, name string, args DiagnosticSettingArgs, opts ...ResourceOption) (*DiagnosticSetting, error)
public DiagnosticSetting(string name, DiagnosticSettingArgs args, CustomResourceOptions? opts = null)
public DiagnosticSetting(String name, DiagnosticSettingArgs args)
public DiagnosticSetting(String name, DiagnosticSettingArgs args, CustomResourceOptions options)
type: azure:monitoring:DiagnosticSetting
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args DiagnosticSettingArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The DiagnosticSetting resource accepts the following input properties:

TargetResourceId string

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

EventhubAuthorizationRuleId string

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

EventhubName string

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

LogAnalyticsDestinationType string

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

Logs List<DiagnosticSettingLogArgs>

One or more log blocks as defined below.

Metrics List<DiagnosticSettingMetricArgs>

One or more metric blocks as defined below.

Name string

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

StorageAccountId string

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

TargetResourceId string

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

EventhubAuthorizationRuleId string

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

EventhubName string

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

LogAnalyticsDestinationType string

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

Logs []DiagnosticSettingLogArgs

One or more log blocks as defined below.

Metrics []DiagnosticSettingMetricArgs

One or more metric blocks as defined below.

Name string

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

StorageAccountId string

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

targetResourceId String

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhubAuthorizationRuleId String

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhubName String

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logAnalyticsDestinationType String

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

logAnalyticsWorkspaceId String

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs ListSettingLogArgs>

One or more log blocks as defined below.

metrics ListSettingMetricArgs>

One or more metric blocks as defined below.

name String

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storageAccountId String

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

targetResourceId string

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhubAuthorizationRuleId string

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhubName string

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logAnalyticsDestinationType string

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

logAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs DiagnosticSettingLogArgs[]

One or more log blocks as defined below.

metrics DiagnosticSettingMetricArgs[]

One or more metric blocks as defined below.

name string

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storageAccountId string

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

target_resource_id str

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhub_authorization_rule_id str

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhub_name str

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

log_analytics_destination_type str

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

log_analytics_workspace_id str

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs Sequence[DiagnosticSettingLogArgs]

One or more log blocks as defined below.

metrics Sequence[DiagnosticSettingMetricArgs]

One or more metric blocks as defined below.

name str

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storage_account_id str

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

targetResourceId String

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhubAuthorizationRuleId String

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhubName String

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logAnalyticsDestinationType String

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

logAnalyticsWorkspaceId String

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs List

One or more log blocks as defined below.

metrics List

One or more metric blocks as defined below.

name String

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storageAccountId String

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

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.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing DiagnosticSetting Resource

Get an existing DiagnosticSetting resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DiagnosticSettingState, opts?: CustomResourceOptions): DiagnosticSetting
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        eventhub_authorization_rule_id: Optional[str] = None,
        eventhub_name: Optional[str] = None,
        log_analytics_destination_type: Optional[str] = None,
        log_analytics_workspace_id: Optional[str] = None,
        logs: Optional[Sequence[DiagnosticSettingLogArgs]] = None,
        metrics: Optional[Sequence[DiagnosticSettingMetricArgs]] = None,
        name: Optional[str] = None,
        storage_account_id: Optional[str] = None,
        target_resource_id: Optional[str] = None) -> DiagnosticSetting
func GetDiagnosticSetting(ctx *Context, name string, id IDInput, state *DiagnosticSettingState, opts ...ResourceOption) (*DiagnosticSetting, error)
public static DiagnosticSetting Get(string name, Input<string> id, DiagnosticSettingState? state, CustomResourceOptions? opts = null)
public static DiagnosticSetting get(String name, Output<String> id, DiagnosticSettingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
EventhubAuthorizationRuleId string

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

EventhubName string

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

LogAnalyticsDestinationType string

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

Logs List<DiagnosticSettingLogArgs>

One or more log blocks as defined below.

Metrics List<DiagnosticSettingMetricArgs>

One or more metric blocks as defined below.

Name string

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

StorageAccountId string

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

TargetResourceId string

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

EventhubAuthorizationRuleId string

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

EventhubName string

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

LogAnalyticsDestinationType string

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

Logs []DiagnosticSettingLogArgs

One or more log blocks as defined below.

Metrics []DiagnosticSettingMetricArgs

One or more metric blocks as defined below.

Name string

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

StorageAccountId string

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

TargetResourceId string

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhubAuthorizationRuleId String

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhubName String

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logAnalyticsDestinationType String

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

logAnalyticsWorkspaceId String

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs ListSettingLogArgs>

One or more log blocks as defined below.

metrics ListSettingMetricArgs>

One or more metric blocks as defined below.

name String

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storageAccountId String

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

targetResourceId String

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhubAuthorizationRuleId string

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhubName string

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logAnalyticsDestinationType string

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

logAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs DiagnosticSettingLogArgs[]

One or more log blocks as defined below.

metrics DiagnosticSettingMetricArgs[]

One or more metric blocks as defined below.

name string

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storageAccountId string

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

targetResourceId string

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhub_authorization_rule_id str

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhub_name str

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

log_analytics_destination_type str

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

log_analytics_workspace_id str

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs Sequence[DiagnosticSettingLogArgs]

One or more log blocks as defined below.

metrics Sequence[DiagnosticSettingMetricArgs]

One or more metric blocks as defined below.

name str

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storage_account_id str

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

target_resource_id str

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

eventhubAuthorizationRuleId String

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

eventhubName String

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logAnalyticsDestinationType String

When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

logAnalyticsWorkspaceId String

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

logs List

One or more log blocks as defined below.

metrics List

One or more metric blocks as defined below.

name String

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

storageAccountId String

The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

targetResourceId String

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

Supporting Types

DiagnosticSettingLog

Category string

The name of a Diagnostic Log Category for this Resource.

Enabled bool

Is this Diagnostic Log enabled? Defaults to true.

RetentionPolicy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

Category string

The name of a Diagnostic Log Category for this Resource.

Enabled bool

Is this Diagnostic Log enabled? Defaults to true.

RetentionPolicy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

category String

The name of a Diagnostic Log Category for this Resource.

enabled Boolean

Is this Diagnostic Log enabled? Defaults to true.

retentionPolicy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

category string

The name of a Diagnostic Log Category for this Resource.

enabled boolean

Is this Diagnostic Log enabled? Defaults to true.

retentionPolicy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

category str

The name of a Diagnostic Log Category for this Resource.

enabled bool

Is this Diagnostic Log enabled? Defaults to true.

retention_policy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

category String

The name of a Diagnostic Log Category for this Resource.

enabled Boolean

Is this Diagnostic Log enabled? Defaults to true.

retentionPolicy Property Map

A retention_policy block as defined below.

DiagnosticSettingLogRetentionPolicy

Enabled bool

Is this Retention Policy enabled?

Days int

The number of days for which this Retention Policy should apply.

Enabled bool

Is this Retention Policy enabled?

Days int

The number of days for which this Retention Policy should apply.

enabled Boolean

Is this Retention Policy enabled?

days Integer

The number of days for which this Retention Policy should apply.

enabled boolean

Is this Retention Policy enabled?

days number

The number of days for which this Retention Policy should apply.

enabled bool

Is this Retention Policy enabled?

days int

The number of days for which this Retention Policy should apply.

enabled Boolean

Is this Retention Policy enabled?

days Number

The number of days for which this Retention Policy should apply.

DiagnosticSettingMetric

Category string

The name of a Diagnostic Metric Category for this Resource.

Enabled bool

Is this Diagnostic Metric enabled? Defaults to true.

RetentionPolicy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

Category string

The name of a Diagnostic Metric Category for this Resource.

Enabled bool

Is this Diagnostic Metric enabled? Defaults to true.

RetentionPolicy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

category String

The name of a Diagnostic Metric Category for this Resource.

enabled Boolean

Is this Diagnostic Metric enabled? Defaults to true.

retentionPolicy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

category string

The name of a Diagnostic Metric Category for this Resource.

enabled boolean

Is this Diagnostic Metric enabled? Defaults to true.

retentionPolicy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

category str

The name of a Diagnostic Metric Category for this Resource.

enabled bool

Is this Diagnostic Metric enabled? Defaults to true.

retention_policy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

category String

The name of a Diagnostic Metric Category for this Resource.

enabled Boolean

Is this Diagnostic Metric enabled? Defaults to true.

retentionPolicy Property Map

A retention_policy block as defined below.

DiagnosticSettingMetricRetentionPolicy

Enabled bool

Is this Retention Policy enabled?

Days int

The number of days for which this Retention Policy should apply.

Enabled bool

Is this Retention Policy enabled?

Days int

The number of days for which this Retention Policy should apply.

enabled Boolean

Is this Retention Policy enabled?

days Integer

The number of days for which this Retention Policy should apply.

enabled boolean

Is this Retention Policy enabled?

days number

The number of days for which this Retention Policy should apply.

enabled bool

Is this Retention Policy enabled?

days int

The number of days for which this Retention Policy should apply.

enabled Boolean

Is this Retention Policy enabled?

days Number

The number of days for which this Retention Policy should apply.

Import

Diagnostic Settings can be imported using the resource id, e.g.

 $ pulumi import azure:monitoring/diagnosticSetting:DiagnosticSetting example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.KeyVault/vaults/vault1|logMonitoring1"

Package Details

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

This Pulumi package is based on the azurerm Terraform Provider.