azure.monitoring.DiagnosticSetting
Manages a Diagnostic Setting for an existing Resource.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var exampleAccount = Azure.Storage.GetAccount.Invoke(new()
{
Name = "examplestoracc",
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new()
{
Name = "example-vault",
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleDiagnosticSetting = new Azure.Monitoring.DiagnosticSetting("exampleDiagnosticSetting", new()
{
TargetResourceId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id),
StorageAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.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 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.StringPtrOutput),
StorageAccountId: exampleAccount.ApplyT(func(exampleAccount storage.GetAccountResult) (*string, error) {
return &exampleAccount.Id, nil
}).(pulumi.StringPtrOutput),
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
})
}
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.StorageFunctions;
import com.pulumi.azure.storage.inputs.GetAccountArgs;
import com.pulumi.azure.keyvault.KeyvaultFunctions;
import com.pulumi.azure.keyvault.inputs.GetKeyVaultArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
final var exampleAccount = StorageFunctions.getAccount(GetAccountArgs.builder()
.name("examplestoracc")
.resourceGroupName(exampleResourceGroup.name())
.build());
final var exampleKeyVault = KeyvaultFunctions.getKeyVault(GetKeyVaultArgs.builder()
.name("example-vault")
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleDiagnosticSetting = new DiagnosticSetting("exampleDiagnosticSetting", DiagnosticSettingArgs.builder()
.targetResourceId(exampleKeyVault.applyValue(getKeyVaultResult -> getKeyVaultResult).applyValue(exampleKeyVault -> exampleKeyVault.applyValue(getKeyVaultResult -> getKeyVaultResult.id())))
.storageAccountId(exampleAccount.applyValue(getAccountResult -> getAccountResult).applyValue(exampleAccount -> exampleAccount.applyValue(getAccountResult -> getAccountResult.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());
}
}
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,
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,
),
)])
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),
enabledLogs: [{
category: "AuditEvent",
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}
enabledLogs:
- category: AuditEvent
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 DiagnosticSetting Resource
new DiagnosticSetting(name: string, args: DiagnosticSettingArgs, opts?: CustomResourceOptions);
@overload
def DiagnosticSetting(resource_name: 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)
@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:
- 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 Args> One or more
enabled_log
blocks as defined below.- 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.
- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- Log
Analytics stringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- Log
Analytics stringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- Logs
List<Diagnostic
Setting Log Args> One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- Metrics
List<Diagnostic
Setting Metric Args> 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.
- 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.
- Storage
Account stringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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.
- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- Log
Analytics stringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- Log
Analytics stringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- Logs
[]Diagnostic
Setting Log Args One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- Metrics
[]Diagnostic
Setting Metric Args 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.
- 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.
- Storage
Account stringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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 Args> One or more
enabled_log
blocks as defined below.- 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.
- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- log
Analytics StringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log
Analytics StringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs
List<Diagnostic
Setting Log Args> One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics
List<Diagnostic
Setting Metric Args> 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.
- 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.
- storage
Account StringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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.
- eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- log
Analytics stringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log
Analytics stringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs
Diagnostic
Setting Log Args[] One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics
Diagnostic
Setting Metric Args[] 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.
- 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.
- storage
Account stringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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_ strdestination_ type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log_
analytics_ strworkspace_ id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs
Sequence[Diagnostic
Setting Log Args] One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics
Sequence[Diagnostic
Setting Metric Args] 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.
- 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.
- storage_
account_ strid The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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.
- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- log
Analytics StringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log
Analytics StringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs List<Property Map>
One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics List<Property Map>
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.
- 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.
- storage
Account StringId 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 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) -> 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.
- Enabled
Logs List<DiagnosticSetting Enabled Log Args> One or more
enabled_log
blocks as defined below.- 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.
- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- Log
Analytics stringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- Log
Analytics stringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- Logs
List<Diagnostic
Setting Log Args> One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- Metrics
List<Diagnostic
Setting Metric Args> 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.
- 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.
- Storage
Account stringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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.
- Eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- Log
Analytics stringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- Log
Analytics stringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- Logs
[]Diagnostic
Setting Log Args One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- Metrics
[]Diagnostic
Setting Metric Args 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.
- 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.
- Storage
Account stringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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 Args> One or more
enabled_log
blocks as defined below.- 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.
- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- log
Analytics StringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log
Analytics StringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs
List<Diagnostic
Setting Log Args> One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics
List<Diagnostic
Setting Metric Args> 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.
- 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.
- storage
Account StringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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.
- eventhub
Name string Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- log
Analytics stringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log
Analytics stringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs
Diagnostic
Setting Log Args[] One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics
Diagnostic
Setting Metric Args[] 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.
- 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.
- storage
Account stringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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_ strdestination_ type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log_
analytics_ strworkspace_ id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs
Sequence[Diagnostic
Setting Log Args] One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics
Sequence[Diagnostic
Setting Metric Args] 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.
- 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.
- storage_
account_ strid The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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_log
blocks as defined below.- 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.
- eventhub
Name String Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.
- log
Analytics StringDestination Type Possible values are
AzureDiagnostics
andDedicated
, default toAzureDiagnostics
. When set toDedicated
, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.- log
Analytics StringWorkspace Id Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
- logs List<Property Map>
One or more
log
blocks as defined below.log
has been superseded byenabled_log
and will be removed in version 4.0 of the AzureRM Provider.- metrics List<Property Map>
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.
- 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.
- storage
Account StringId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
- 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
- Category string
The name of a Diagnostic Log Category for this Resource.
- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
- Retention
Policy DiagnosticSetting Enabled Log Retention Policy A
retention_policy
block as defined below.
- Category string
The name of a Diagnostic Log Category for this Resource.
- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
- Retention
Policy DiagnosticSetting Enabled Log Retention Policy A
retention_policy
block as defined below.
- category String
The name of a Diagnostic Log Category for this Resource.
- category
Group String The name of a Diagnostic Log Category Group for this Resource.
- retention
Policy DiagnosticSetting Enabled Log Retention Policy A
retention_policy
block as defined below.
- category string
The name of a Diagnostic Log Category for this Resource.
- category
Group string The name of a Diagnostic Log Category Group for this Resource.
- retention
Policy DiagnosticSetting Enabled Log Retention Policy A
retention_policy
block as defined below.
- category str
The name of a Diagnostic Log Category for this Resource.
- category_
group str The name of a Diagnostic Log Category Group for this Resource.
- retention_
policy DiagnosticSetting Enabled Log Retention Policy A
retention_policy
block as defined below.
- category String
The name of a Diagnostic Log Category for this Resource.
- category
Group String The name of a Diagnostic Log Category Group for this Resource.
- retention
Policy Property Map A
retention_policy
block as defined below.
DiagnosticSettingEnabledLogRetentionPolicy
DiagnosticSettingLog
- Category string
The name of a Diagnostic Log Category for this Resource.
- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
- Enabled bool
Is this Diagnostic Log enabled? Defaults to
true
.- Retention
Policy DiagnosticSetting Log Retention Policy A
retention_policy
block as defined below.
- Category string
The name of a Diagnostic Log Category for this Resource.
- Category
Group string The name of a Diagnostic Log Category Group for this Resource.
- Enabled bool
Is this Diagnostic Log enabled? Defaults to
true
.- Retention
Policy DiagnosticSetting Log Retention Policy A
retention_policy
block as defined below.
- category String
The name of a Diagnostic Log Category for this Resource.
- category
Group String The name of a Diagnostic Log Category Group for this Resource.
- enabled Boolean
Is this Diagnostic Log enabled? Defaults to
true
.- retention
Policy DiagnosticSetting Log Retention Policy A
retention_policy
block as defined below.
- category string
The name of a Diagnostic Log Category for this Resource.
- category
Group string The name of a Diagnostic Log Category Group for this Resource.
- enabled boolean
Is this Diagnostic Log enabled? Defaults to
true
.- retention
Policy DiagnosticSetting Log Retention Policy A
retention_policy
block as defined below.
- category str
The name of a Diagnostic Log Category for this Resource.
- category_
group str The name of a Diagnostic Log Category Group for this Resource.
- enabled bool
Is this Diagnostic Log enabled? Defaults to
true
.- retention_
policy DiagnosticSetting Log Retention Policy A
retention_policy
block as defined below.
- category String
The name of a Diagnostic Log Category for this Resource.
- category
Group String The name of a Diagnostic Log Category Group for this Resource.
- enabled Boolean
Is this Diagnostic Log enabled? Defaults to
true
.- retention
Policy Property Map A
retention_policy
block as defined below.
DiagnosticSettingLogRetentionPolicy
DiagnosticSettingMetric
- Category string
The name of a Diagnostic Metric Category for this Resource.
- Enabled bool
Is this Diagnostic Metric enabled? Defaults to
true
.- Retention
Policy DiagnosticSetting Metric Retention Policy 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
.- Retention
Policy DiagnosticSetting Metric Retention Policy 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
.- retention
Policy DiagnosticSetting Metric Retention Policy 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
.- retention
Policy DiagnosticSetting Metric Retention Policy 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 DiagnosticSetting Metric Retention Policy 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
.- retention
Policy Property Map A
retention_policy
block as defined below.
DiagnosticSettingMetricRetentionPolicy
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
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.