DiagnosticSetting

Manages a Diagnostic Setting for an existing Resource.

Create a DiagnosticSetting Resource

def DiagnosticSetting(resource_name, opts=None, eventhub_authorization_rule_id=None, eventhub_name=None, log_analytics_destination_type=None, log_analytics_workspace_id=None, logs=None, metrics=None, name=None, storage_account_id=None, target_resource_id=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DiagnosticSettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DiagnosticSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

DiagnosticSetting Resource Properties

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

Inputs

The DiagnosticSetting resource accepts the following input properties:

TargetResourceId string

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

EventhubAuthorizationRuleId string

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

EventhubName string

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

LogAnalyticsDestinationType string

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

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

Logs List<DiagnosticSettingLogArgs>

One or more log blocks as defined below.

Metrics List<DiagnosticSettingMetricArgs>

One or more metric blocks as defined below.

Name string

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

StorageAccountId string

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

TargetResourceId string

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

EventhubAuthorizationRuleId string

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

EventhubName string

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

LogAnalyticsDestinationType string

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

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

Logs []DiagnosticSettingLog

One or more log blocks as defined below.

Metrics []DiagnosticSettingMetric

One or more metric blocks as defined below.

Name string

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

StorageAccountId string

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

targetResourceId string

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

eventhubAuthorizationRuleId string

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

eventhubName string

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

logAnalyticsDestinationType string

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

logAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logs DiagnosticSettingLog[]

One or more log blocks as defined below.

metrics DiagnosticSettingMetric[]

One or more metric blocks as defined below.

name string

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

storageAccountId string

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

target_resource_id str

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

eventhub_authorization_rule_id str

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

eventhub_name str

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

log_analytics_destination_type str

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

log_analytics_workspace_id str

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logs List[DiagnosticSettingLog]

One or more log blocks as defined below.

metrics List[DiagnosticSettingMetric]

One or more metric blocks as defined below.

name str

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

storage_account_id str

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing DiagnosticSetting Resource

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

public static get(name: string, id: Input<ID>, state?: DiagnosticSettingState, opts?: CustomResourceOptions): DiagnosticSetting
static get(resource_name, id, opts=None, eventhub_authorization_rule_id=None, eventhub_name=None, log_analytics_destination_type=None, log_analytics_workspace_id=None, logs=None, metrics=None, name=None, storage_account_id=None, target_resource_id=None, __props__=None);
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)
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.

The following state arguments are supported:

EventhubAuthorizationRuleId string

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

EventhubName string

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

LogAnalyticsDestinationType string

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

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

Logs List<DiagnosticSettingLogArgs>

One or more log blocks as defined below.

Metrics List<DiagnosticSettingMetricArgs>

One or more metric blocks as defined below.

Name string

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

StorageAccountId string

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

TargetResourceId string

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

EventhubAuthorizationRuleId string

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

EventhubName string

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

LogAnalyticsDestinationType string

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

LogAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

Logs []DiagnosticSettingLog

One or more log blocks as defined below.

Metrics []DiagnosticSettingMetric

One or more metric blocks as defined below.

Name string

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

StorageAccountId string

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

TargetResourceId string

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

eventhubAuthorizationRuleId string

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

eventhubName string

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

logAnalyticsDestinationType string

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

logAnalyticsWorkspaceId string

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logs DiagnosticSettingLog[]

One or more log blocks as defined below.

metrics DiagnosticSettingMetric[]

One or more metric blocks as defined below.

name string

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

storageAccountId string

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

targetResourceId string

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

eventhub_authorization_rule_id str

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

eventhub_name str

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

log_analytics_destination_type str

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

log_analytics_workspace_id str

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

logs List[DiagnosticSettingLog]

One or more log blocks as defined below.

metrics List[DiagnosticSettingMetric]

One or more metric blocks as defined below.

name str

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

storage_account_id str

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

target_resource_id str

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

Supporting Types

DiagnosticSettingLog

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Category string

The name of a Diagnostic Log Category for this Resource.

Enabled bool

Is this Diagnostic Log enabled? Defaults to true.

RetentionPolicy DiagnosticSettingLogRetentionPolicyArgs

A retention_policy block as defined below.

Category string

The name of a Diagnostic Log Category for this Resource.

Enabled bool

Is this Diagnostic Log enabled? Defaults to true.

RetentionPolicy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

category string

The name of a Diagnostic Log Category for this Resource.

enabled boolean

Is this Diagnostic Log enabled? Defaults to true.

retentionPolicy DiagnosticSettingLogRetentionPolicy

A retention_policy block as defined below.

category str

The name of a Diagnostic Log Category for this Resource.

enabled bool

Is this Diagnostic Log enabled? Defaults to true.

retention_policy Dict[DiagnosticSettingLogRetentionPolicy]

A retention_policy block as defined below.

DiagnosticSettingLogRetentionPolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Enabled bool

Is this Retention Policy enabled?

Days int

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

Enabled bool

Is this Retention Policy enabled?

Days int

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

enabled boolean

Is this Retention Policy enabled?

days number

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

enabled bool

Is this Retention Policy enabled?

days float

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

DiagnosticSettingMetric

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Category string

The name of a Diagnostic Metric Category for this Resource.

Enabled bool

Is this Diagnostic Metric enabled? Defaults to true.

RetentionPolicy DiagnosticSettingMetricRetentionPolicyArgs

A retention_policy block as defined below.

Category string

The name of a Diagnostic Metric Category for this Resource.

Enabled bool

Is this Diagnostic Metric enabled? Defaults to true.

RetentionPolicy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

category string

The name of a Diagnostic Metric Category for this Resource.

enabled boolean

Is this Diagnostic Metric enabled? Defaults to true.

retentionPolicy DiagnosticSettingMetricRetentionPolicy

A retention_policy block as defined below.

category str

The name of a Diagnostic Metric Category for this Resource.

enabled bool

Is this Diagnostic Metric enabled? Defaults to true.

retention_policy Dict[DiagnosticSettingMetricRetentionPolicy]

A retention_policy block as defined below.

DiagnosticSettingMetricRetentionPolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Enabled bool

Is this Retention Policy enabled?

Days int

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

Enabled bool

Is this Retention Policy enabled?

Days int

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

enabled boolean

Is this Retention Policy enabled?

days number

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

enabled bool

Is this Retention Policy enabled?

days float

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

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.