We recommend using Azure Native.
azure.monitoring.DiagnosticSetting
Explore with Pulumi AI
Manages a Diagnostic Setting for an existing Resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
    name: "example-resources",
    location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
    name: "storageaccountname",
    resourceGroupName: example.name,
    location: example.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const current = azure.core.getClientConfig({});
const exampleKeyVault = new azure.keyvault.KeyVault("example", {
    name: "examplekeyvault",
    location: example.location,
    resourceGroupName: example.name,
    tenantId: current.then(current => current.tenantId),
    softDeleteRetentionDays: 7,
    purgeProtectionEnabled: false,
    skuName: "standard",
});
const exampleDiagnosticSetting = new azure.monitoring.DiagnosticSetting("example", {
    name: "example",
    targetResourceId: exampleKeyVault.id,
    storageAccountId: exampleAccount.id,
    enabledLogs: [{
        category: "AuditEvent",
        retentionPolicy: {
            enabled: false,
        },
    }],
    metrics: [{
        category: "AllMetrics",
        retentionPolicy: {
            enabled: false,
        },
    }],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
    name="example-resources",
    location="West Europe")
example_account = azure.storage.Account("example",
    name="storageaccountname",
    resource_group_name=example.name,
    location=example.location,
    account_tier="Standard",
    account_replication_type="LRS")
current = azure.core.get_client_config()
example_key_vault = azure.keyvault.KeyVault("example",
    name="examplekeyvault",
    location=example.location,
    resource_group_name=example.name,
    tenant_id=current.tenant_id,
    soft_delete_retention_days=7,
    purge_protection_enabled=False,
    sku_name="standard")
example_diagnostic_setting = azure.monitoring.DiagnosticSetting("example",
    name="example",
    target_resource_id=example_key_vault.id,
    storage_account_id=example_account.id,
    enabled_logs=[azure.monitoring.DiagnosticSettingEnabledLogArgs(
        category="AuditEvent",
        retention_policy=azure.monitoring.DiagnosticSettingEnabledLogRetentionPolicyArgs(
            enabled=False,
        ),
    )],
    metrics=[azure.monitoring.DiagnosticSettingMetricArgs(
        category="AllMetrics",
        retention_policy=azure.monitoring.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 {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example-resources"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
			Name:                   pulumi.String("storageaccountname"),
			ResourceGroupName:      example.Name,
			Location:               example.Location,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("LRS"),
		})
		if err != nil {
			return err
		}
		current, err := core.GetClientConfig(ctx, nil, nil)
		if err != nil {
			return err
		}
		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "example", &keyvault.KeyVaultArgs{
			Name:                    pulumi.String("examplekeyvault"),
			Location:                example.Location,
			ResourceGroupName:       example.Name,
			TenantId:                pulumi.String(current.TenantId),
			SoftDeleteRetentionDays: pulumi.Int(7),
			PurgeProtectionEnabled:  pulumi.Bool(false),
			SkuName:                 pulumi.String("standard"),
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewDiagnosticSetting(ctx, "example", &monitoring.DiagnosticSettingArgs{
			Name:             pulumi.String("example"),
			TargetResourceId: exampleKeyVault.ID(),
			StorageAccountId: exampleAccount.ID(),
			EnabledLogs: monitoring.DiagnosticSettingEnabledLogArray{
				&monitoring.DiagnosticSettingEnabledLogArgs{
					Category: pulumi.String("AuditEvent"),
					RetentionPolicy: &monitoring.DiagnosticSettingEnabledLogRetentionPolicyArgs{
						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
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example-resources",
        Location = "West Europe",
    });
    var exampleAccount = new Azure.Storage.Account("example", new()
    {
        Name = "storageaccountname",
        ResourceGroupName = example.Name,
        Location = example.Location,
        AccountTier = "Standard",
        AccountReplicationType = "LRS",
    });
    var current = Azure.Core.GetClientConfig.Invoke();
    var exampleKeyVault = new Azure.KeyVault.KeyVault("example", new()
    {
        Name = "examplekeyvault",
        Location = example.Location,
        ResourceGroupName = example.Name,
        TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
        SoftDeleteRetentionDays = 7,
        PurgeProtectionEnabled = false,
        SkuName = "standard",
    });
    var exampleDiagnosticSetting = new Azure.Monitoring.DiagnosticSetting("example", new()
    {
        Name = "example",
        TargetResourceId = exampleKeyVault.Id,
        StorageAccountId = exampleAccount.Id,
        EnabledLogs = new[]
        {
            new Azure.Monitoring.Inputs.DiagnosticSettingEnabledLogArgs
            {
                Category = "AuditEvent",
                RetentionPolicy = new Azure.Monitoring.Inputs.DiagnosticSettingEnabledLogRetentionPolicyArgs
                {
                    Enabled = false,
                },
            },
        },
        Metrics = new[]
        {
            new Azure.Monitoring.Inputs.DiagnosticSettingMetricArgs
            {
                Category = "AllMetrics",
                RetentionPolicy = new Azure.Monitoring.Inputs.DiagnosticSettingMetricRetentionPolicyArgs
                {
                    Enabled = false,
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.keyvault.KeyVault;
import com.pulumi.azure.keyvault.KeyVaultArgs;
import com.pulumi.azure.monitoring.DiagnosticSetting;
import com.pulumi.azure.monitoring.DiagnosticSettingArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingEnabledLogArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingEnabledLogRetentionPolicyArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingMetricArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingMetricRetentionPolicyArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example-resources")
            .location("West Europe")
            .build());
        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
            .name("storageaccountname")
            .resourceGroupName(example.name())
            .location(example.location())
            .accountTier("Standard")
            .accountReplicationType("LRS")
            .build());
        final var current = CoreFunctions.getClientConfig();
        var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
            .name("examplekeyvault")
            .location(example.location())
            .resourceGroupName(example.name())
            .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
            .softDeleteRetentionDays(7)
            .purgeProtectionEnabled(false)
            .skuName("standard")
            .build());
        var exampleDiagnosticSetting = new DiagnosticSetting("exampleDiagnosticSetting", DiagnosticSettingArgs.builder()
            .name("example")
            .targetResourceId(exampleKeyVault.id())
            .storageAccountId(exampleAccount.id())
            .enabledLogs(DiagnosticSettingEnabledLogArgs.builder()
                .category("AuditEvent")
                .retentionPolicy(DiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
                    .enabled(false)
                    .build())
                .build())
            .metrics(DiagnosticSettingMetricArgs.builder()
                .category("AllMetrics")
                .retentionPolicy(DiagnosticSettingMetricRetentionPolicyArgs.builder()
                    .enabled(false)
                    .build())
                .build())
            .build());
    }
}
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example-resources
      location: West Europe
  exampleAccount:
    type: azure:storage:Account
    name: example
    properties:
      name: storageaccountname
      resourceGroupName: ${example.name}
      location: ${example.location}
      accountTier: Standard
      accountReplicationType: LRS
  exampleKeyVault:
    type: azure:keyvault:KeyVault
    name: example
    properties:
      name: examplekeyvault
      location: ${example.location}
      resourceGroupName: ${example.name}
      tenantId: ${current.tenantId}
      softDeleteRetentionDays: 7
      purgeProtectionEnabled: false
      skuName: standard
  exampleDiagnosticSetting:
    type: azure:monitoring:DiagnosticSetting
    name: example
    properties:
      name: example
      targetResourceId: ${exampleKeyVault.id}
      storageAccountId: ${exampleAccount.id}
      enabledLogs:
        - category: AuditEvent
          retentionPolicy:
            enabled: false
      metrics:
        - category: AllMetrics
          retentionPolicy:
            enabled: false
variables:
  current:
    fn::invoke:
      Function: azure:core:getClientConfig
      Arguments: {}
Create DiagnosticSetting Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DiagnosticSetting(name: string, args: DiagnosticSettingArgs, opts?: CustomResourceOptions);@overload
def DiagnosticSetting(resource_name: str,
                      args: DiagnosticSettingArgs,
                      opts: Optional[ResourceOptions] = None)
@overload
def DiagnosticSetting(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      target_resource_id: Optional[str] = None,
                      enabled_logs: Optional[Sequence[DiagnosticSettingEnabledLogArgs]] = 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,
                      partner_solution_id: Optional[str] = None,
                      storage_account_id: Optional[str] = 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.
Parameters
- 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.
 
Constructor example
The following reference example uses placeholder values for all input properties.
var diagnosticSettingResource = new Azure.Monitoring.DiagnosticSetting("diagnosticSettingResource", new()
{
    TargetResourceId = "string",
    EnabledLogs = new[]
    {
        new Azure.Monitoring.Inputs.DiagnosticSettingEnabledLogArgs
        {
            Category = "string",
            CategoryGroup = "string",
        },
    },
    EventhubAuthorizationRuleId = "string",
    EventhubName = "string",
    LogAnalyticsDestinationType = "string",
    LogAnalyticsWorkspaceId = "string",
    Metrics = new[]
    {
        new Azure.Monitoring.Inputs.DiagnosticSettingMetricArgs
        {
            Category = "string",
            Enabled = false,
        },
    },
    Name = "string",
    PartnerSolutionId = "string",
    StorageAccountId = "string",
});
example, err := monitoring.NewDiagnosticSetting(ctx, "diagnosticSettingResource", &monitoring.DiagnosticSettingArgs{
	TargetResourceId: pulumi.String("string"),
	EnabledLogs: monitoring.DiagnosticSettingEnabledLogArray{
		&monitoring.DiagnosticSettingEnabledLogArgs{
			Category:      pulumi.String("string"),
			CategoryGroup: pulumi.String("string"),
		},
	},
	EventhubAuthorizationRuleId: pulumi.String("string"),
	EventhubName:                pulumi.String("string"),
	LogAnalyticsDestinationType: pulumi.String("string"),
	LogAnalyticsWorkspaceId:     pulumi.String("string"),
	Metrics: monitoring.DiagnosticSettingMetricArray{
		&monitoring.DiagnosticSettingMetricArgs{
			Category: pulumi.String("string"),
			Enabled:  pulumi.Bool(false),
		},
	},
	Name:              pulumi.String("string"),
	PartnerSolutionId: pulumi.String("string"),
	StorageAccountId:  pulumi.String("string"),
})
var diagnosticSettingResource = new DiagnosticSetting("diagnosticSettingResource", DiagnosticSettingArgs.builder()
    .targetResourceId("string")
    .enabledLogs(DiagnosticSettingEnabledLogArgs.builder()
        .category("string")
        .categoryGroup("string")
        .build())
    .eventhubAuthorizationRuleId("string")
    .eventhubName("string")
    .logAnalyticsDestinationType("string")
    .logAnalyticsWorkspaceId("string")
    .metrics(DiagnosticSettingMetricArgs.builder()
        .category("string")
        .enabled(false)
        .build())
    .name("string")
    .partnerSolutionId("string")
    .storageAccountId("string")
    .build());
diagnostic_setting_resource = azure.monitoring.DiagnosticSetting("diagnosticSettingResource",
    target_resource_id="string",
    enabled_logs=[azure.monitoring.DiagnosticSettingEnabledLogArgs(
        category="string",
        category_group="string",
    )],
    eventhub_authorization_rule_id="string",
    eventhub_name="string",
    log_analytics_destination_type="string",
    log_analytics_workspace_id="string",
    metrics=[azure.monitoring.DiagnosticSettingMetricArgs(
        category="string",
        enabled=False,
    )],
    name="string",
    partner_solution_id="string",
    storage_account_id="string")
const diagnosticSettingResource = new azure.monitoring.DiagnosticSetting("diagnosticSettingResource", {
    targetResourceId: "string",
    enabledLogs: [{
        category: "string",
        categoryGroup: "string",
    }],
    eventhubAuthorizationRuleId: "string",
    eventhubName: "string",
    logAnalyticsDestinationType: "string",
    logAnalyticsWorkspaceId: "string",
    metrics: [{
        category: "string",
        enabled: false,
    }],
    name: "string",
    partnerSolutionId: "string",
    storageAccountId: "string",
});
type: azure:monitoring:DiagnosticSetting
properties:
    enabledLogs:
        - category: string
          categoryGroup: string
    eventhubAuthorizationRuleId: string
    eventhubName: string
    logAnalyticsDestinationType: string
    logAnalyticsWorkspaceId: string
    metrics:
        - category: string
          enabled: false
    name: string
    partnerSolutionId: string
    storageAccountId: string
    targetResourceId: string
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:
- Target
Resource stringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 - Enabled
Logs List<DiagnosticSetting Enabled Log>  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- string
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- Log
Analytics stringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- Log
Analytics stringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Logs
List<Diagnostic
Setting Log>  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- Metrics
List<Diagnostic
Setting Metric>  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- Name string
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- Partner
Solution stringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Storage
Account stringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.
- Target
Resource stringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 - Enabled
Logs []DiagnosticSetting Enabled Log Args  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- string
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- Log
Analytics stringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- Log
Analytics stringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Logs
[]Diagnostic
Setting Log Args  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- Metrics
[]Diagnostic
Setting Metric Args  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- Name string
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- Partner
Solution stringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Storage
Account stringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.
- target
Resource StringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 - enabled
Logs List<DiagnosticSetting Enabled Log>  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- String
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log
Analytics StringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log
Analytics StringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs
List<Diagnostic
Setting Log>  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics
List<Diagnostic
Setting Metric>  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name String
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner
Solution StringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage
Account StringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.
- target
Resource stringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 - enabled
Logs DiagnosticSetting Enabled Log[]  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- string
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log
Analytics stringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log
Analytics stringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs
Diagnostic
Setting Log[]  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics
Diagnostic
Setting Metric[]  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name string
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner
Solution stringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage
Account stringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.
- target_
resource_ strid  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 - enabled_
logs Sequence[DiagnosticSetting Enabled Log Args]  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- str
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub_
name str Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log_
analytics_ strdestination_ type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log_
analytics_ strworkspace_ id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs
Sequence[Diagnostic
Setting Log Args]  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics
Sequence[Diagnostic
Setting Metric Args]  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name str
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner_
solution_ strid  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage_
account_ strid  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.
- target
Resource StringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 - enabled
Logs List<Property Map> One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- String
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log
Analytics StringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log
Analytics StringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs List<Property Map>
 One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics List<Property Map>
 One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name String
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner
Solution StringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage
Account StringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.
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 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,
        enabled_logs: Optional[Sequence[DiagnosticSettingEnabledLogArgs]] = 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,
        partner_solution_id: Optional[str] = None,
        storage_account_id: Optional[str] = None,
        target_resource_id: Optional[str] = None) -> DiagnosticSettingfunc 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.
 
- Enabled
Logs List<DiagnosticSetting Enabled Log>  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- string
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- Log
Analytics stringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- Log
Analytics stringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Logs
List<Diagnostic
Setting Log>  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- Metrics
List<Diagnostic
Setting Metric>  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- Name string
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- Partner
Solution stringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Storage
Account stringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Target
Resource stringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 
- Enabled
Logs []DiagnosticSetting Enabled Log Args  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- string
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- Log
Analytics stringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- Log
Analytics stringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Logs
[]Diagnostic
Setting Log Args  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- Metrics
[]Diagnostic
Setting Metric Args  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- Name string
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- Partner
Solution stringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Storage
Account stringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- Target
Resource stringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 
- enabled
Logs List<DiagnosticSetting Enabled Log>  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- String
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log
Analytics StringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log
Analytics StringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs
List<Diagnostic
Setting Log>  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics
List<Diagnostic
Setting Metric>  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name String
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner
Solution StringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage
Account StringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- target
Resource StringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 
- enabled
Logs DiagnosticSetting Enabled Log[]  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- string
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log
Analytics stringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log
Analytics stringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs
Diagnostic
Setting Log[]  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics
Diagnostic
Setting Metric[]  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name string
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner
Solution stringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage
Account stringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- target
Resource stringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 
- enabled_
logs Sequence[DiagnosticSetting Enabled Log Args]  One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- str
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub_
name str Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log_
analytics_ strdestination_ type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log_
analytics_ strworkspace_ id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs
Sequence[Diagnostic
Setting Log Args]  One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics
Sequence[Diagnostic
Setting Metric Args]  One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name str
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner_
solution_ strid  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage_
account_ strid  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- target_
resource_ strid  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 
- enabled
Logs List<Property Map> One or more
enabled_logblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified. At least one type of Log or Metric must be enabled.- String
 Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
NOTE: This can be sourced from the
azure.eventhub.EventHubNamespaceAuthorizationRuleresource and is different from aazure.eventhub.AuthorizationRuleresource.NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent.
NOTE: If this isn't specified then the default Event Hub will be used.
- log
Analytics StringDestination Type  Possible values are
AzureDiagnosticsandDedicated. When set toDedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacyAzureDiagnosticstable.NOTE: This setting will only have an effect if a
log_analytics_workspace_idis provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see resource types for services that use each method. Please see the documentation for details on the differences between destination types.- log
Analytics StringWorkspace Id  Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- logs List<Property Map>
 One or more
logblocks as defined below.NOTE:
logis deprecated in favour of theenabled_logproperty and will be removed in version 4.0 of the AzureRM Provider.- metrics List<Property Map>
 One or more
metricblocks as defined below.NOTE: At least one
log,enabled_logormetricblock must be specified.- name String
 Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.
NOTE: If the name is set to 'service' it will not be possible to fully delete the diagnostic setting. This is due to legacy API support.
- partner
Solution StringId  The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- storage
Account StringId  The ID of the Storage Account where logs should be sent.
NOTE: At least one of
eventhub_authorization_rule_id,log_analytics_workspace_id,partner_solution_idandstorage_account_idmust be specified.- target
Resource StringId  - The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
 
Supporting Types
DiagnosticSettingEnabledLog, DiagnosticSettingEnabledLogArgs        
- Category string
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- Retention
Policy DiagnosticSetting Enabled Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- Category string
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- Retention
Policy DiagnosticSetting Enabled Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category String
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category
Group String The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- retention
Policy DiagnosticSetting Enabled Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category string
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category
Group string The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- retention
Policy DiagnosticSetting Enabled Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category str
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category_
group str The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- retention_
policy DiagnosticSetting Enabled Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category String
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category
Group String The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- retention
Policy Property Map A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
DiagnosticSettingEnabledLogRetentionPolicy, DiagnosticSettingEnabledLogRetentionPolicyArgs            
DiagnosticSettingLog, DiagnosticSettingLogArgs      
- Category string
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- Enabled bool
 - Is this Diagnostic Log enabled? Defaults to 
true. - Retention
Policy DiagnosticSetting Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- Category string
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- Enabled bool
 - Is this Diagnostic Log enabled? Defaults to 
true. - Retention
Policy DiagnosticSetting Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category String
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category
Group String The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- enabled Boolean
 - Is this Diagnostic Log enabled? Defaults to 
true. - retention
Policy DiagnosticSetting Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category string
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category
Group string The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- enabled boolean
 - Is this Diagnostic Log enabled? Defaults to 
true. - retention
Policy DiagnosticSetting Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category str
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category_
group str The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- enabled bool
 - Is this Diagnostic Log enabled? Defaults to 
true. - retention_
policy DiagnosticSetting Log Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category String
 The name of a Diagnostic Log Category for this Resource.
NOTE: The Log Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source or list of service specific schemas to identify which categories are available for a given Resource.- category
Group String The name of a Diagnostic Log Category Group for this Resource.
NOTE: Not all resources have category groups available.
NOTE: Exactly one of
categoryorcategory_groupmust be specified.- enabled Boolean
 - Is this Diagnostic Log enabled? Defaults to 
true. - retention
Policy Property Map A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
DiagnosticSettingLogRetentionPolicy, DiagnosticSettingLogRetentionPolicyArgs          
DiagnosticSettingMetric, DiagnosticSettingMetricArgs      
- Category string
 The name of a Diagnostic Metric Category for this Resource.
NOTE: The Metric Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source to identify which categories are available for a given Resource.- Enabled bool
 - Is this Diagnostic Metric enabled? Defaults to 
true. - Retention
Policy DiagnosticSetting Metric Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- Category string
 The name of a Diagnostic Metric Category for this Resource.
NOTE: The Metric Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source to identify which categories are available for a given Resource.- Enabled bool
 - Is this Diagnostic Metric enabled? Defaults to 
true. - Retention
Policy DiagnosticSetting Metric Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category String
 The name of a Diagnostic Metric Category for this Resource.
NOTE: The Metric Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source to identify which categories are available for a given Resource.- enabled Boolean
 - Is this Diagnostic Metric enabled? Defaults to 
true. - retention
Policy DiagnosticSetting Metric Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category string
 The name of a Diagnostic Metric Category for this Resource.
NOTE: The Metric Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source to identify which categories are available for a given Resource.- enabled boolean
 - Is this Diagnostic Metric enabled? Defaults to 
true. - retention
Policy DiagnosticSetting Metric Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category str
 The name of a Diagnostic Metric Category for this Resource.
NOTE: The Metric Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source to identify which categories are available for a given Resource.- enabled bool
 - Is this Diagnostic Metric enabled? Defaults to 
true. - retention_
policy DiagnosticSetting Metric Retention Policy  A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
- category String
 The name of a Diagnostic Metric Category for this Resource.
NOTE: The Metric Categories available vary depending on the Resource being used. You may wish to use the
azure.monitoring.getDiagnosticCategoriesData Source to identify which categories are available for a given Resource.- enabled Boolean
 - Is this Diagnostic Metric enabled? Defaults to 
true. - retention
Policy Property Map A
retention_policyblock as defined below.!> NOTE:
retention_policyhas been deprecated in favor ofazure.storage.ManagementPolicyresource - to learn more information on the deprecation in the Azure documentation.
DiagnosticSettingMetricRetentionPolicy, DiagnosticSettingMetricRetentionPolicyArgs          
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"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
 - Azure Classic pulumi/pulumi-azure
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
azurermTerraform Provider.