/
diagnosticSetting.go
601 lines (544 loc) · 34.1 KB
/
diagnosticSetting.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package monitoring
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Diagnostic Setting for an existing Resource.
//
// ## Example Usage
//
// ```go
// 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
// })
// }
//
// ```
//
// ## Import
//
// Diagnostic Settings can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:monitoring/diagnosticSetting:DiagnosticSetting example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.KeyVault/vaults/vault1|logMonitoring1"
// ```
type DiagnosticSetting struct {
pulumi.CustomResourceState
// One or more `enabledLog` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified. At least one type of Log or Metric must be enabled.
EnabledLogs DiagnosticSettingEnabledLogArrayOutput `pulumi:"enabledLogs"`
// Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
//
// > **NOTE:** This can be sourced from the `eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `eventhub.AuthorizationRule` resource.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
EventhubAuthorizationRuleId pulumi.StringPtrOutput `pulumi:"eventhubAuthorizationRuleId"`
// 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.
EventhubName pulumi.StringPtrOutput `pulumi:"eventhubName"`
// Possible values are `AzureDiagnostics` and `Dedicated`. When set to `Dedicated`, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy `AzureDiagnostics` table.
//
// > **NOTE:** This setting will only have an effect if a `logAnalyticsWorkspaceId` is provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see [resource types](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics#resource-types) for services that use each method. Please [see the documentation](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-stream-log-store#azure-diagnostics-vs-resource-specific) for details on the differences between destination types.
LogAnalyticsDestinationType pulumi.StringOutput `pulumi:"logAnalyticsDestinationType"`
// Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
LogAnalyticsWorkspaceId pulumi.StringPtrOutput `pulumi:"logAnalyticsWorkspaceId"`
// One or more `log` blocks as defined below.
//
// > **NOTE:** `log` is deprecated in favour of the `enabledLog` property and will be removed in version 4.0 of the AzureRM Provider.
//
// Deprecated: `log` has been superseded by `enabledLog` and will be removed in version 4.0 of the AzureRM Provider.
Logs DiagnosticSettingLogArrayOutput `pulumi:"logs"`
// One or more `metric` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified.
Metrics DiagnosticSettingMetricArrayOutput `pulumi:"metrics"`
// 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.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, [click to learn more about partner integration](https://learn.microsoft.com/en-us/azure/partner-solutions/overview).
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
PartnerSolutionId pulumi.StringPtrOutput `pulumi:"partnerSolutionId"`
// The ID of the Storage Account where logs should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
StorageAccountId pulumi.StringPtrOutput `pulumi:"storageAccountId"`
// The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
TargetResourceId pulumi.StringOutput `pulumi:"targetResourceId"`
}
// NewDiagnosticSetting registers a new resource with the given unique name, arguments, and options.
func NewDiagnosticSetting(ctx *pulumi.Context,
name string, args *DiagnosticSettingArgs, opts ...pulumi.ResourceOption) (*DiagnosticSetting, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.TargetResourceId == nil {
return nil, errors.New("invalid value for required argument 'TargetResourceId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DiagnosticSetting
err := ctx.RegisterResource("azure:monitoring/diagnosticSetting:DiagnosticSetting", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDiagnosticSetting gets an existing DiagnosticSetting resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDiagnosticSetting(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DiagnosticSettingState, opts ...pulumi.ResourceOption) (*DiagnosticSetting, error) {
var resource DiagnosticSetting
err := ctx.ReadResource("azure:monitoring/diagnosticSetting:DiagnosticSetting", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DiagnosticSetting resources.
type diagnosticSettingState struct {
// One or more `enabledLog` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified. At least one type of Log or Metric must be enabled.
EnabledLogs []DiagnosticSettingEnabledLog `pulumi:"enabledLogs"`
// Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
//
// > **NOTE:** This can be sourced from the `eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `eventhub.AuthorizationRule` resource.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
EventhubAuthorizationRuleId *string `pulumi:"eventhubAuthorizationRuleId"`
// 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.
EventhubName *string `pulumi:"eventhubName"`
// Possible values are `AzureDiagnostics` and `Dedicated`. When set to `Dedicated`, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy `AzureDiagnostics` table.
//
// > **NOTE:** This setting will only have an effect if a `logAnalyticsWorkspaceId` is provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see [resource types](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics#resource-types) for services that use each method. Please [see the documentation](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-stream-log-store#azure-diagnostics-vs-resource-specific) for details on the differences between destination types.
LogAnalyticsDestinationType *string `pulumi:"logAnalyticsDestinationType"`
// Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
LogAnalyticsWorkspaceId *string `pulumi:"logAnalyticsWorkspaceId"`
// One or more `log` blocks as defined below.
//
// > **NOTE:** `log` is deprecated in favour of the `enabledLog` property and will be removed in version 4.0 of the AzureRM Provider.
//
// Deprecated: `log` has been superseded by `enabledLog` and will be removed in version 4.0 of the AzureRM Provider.
Logs []DiagnosticSettingLog `pulumi:"logs"`
// One or more `metric` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified.
Metrics []DiagnosticSettingMetric `pulumi:"metrics"`
// 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.
Name *string `pulumi:"name"`
// The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, [click to learn more about partner integration](https://learn.microsoft.com/en-us/azure/partner-solutions/overview).
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
PartnerSolutionId *string `pulumi:"partnerSolutionId"`
// The ID of the Storage Account where logs should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
StorageAccountId *string `pulumi:"storageAccountId"`
// The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
TargetResourceId *string `pulumi:"targetResourceId"`
}
type DiagnosticSettingState struct {
// One or more `enabledLog` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified. At least one type of Log or Metric must be enabled.
EnabledLogs DiagnosticSettingEnabledLogArrayInput
// Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
//
// > **NOTE:** This can be sourced from the `eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `eventhub.AuthorizationRule` resource.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
EventhubAuthorizationRuleId pulumi.StringPtrInput
// 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.
EventhubName pulumi.StringPtrInput
// Possible values are `AzureDiagnostics` and `Dedicated`. When set to `Dedicated`, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy `AzureDiagnostics` table.
//
// > **NOTE:** This setting will only have an effect if a `logAnalyticsWorkspaceId` is provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see [resource types](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics#resource-types) for services that use each method. Please [see the documentation](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-stream-log-store#azure-diagnostics-vs-resource-specific) for details on the differences between destination types.
LogAnalyticsDestinationType pulumi.StringPtrInput
// Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
LogAnalyticsWorkspaceId pulumi.StringPtrInput
// One or more `log` blocks as defined below.
//
// > **NOTE:** `log` is deprecated in favour of the `enabledLog` property and will be removed in version 4.0 of the AzureRM Provider.
//
// Deprecated: `log` has been superseded by `enabledLog` and will be removed in version 4.0 of the AzureRM Provider.
Logs DiagnosticSettingLogArrayInput
// One or more `metric` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified.
Metrics DiagnosticSettingMetricArrayInput
// 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.
Name pulumi.StringPtrInput
// The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, [click to learn more about partner integration](https://learn.microsoft.com/en-us/azure/partner-solutions/overview).
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
PartnerSolutionId pulumi.StringPtrInput
// The ID of the Storage Account where logs should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
StorageAccountId pulumi.StringPtrInput
// The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
TargetResourceId pulumi.StringPtrInput
}
func (DiagnosticSettingState) ElementType() reflect.Type {
return reflect.TypeOf((*diagnosticSettingState)(nil)).Elem()
}
type diagnosticSettingArgs struct {
// One or more `enabledLog` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified. At least one type of Log or Metric must be enabled.
EnabledLogs []DiagnosticSettingEnabledLog `pulumi:"enabledLogs"`
// Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
//
// > **NOTE:** This can be sourced from the `eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `eventhub.AuthorizationRule` resource.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
EventhubAuthorizationRuleId *string `pulumi:"eventhubAuthorizationRuleId"`
// 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.
EventhubName *string `pulumi:"eventhubName"`
// Possible values are `AzureDiagnostics` and `Dedicated`. When set to `Dedicated`, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy `AzureDiagnostics` table.
//
// > **NOTE:** This setting will only have an effect if a `logAnalyticsWorkspaceId` is provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see [resource types](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics#resource-types) for services that use each method. Please [see the documentation](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-stream-log-store#azure-diagnostics-vs-resource-specific) for details on the differences between destination types.
LogAnalyticsDestinationType *string `pulumi:"logAnalyticsDestinationType"`
// Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
LogAnalyticsWorkspaceId *string `pulumi:"logAnalyticsWorkspaceId"`
// One or more `log` blocks as defined below.
//
// > **NOTE:** `log` is deprecated in favour of the `enabledLog` property and will be removed in version 4.0 of the AzureRM Provider.
//
// Deprecated: `log` has been superseded by `enabledLog` and will be removed in version 4.0 of the AzureRM Provider.
Logs []DiagnosticSettingLog `pulumi:"logs"`
// One or more `metric` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified.
Metrics []DiagnosticSettingMetric `pulumi:"metrics"`
// 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.
Name *string `pulumi:"name"`
// The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, [click to learn more about partner integration](https://learn.microsoft.com/en-us/azure/partner-solutions/overview).
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
PartnerSolutionId *string `pulumi:"partnerSolutionId"`
// The ID of the Storage Account where logs should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
StorageAccountId *string `pulumi:"storageAccountId"`
// The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
TargetResourceId string `pulumi:"targetResourceId"`
}
// The set of arguments for constructing a DiagnosticSetting resource.
type DiagnosticSettingArgs struct {
// One or more `enabledLog` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified. At least one type of Log or Metric must be enabled.
EnabledLogs DiagnosticSettingEnabledLogArrayInput
// Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
//
// > **NOTE:** This can be sourced from the `eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `eventhub.AuthorizationRule` resource.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
EventhubAuthorizationRuleId pulumi.StringPtrInput
// 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.
EventhubName pulumi.StringPtrInput
// Possible values are `AzureDiagnostics` and `Dedicated`. When set to `Dedicated`, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy `AzureDiagnostics` table.
//
// > **NOTE:** This setting will only have an effect if a `logAnalyticsWorkspaceId` is provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see [resource types](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics#resource-types) for services that use each method. Please [see the documentation](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-stream-log-store#azure-diagnostics-vs-resource-specific) for details on the differences between destination types.
LogAnalyticsDestinationType pulumi.StringPtrInput
// Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
LogAnalyticsWorkspaceId pulumi.StringPtrInput
// One or more `log` blocks as defined below.
//
// > **NOTE:** `log` is deprecated in favour of the `enabledLog` property and will be removed in version 4.0 of the AzureRM Provider.
//
// Deprecated: `log` has been superseded by `enabledLog` and will be removed in version 4.0 of the AzureRM Provider.
Logs DiagnosticSettingLogArrayInput
// One or more `metric` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified.
Metrics DiagnosticSettingMetricArrayInput
// 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.
Name pulumi.StringPtrInput
// The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, [click to learn more about partner integration](https://learn.microsoft.com/en-us/azure/partner-solutions/overview).
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
PartnerSolutionId pulumi.StringPtrInput
// The ID of the Storage Account where logs should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
StorageAccountId pulumi.StringPtrInput
// The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
TargetResourceId pulumi.StringInput
}
func (DiagnosticSettingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*diagnosticSettingArgs)(nil)).Elem()
}
type DiagnosticSettingInput interface {
pulumi.Input
ToDiagnosticSettingOutput() DiagnosticSettingOutput
ToDiagnosticSettingOutputWithContext(ctx context.Context) DiagnosticSettingOutput
}
func (*DiagnosticSetting) ElementType() reflect.Type {
return reflect.TypeOf((**DiagnosticSetting)(nil)).Elem()
}
func (i *DiagnosticSetting) ToDiagnosticSettingOutput() DiagnosticSettingOutput {
return i.ToDiagnosticSettingOutputWithContext(context.Background())
}
func (i *DiagnosticSetting) ToDiagnosticSettingOutputWithContext(ctx context.Context) DiagnosticSettingOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiagnosticSettingOutput)
}
// DiagnosticSettingArrayInput is an input type that accepts DiagnosticSettingArray and DiagnosticSettingArrayOutput values.
// You can construct a concrete instance of `DiagnosticSettingArrayInput` via:
//
// DiagnosticSettingArray{ DiagnosticSettingArgs{...} }
type DiagnosticSettingArrayInput interface {
pulumi.Input
ToDiagnosticSettingArrayOutput() DiagnosticSettingArrayOutput
ToDiagnosticSettingArrayOutputWithContext(context.Context) DiagnosticSettingArrayOutput
}
type DiagnosticSettingArray []DiagnosticSettingInput
func (DiagnosticSettingArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DiagnosticSetting)(nil)).Elem()
}
func (i DiagnosticSettingArray) ToDiagnosticSettingArrayOutput() DiagnosticSettingArrayOutput {
return i.ToDiagnosticSettingArrayOutputWithContext(context.Background())
}
func (i DiagnosticSettingArray) ToDiagnosticSettingArrayOutputWithContext(ctx context.Context) DiagnosticSettingArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiagnosticSettingArrayOutput)
}
// DiagnosticSettingMapInput is an input type that accepts DiagnosticSettingMap and DiagnosticSettingMapOutput values.
// You can construct a concrete instance of `DiagnosticSettingMapInput` via:
//
// DiagnosticSettingMap{ "key": DiagnosticSettingArgs{...} }
type DiagnosticSettingMapInput interface {
pulumi.Input
ToDiagnosticSettingMapOutput() DiagnosticSettingMapOutput
ToDiagnosticSettingMapOutputWithContext(context.Context) DiagnosticSettingMapOutput
}
type DiagnosticSettingMap map[string]DiagnosticSettingInput
func (DiagnosticSettingMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DiagnosticSetting)(nil)).Elem()
}
func (i DiagnosticSettingMap) ToDiagnosticSettingMapOutput() DiagnosticSettingMapOutput {
return i.ToDiagnosticSettingMapOutputWithContext(context.Background())
}
func (i DiagnosticSettingMap) ToDiagnosticSettingMapOutputWithContext(ctx context.Context) DiagnosticSettingMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiagnosticSettingMapOutput)
}
type DiagnosticSettingOutput struct{ *pulumi.OutputState }
func (DiagnosticSettingOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DiagnosticSetting)(nil)).Elem()
}
func (o DiagnosticSettingOutput) ToDiagnosticSettingOutput() DiagnosticSettingOutput {
return o
}
func (o DiagnosticSettingOutput) ToDiagnosticSettingOutputWithContext(ctx context.Context) DiagnosticSettingOutput {
return o
}
// One or more `enabledLog` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified. At least one type of Log or Metric must be enabled.
func (o DiagnosticSettingOutput) EnabledLogs() DiagnosticSettingEnabledLogArrayOutput {
return o.ApplyT(func(v *DiagnosticSetting) DiagnosticSettingEnabledLogArrayOutput { return v.EnabledLogs }).(DiagnosticSettingEnabledLogArrayOutput)
}
// Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.
//
// > **NOTE:** This can be sourced from the `eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `eventhub.AuthorizationRule` resource.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
func (o DiagnosticSettingOutput) EventhubAuthorizationRuleId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringPtrOutput { return v.EventhubAuthorizationRuleId }).(pulumi.StringPtrOutput)
}
// 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.
func (o DiagnosticSettingOutput) EventhubName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringPtrOutput { return v.EventhubName }).(pulumi.StringPtrOutput)
}
// Possible values are `AzureDiagnostics` and `Dedicated`. When set to `Dedicated`, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy `AzureDiagnostics` table.
//
// > **NOTE:** This setting will only have an effect if a `logAnalyticsWorkspaceId` is provided. For some target resource type (e.g., Key Vault), this field is unconfigurable. Please see [resource types](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics#resource-types) for services that use each method. Please [see the documentation](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-stream-log-store#azure-diagnostics-vs-resource-specific) for details on the differences between destination types.
func (o DiagnosticSettingOutput) LogAnalyticsDestinationType() pulumi.StringOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringOutput { return v.LogAnalyticsDestinationType }).(pulumi.StringOutput)
}
// Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
func (o DiagnosticSettingOutput) LogAnalyticsWorkspaceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringPtrOutput { return v.LogAnalyticsWorkspaceId }).(pulumi.StringPtrOutput)
}
// One or more `log` blocks as defined below.
//
// > **NOTE:** `log` is deprecated in favour of the `enabledLog` property and will be removed in version 4.0 of the AzureRM Provider.
//
// Deprecated: `log` has been superseded by `enabledLog` and will be removed in version 4.0 of the AzureRM Provider.
func (o DiagnosticSettingOutput) Logs() DiagnosticSettingLogArrayOutput {
return o.ApplyT(func(v *DiagnosticSetting) DiagnosticSettingLogArrayOutput { return v.Logs }).(DiagnosticSettingLogArrayOutput)
}
// One or more `metric` blocks as defined below.
//
// > **NOTE:** At least one `log`, `enabledLog` or `metric` block must be specified.
func (o DiagnosticSettingOutput) Metrics() DiagnosticSettingMetricArrayOutput {
return o.ApplyT(func(v *DiagnosticSetting) DiagnosticSettingMetricArrayOutput { return v.Metrics }).(DiagnosticSettingMetricArrayOutput)
}
// 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.
func (o DiagnosticSettingOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, [click to learn more about partner integration](https://learn.microsoft.com/en-us/azure/partner-solutions/overview).
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
func (o DiagnosticSettingOutput) PartnerSolutionId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringPtrOutput { return v.PartnerSolutionId }).(pulumi.StringPtrOutput)
}
// The ID of the Storage Account where logs should be sent.
//
// > **NOTE:** At least one of `eventhubAuthorizationRuleId`, `logAnalyticsWorkspaceId`, `partnerSolutionId` and `storageAccountId` must be specified.
func (o DiagnosticSettingOutput) StorageAccountId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringPtrOutput { return v.StorageAccountId }).(pulumi.StringPtrOutput)
}
// The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.
func (o DiagnosticSettingOutput) TargetResourceId() pulumi.StringOutput {
return o.ApplyT(func(v *DiagnosticSetting) pulumi.StringOutput { return v.TargetResourceId }).(pulumi.StringOutput)
}
type DiagnosticSettingArrayOutput struct{ *pulumi.OutputState }
func (DiagnosticSettingArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DiagnosticSetting)(nil)).Elem()
}
func (o DiagnosticSettingArrayOutput) ToDiagnosticSettingArrayOutput() DiagnosticSettingArrayOutput {
return o
}
func (o DiagnosticSettingArrayOutput) ToDiagnosticSettingArrayOutputWithContext(ctx context.Context) DiagnosticSettingArrayOutput {
return o
}
func (o DiagnosticSettingArrayOutput) Index(i pulumi.IntInput) DiagnosticSettingOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DiagnosticSetting {
return vs[0].([]*DiagnosticSetting)[vs[1].(int)]
}).(DiagnosticSettingOutput)
}
type DiagnosticSettingMapOutput struct{ *pulumi.OutputState }
func (DiagnosticSettingMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DiagnosticSetting)(nil)).Elem()
}
func (o DiagnosticSettingMapOutput) ToDiagnosticSettingMapOutput() DiagnosticSettingMapOutput {
return o
}
func (o DiagnosticSettingMapOutput) ToDiagnosticSettingMapOutputWithContext(ctx context.Context) DiagnosticSettingMapOutput {
return o
}
func (o DiagnosticSettingMapOutput) MapIndex(k pulumi.StringInput) DiagnosticSettingOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DiagnosticSetting {
return vs[0].(map[string]*DiagnosticSetting)[vs[1].(string)]
}).(DiagnosticSettingOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DiagnosticSettingInput)(nil)).Elem(), &DiagnosticSetting{})
pulumi.RegisterInputType(reflect.TypeOf((*DiagnosticSettingArrayInput)(nil)).Elem(), DiagnosticSettingArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DiagnosticSettingMapInput)(nil)).Elem(), DiagnosticSettingMap{})
pulumi.RegisterOutputType(DiagnosticSettingOutput{})
pulumi.RegisterOutputType(DiagnosticSettingArrayOutput{})
pulumi.RegisterOutputType(DiagnosticSettingMapOutput{})
}